Solution (source code)

= Solution

Use <plane wave> perturbations proportional to $e^{i(k_xx+k_zz-\omega t)}$, with amplitudes $\widehat u,\widehat w,\widehat\pi,\widehat\varrho$. The linear equations become
$$
k_x\widehat u+k_z\widehat w=0,\qquad
\omega\rho_0\widehat u=k_x\widehat\pi,\qquad
-i\omega\rho_0\widehat w=-ik_z\widehat\pi-g\widehat\varrho,\qquad
-i\omega\widehat\varrho=-\rho'_0\widehat w.
$$
To eliminate <pressure> without dividing by $k_x$, multiply the vertical momentum equation by $k_x$ and subtract $k_z$ times the horizontal momentum equation:
$$
-i\omega\rho_0(k_x\widehat w-k_z\widehat u)=-gk_x\widehat\varrho.
$$
Use <incompressible flow> and the equation for <mass density> to obtain $\omega^2\rho_0(k_x^2+k_z^2)\widehat w=-g\rho'_0k_x^2\widehat w$. Hence, for a nontrivial <internal gravity wave>,
$$
\boxed{\omega^2=N^2\frac{k_x^2}{k_x^2+k_z^2},\qquad
N^2=-\frac{g\rho'_0}{\rho_0}.}
$$
For stable <density stratification>, $\rho'_0<0$ and $N=\sqrt{-g\rho'_0/\rho_0}$ is the <buoyancy frequency>. Then $0\le\omega^2\le N^2$ and the <normal modes> oscillate rather than grow. For $\rho'_0>0$, a mode with $k_x\ne0$ has $\omega^2<0$ and grows exponentially: denser fluid lies above lighter fluid. Uniform density, $\rho'_0=0$, is marginal for this restoring mechanism.

The case $k_x=0$, $k_z\ne0$, has zero <frequency> in the displayed relation. <Incompressible flow> then requires $\widehat w=0$, so it is a degenerate non-propagating case rather than a finite-frequency vertical oscillation. These equations concern the incompressible model of part (b); its $N^2$ does not contain the adiabatic compression correction needed in part (a).