Solution (source code)

= Solution

Let $D=\overline U-c$ and $F=\widehat w/D^{1/2}$. For $c_i>0$, $D$ never vanishes, so an <analytic branch of a square root> exists along the real flow domain. Take real smooth <velocity> and <buoyancy frequency> coefficients, nonzero $k$ (chosen positive for the growing-wave convention), a nontrivial regular <normal mode>, and boundary decay strong enough to remove the integration-by-parts term.

Substitution into the <Taylor–Goldstein equation> gives the half-power case of the <power-transformed Taylor–Goldstein energy identity>:
$$
(D F')'-k^2DF-\frac12\overline U''F
+\frac{S}{D}F=0,\qquad
S=N^2-\frac14(\overline U')^2.
$$
For completeness, differentiating $\widehat w=D^{1/2}F$ yields $\widehat w''=D^{1/2}F''+\overline U'D^{-1/2}F'+[\tfrac12\overline U''D^{-1/2}-\tfrac14(\overline U')^2D^{-3/2}]F$, which explains the coefficient $1/4$.

Multiply by $F^*$ and integrate over $z$. The boundary term $[F^*DF']$ is zero for the given homogeneous endpoint conditions, or for sufficiently decaying finite-energy modes at infinity. Therefore
$$
\int\left[D(|F'|^2+k^2|F|^2)+\frac12\overline U''|F|^2
-\frac{S}{D}|F|^2\right]dz=0.
$$
Since $\operatorname{Im}D=-c_i$, $\operatorname{Im}(1/D)=c_i/|D|^2$, and $S,\overline U''$ are real, taking the <imaginary part> and dividing by $-c_i$ gives
$$
\int\left[|F'|^2+k^2|F|^2+\frac{S}{|D|^2}|F|^2\right]dz=0.
$$
The first two terms have strictly positive <integral> for a nonzero mode. Thus $S$ cannot be nonnegative everywhere:
$$
\boxed{N^2-\frac14(\overline U')^2<0\quad\text{somewhere}.}
$$
This proves the <Miles–Howard theorem> in contrapositive form. Where $\overline U'\ne0$, the corresponding <gradient Richardson number> must fall below $1/4$ somewhere. Failure of this sufficient-stability criterion does not prove instability. The derivation uses $c_i>0$; it cannot be applied unchanged to a neutral singular critical layer.