Solution (source code)

= Solution

The inviscid equations are $\rho_t+\nabla\cdot(\rho\mathbf u)=0$ and $\rho[\mathbf u_t+(\mathbf u\cdot\nabla)\mathbf u]=-\nabla p$. Write $\rho=\rho_0+\rho'$, $p=P(\rho_0)+p'$ and retain only linear terms. With $c_0^2=P'(\rho_0)>0$, barotropy gives $p'=c_0^2\rho'$. Irrotational perturbations allow $\mathbf u'=\nabla\phi$. The momentum equation integrates to $p'=-\rho_0\phi_t$, after using the time-dependent gauge of $\phi$ to remove the spatially constant integration term. Thus
$$
\boxed{c_0^2=P'(\rho_0),\quad p'=-\rho_0\phi_t,\quad\rho'=-\frac{\rho_0}{c_0^2}\phi_t.}
$$
Substitution into $\rho'_t+\rho_0\Delta\phi=0$ gives the acoustic <wave equation> $\boxed{\phi_{tt}=c_0^2\Delta\phi}$.