Solution (source code)

= Solution

Let the velocity perturbation be $(u,w)$, pressure perturbation be $p$, and density perturbation be $\rho'$ about the hydrostatic background $\hat\rho(z)$. The linearized inviscid <Boussinesq approximation> gives
$$
u_x+w_z=0,\qquad
\rho'_t+w\hat\rho_z=0,\qquad
u_t=-p_x/\rho_0,\qquad
w_t=-p_z/\rho_0-g\rho'/\rho_0.
$$
Stable stratification means $\hat\rho_z<0$, and the <buoyancy frequency> is
$$
\boxed{N^2=-\frac g{\rho_0}\frac{d\hat\rho}{dz}>0}.
$$
Differentiate the momentum equations to eliminate $p$, use incompressibility, and then use the density equation to eliminate $\rho'$. This yields
$$
\boxed{\left[\left(\partial_x^2+\partial_z^2\right)\partial_t^2+N^2\partial_x^2\right]w=0}.
$$
For $w\propto e^{i(kx+mz-\omega t)}$, the <internal gravity wave> dispersion relation is $\omega^2=N^2k^2/(k^2+m^2)$.