Solution (source code)

= Solution

Use the <Boussinesq approximation> with a constant inertial reference <mass density> $\rho_0$, keeping the background <mass density> gradient in <buoyancy>. Write $V(z)=\overline U(z)-c$ and $P=\widehat p/\rho_0$. For $k\ne0$, the linearized <normal mode> equations are
$$
ikV\widehat u+\overline U'\widehat w=-ikP,\qquad
ikV\widehat w=-P'-\frac g{\rho_0}\widehat\rho,\qquad
ikV\widehat\rho+\overline\rho'\widehat w=0,\qquad
ik\widehat u+\widehat w'=0.
$$
The reference <mass density> is chosen close to the background values, whose relative variation must be small. Hydrostatic background <pressure> satisfies $\overline p'=-g\overline\rho$.

From <incompressibility>, $\widehat u=i\widehat w'/k$. The horizontal momentum equation and the density equation then give
$$
P=\frac{V\widehat w'-\overline U'\widehat w}{ik},\qquad
\widehat\rho=-\frac{\overline\rho'\widehat w}{ikV}.
$$
Substitute these into the vertical momentum equation and multiply by $ik$:
$$
-k^2V\widehat w=-V\widehat w''+\overline U''\widehat w+\frac{g\overline\rho'}{\rho_0V}\widehat w.
$$
For $V\ne0$, rearrangement gives \b[the <Taylor–Goldstein equation>]
$$
\boxed{\widehat w''-k^2\widehat w-\frac{\overline U''}{\overline U-c}\widehat w+\frac{N^2}{(\overline U-c)^2}\widehat w=0,\qquad
N^2=-\frac g{\rho_0}\overline\rho'.}
$$
The <buoyancy frequency> $N$ is real for stable stratification, where $\overline\rho'<0$. Points where $\overline U=c$ are <critical levels of an internal gravity wave>; the derivation there is understood through a limiting or piecewise formulation. The printed density gradient is $\overline\rho'$, not the pressure gradient accidentally substituted in the local TeX.