Solution (source code)

= Solution

The <internal-wave ray tracing> equations preserve the horizontal <wavenumber> $k$ and laboratory frequency. For the increasing wind, the upward branch satisfies
$$
m(z)=\frac{N_0}{U(z)}\sqrt{1-q^2(z)},\qquad
q(z)=\frac{kU(z)}{N_0}=q_0(1+z/H),\qquad q_0=\frac{kU_0}{N_0}<1.
$$
The group-velocity ratio therefore gives
$$
\frac{dx}{dz}=\frac{k}{m}=\frac{q}{\sqrt{1-q^2}}.
$$
Integrating from $(0,0)$ yields
$$
\boxed{x(z)=\frac{H}{q_0}\left[\sqrt{1-q_0^2}-\sqrt{1-q_0^2(1+z/H)^2}\right].}
$$
This is the ascending branch of the <circular mountain-wave ray in linear shear>:
$$
(x-x_t)^2+(z+H)^2=\left(\frac{H}{q_0}\right)^2,\qquad
x_t=\frac{H}{q_0}\sqrt{1-q_0^2}.
$$
It reaches $z_t=H(q_0^{-1}-1)$ at $x=x_t$, where the energy direction is horizontal. After reflection, $m<0$ and the ray continues downwind and downward along the other branch
$$
x(z)=\frac{H}{q_0}\left[\sqrt{1-q_0^2}+\sqrt{1-q_0^2(1+z/H)^2}\right],
$$
returning to $z=0$ at $x=2x_t$. The last panel of the figure in part (b) shows this path. These are WKB energy rays, with the short neighborhood of the turning height supplied by its transition solution.