(N/A) In a longitudinal wave,the constituents of the medium oscillate forward and backward in the direction of propagation of the wave.
The property that determines the extent to which the volume of an element of a medium changes when the pressure on it changes is the bulk modulus $B$. Its dimensional formula is $[M^{1} L^{-1} T^{-2}]$.
The longitudinal waves in a medium travel in the form of compressions and rarefactions,which are changes in the density $\rho$. The dimension of density is $[M^{1} L^{-3} T^{0}]$.
Thus,the dimension of the ratio $\frac{B}{\rho}$ is:
$\frac{[B]}{[\rho]} = \frac{[M^{1} L^{-1} T^{-2}]}{[M^{1} L^{-3} T^{0}]} = [L^{2} T^{-2}]$
Since the dimension of velocity $v$ is $[L^{1} T^{-1}]$,we have $[v^{2}] = [L^{2} T^{-2}]$.
Therefore,$\frac{B}{\rho} \propto v^{2}$.
On the basis of dimensional analysis,the expression for the speed of longitudinal waves in a medium is $v = C \sqrt{\frac{B}{\rho}}$,where $C$ is a dimensionless constant,which is found to be $1$.
Thus,the speed of longitudinal waves in a fluid is $v = \sqrt{\frac{B}{\rho}}$.
For a solid bar or rod,the relevant modulus of elasticity is Young's modulus $Y$,and the speed is given by $v = \sqrt{\frac{Y}{\rho}}$.