Solution (source code)

= Solution

Small sound disturbances in a gas couple density, pressure and longitudinal velocity. Linearizing mass conservation and the pressure-gradient force about a uniform state gives
$$
\partial_t\rho'+\rho_0\nabla\cdot\mathbf u=0,\qquad
\rho_0\partial_t\mathbf u=-\nabla p',\qquad p'=c_s^2\rho'.
$$
Eliminating velocity yields $\partial_t^2\rho'=c_s^2\nabla^2\rho'$. When local heat exchange is negligible over an oscillation, $c_s^2=(\partial p/\partial\rho)_s$. For an ideal gas,
$$
\boxed{c_s=\sqrt{\gamma p_0/\rho_0}=\sqrt{\gamma k_BT/m_{\rm molecule}}.}
$$
The adiabatic index is $\gamma=C_p/C_V$; an isothermal disturbance instead has $c_T^2=p_0/\rho_0$. Pressure and velocity in a progressive plane wave are in phase and obey $p'=\rho_0c_su$, with average energy flux $\langle p'u\rangle=p_{\rm peak}'^{\,2}/(2\rho_0c_s)$. Particle oscillation speed is not the sound propagation speed. Viscosity, heat conduction and molecular relaxation dissipate sound; changes in active internal degrees of freedom can cause dispersion. The continuum acoustic model requires wavelength large compared with the molecular mean free path and small fractional perturbations.