Solution (source code)

= Solution

Write the density and pressure as $\rho_0(z)+\rho'(x,z,t)$ and $p_0(z)+p'(x,z,t)$, respectively. The background satisfies <hydrostatic balance>, $p_0'=-g\rho_0$, and $\rho_0'/\rho_0=-\alpha$. Linearizing the <Euler equations for an inviscid fluid>, <incompressibility> and advection of density gives
$$
u_x+w_z=0,\qquad \rho_0u_t=-p'_x,\qquad \rho_0w_t=-p'_z-g\rho',\qquad \rho'_t=\alpha\rho_0w.
$$
Differentiate the horizontal equation in $x$ and use <incompressibility> to obtain $p'_{xx}=\rho_0w_{zt}$. Differentiate the vertical equation in time and twice in $x$:
$$
\rho_0w_{ttxx}=-\partial_z(\rho_0w_{ztt})-\alpha g\rho_0w_{xx}.
$$
Dividing by $\rho_0>0$ gives the equation for <internal waves in an exponentially stratified incompressible fluid>,
$$
\boxed{\partial_t^2(\nabla^2w-\alpha w_z)+\alpha g\,w_{xx}=0}.
$$
The first-derivative term retains the variation of inertial density with height; no <Boussinesq approximation> has been made.