Solution (source code)

= Solution

The vertical parcel displacement has $\partial_t\eta=w$, so its complex amplitude is $\mathcal E=iW/\omega$. The horizontal momentum equation and <incompressibility> give
$$
\boxed{\mathcal E=\frac{iW}{\omega},\qquad P=\frac{i\rho_0\omega}{k^2}W'.}
$$
At a material density interface the displacement is continuous, hence $[W]=0$. Continuity of <pressure> must be imposed on the displaced interface. Since the mean hydrostatic gradient is $\bar p_z=-\rho g$, continuity of Lagrangian pressure gives $[P]+\mathcal E[\bar p_z]=0$. A stable upward jump $[\bar b]=\Delta b$ gives $[\bar p_z]=\rho_0\Delta b$, and therefore
$$
[P]=-\rho_0\Delta b\,\mathcal E,\qquad
\boxed{[W]=0,\quad [W']=-\frac{k^2\Delta b}{\omega^2}W.}
$$
The same derivative jump follows by integrating the amplitude equation through the delta-function contribution $N^2=\bar b_z$ at the interface. At a continuous-buoyancy stratification change, $\Delta b=0$ and both $W$ and $W'$ are continuous. Assuming Eulerian pressure itself continuous across a density jump would miss the restoring interfacial force.