Assume that $\partial \overline{\rho}/\partial y$ is constant,
and $U=0$ at the surface $z=0$, the background flow is
$$
U(z)=U_0\,z/H
$$
where $U_0$ is the velocity at the top of the layer of interest, $z=H$
Form the vorticity equation by cross-differentiating and adding the frictionless horizontal momentum equations to eliminate the pressure,
then use the continuity equation \(\nabla \cdot \mathbf{u} = 0\)
to replace $\partial u/\partial x+\partial v/\partial y$ with $-\partial w/\partial z$
$$
\frac{\partial \zeta}{\partial t}+u\frac{\partial \zeta}{\partial x}+v\frac{\partial \zeta}{\partial y}
-(\zeta+f)\frac{\partial w}{\partial z}=0
$$
Assume that the perturbations are large-scale and slow, so that the velocity is nearly geostrophic
$$
u' \approx - \frac{1}{\rho_0 f} \frac{\partial p'}{\partial y},
\qquad
v' \approx \frac{1}{\rho_0 f} \frac{\partial p'}{\partial x}
$$
The perturbation vorticity is found as
$$
\zeta' = \frac{1}{\rho_0 f} \left( \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} \right) p'
= \frac{1}{\rho_0 f} \nabla_H^2 p'
$$
Develop an expression for $w'$ in terms of $p'$ using the density Equation
$
\frac{\partial}{\partial t} (\overline{\rho} + \rho') +
(U + u') \frac{\partial}{\partial x} (\overline{\rho} + \rho') +
v' \frac{\partial}{\partial y} (\overline{\rho} + \rho') +
w' \frac{\partial}{\partial z} (\overline{\rho} + \rho') = 0$
$
\xrightarrow[\text{and linearize}]{\text{Evaluate derivatives}}\;
\frac{\partial \rho'}{\partial t}+U\frac{\partial \rho'}{\partial x}+v'\frac{\partial \overline{\rho}}{\partial y}
-\rho_0 N^2 \frac{w'}{g}=0
$ where \(N\) is the buoyancy frequency, \(\boxed{N^{2} \equiv -\frac{g}{\rho_{0}} \frac{d\rho}{dz}}\)
◀
▶