Solution (source code)

= Solution

Let the <shear-horizontal wave> <displacement field> be $U(z)e^{ikx-i\omega t}$. Its <velocity> is $V=-i\omega U$, and its <traction> is $T=\mu U'$. The scalar shear-wave equation gives
$$
(\mu U')'+(\rho\omega^2-\mu k^2)U=0.
$$
With $p=k/\omega$ and $p_\beta^2=\beta^{-2}-p^2$, the first-order <velocity>–<traction> system is
$$
V'=-\frac{i\omega}{\mu}T,\qquad T'=-i\omega\mu p_\beta^2V.
$$
These equations remain valid for depth-dependent $\mu,\rho$; differentiating $\mu U'$ is essential and one must not incorrectly use $\mu U''$ when $\mu$ varies.

Where $V\ne0$, define the <SH input impedance> $Z=-T/V$. Differentiating $T=-ZV$ and substituting the two equations gives the <SH impedance Riccati equation>:
$$
\boxed{Z'=-i\omega\left(\frac{Z^2}{\mu}-\mu p_\beta^2\right),\qquad
V'=i\omega\frac Z\mu V.}
$$
The second relation is a one-way scalar equation once the complete <SH input impedance> is known. It does not discard reflections: $Z$ describes the actual superposition of both wave directions. At a zero of $V$, $Z$ may have a pole while the <velocity>–<traction> system stays regular.