Solution (source code)

= Solution

Put $D=\partial_t+U\partial_x$, write $p$ for perturbation pressure divided by $\rho_0$, and set $b=-g\rho'/\rho_0$. The linearized <Boussinesq approximation>, <incompressibility> and <material derivative> give
$$
Du+U'w=-p_x,\qquad Dw=-p_z+b,\qquad Db+N^2w=0,\qquad u_x+w_z=0.
$$
Taking the curl eliminates <pressure>; differentiating the resulting <vorticity> equation in $x$ and using <incompressibility> gives $D\nabla^2w-U''w_x=b_{xx}$. A further application of $D$ therefore yields
$$
\boxed{D^2\nabla^2w-U''D\partial_xw+N^2\partial_x^2w=0.}
$$
For a stationary nonzero horizontal <Fourier mode>, $D=U\partial_x$, so cancellation of $\partial_x^2$ gives the stationary <Taylor–Goldstein equation>
$$
\boxed{\left(\nabla^2+\frac{N^2}{U^2}-\frac{U''}{U}\right)w=0.}
$$
This division requires $U\ne0$ on the interval considered: a zero of $U$ is a <critical level of an internal gravity wave>. The mean profiles must be sufficiently smooth for the displayed derivatives, with background <hydrostatic pressure> and stable <density stratification>, $N^2>0$, for propagating <internal gravity waves>. The horizontally uniform component is excluded from the cancellation. For a horizontal <wavenumber> $k$, local vertical propagation additionally requires $N^2/U^2-U''/U>k^2$; this is distinct from the smoothness restrictions. If stability of the background against other disturbances is needed, the <Miles–Howard theorem> supplies the sufficient condition $N^2\geq(U')^2/4$, rather than a necessary condition for deriving the equation.