Solution (source code)

= Solution

The <buoyancy frequency>, also called the <Brunt–Väisälä frequency>, is the <angular frequency> of a small vertical displacement restored by <buoyancy> in a stably stratified fluid. Take $z$ upward, <gravitational acceleration> $-g\widehat{\mathbf z}$, and a background in <hydrostatic equilibrium>,
$$
\frac{dp}{dz}=-\rho g.
$$
Displace a small gas element upward by $\xi$, sufficiently slowly for its <pressure> to match its surroundings but without heat exchange. For this <adiabatic process>, $p/\rho^\gamma$ is constant along the element's motion, so its <mass density> changes by $\rho\gamma^{-1}(d\ln p/dz)\xi$. The surrounding <mass density> changes by $(d\rho/dz)\xi$. The element's excess <mass density> is consequently
$$
\Delta\rho=\rho\left(\frac1\gamma\frac{d\ln p}{dz}-\frac{d\ln\rho}{dz}\right)\xi.
$$
Its acceleration is $\ddot\xi=-g\Delta\rho/\rho=-N^2\xi$. Thus
$$
\boxed{N^2=g\left(\frac1\gamma\frac{d\ln p}{dz}-\frac{d\ln\rho}{dz}\right).}
$$
For a gas of fixed composition obeying the <ideal gas law>, $\rho\propto p/T$. The <adiabatic buoyancy frequency of an ideal gas> is therefore
$$
\boxed{N^2=g\left[\frac1T\frac{dT}{dz}-\frac{\gamma-1}{\gamma p}\frac{dp}{dz}\right]
=\frac gT\left(\frac{dT}{dz}+\frac g{c_p}\right),}
$$
where $c_p=\gamma\mathcal R/(\gamma-1)$ is the <specific heat capacity> at constant <pressure>, and $\mathcal R=p/(\rho T)$ is the specific gas constant. Here $N^2$ has units $\mathrm{s^{-2}}$; $N$ is an <angular frequency>, not a cyclic <frequency>. Positive $N^2$ gives <simple harmonic motion>, negative $N^2$ gives <convective instability>, and $N^2=0$ is marginal. The temperature form assumes fixed composition; the preceding density form is more general.