Solution (source code)

= Solution

At $z=0$, the two free-surface conditions for a <normal mode> give
$$
-i\sigma_n\widehat\phi+g\widehat\zeta=0,
\qquad
-i\sigma_n\widehat\zeta-\partial_z\widehat\phi=0.
$$
Eliminating $\widehat\zeta$ yields
$$
\sigma_n^2\widehat\phi
=g\,\partial_z\widehat\phi.
$$
For the vertical factor found in part (b),
$$
\left.\frac{\partial_z\widehat\phi}{\widehat\phi}\right|_{z=0}
=k_n\tanh(k_nh).
$$
Thus the gravity-wave <dispersion relation> is
$$
\boxed{\sigma_n^2=gk_n\tanh(k_nh)
=\frac gh\,\Psi(k_nh)},
$$
where
$$
\boxed{\Psi(x)=x\tanh x}.
$$