Solution (source code)

= Solution

Define the perturbation vorticity component
$$
\zeta'=u'_z-w'_x.
$$
Taking the curl of the linear momentum equation and using the buoyancy equation gives
$$
(\partial_t+U\partial_x)\zeta'=-b'_x,
\qquad
(\partial_t+U\partial_x)b'=-N^2w'.
$$
Multiply the first equation by $b'$, the second by $\zeta'$, and horizontally average. Periodicity makes the averaged $x$ derivatives vanish, while
$$
\overline{w'\zeta'}
=\overline{w'u'_z-w'w'_x}
=\partial_z\overline{u'w'}
$$
by incompressibility and <integration by parts>. It follows that
$$
\partial_t\overline{b'\zeta'}
=-N^2\partial_z\overline{u'w'}.
$$
Therefore the <wave activity> conservation law is
$$
\boxed{
\partial_t\mathcal A+\partial_z\mathcal F_{\mathcal A}=0,
\qquad
\mathcal A=-\frac{\overline{b'\zeta'}}{N^2},
\qquad
\mathcal F_{\mathcal A}=-\overline{u'w'}
}.
$$