Solution (source code)

= Solution

<irrotational flow> has $\nabla\times\mathbf v=0$, so locally $\mathbf v=\nabla\Phi$; the simply connected fluid domain here permits a globally single-valued <velocity potential>. Incompressibility gives $\nabla\cdot\mathbf v=0$, hence \b[$\nabla^2\Phi=0$]. In a multiply connected domain, zero local <vorticity> alone would not rule out <circulation> and a multivalued potential.

Take $k>0$ so the disturbance decays at depth. Differentiating the given candidate potential yields
$$
v_x=h_0\omega\cos(\omega t)\cos(kx)e^{kz},\qquad v_y=0,\qquad v_z=h_0\omega\cos(\omega t)\sin(kx)e^{kz}.
$$
The $x$ and $z$ second derivatives of $\Phi$ cancel in the <Laplacian>. At $z=0$, $v_z=h_0\omega\cos(\omega t)\sin(kx)=\partial_t Z$, so the linearized kinematic free-surface condition holds. This uses $kh_0\ll1$; advection of the displaced surface is higher order.

Since $\cos^2(kx)+\sin^2(kx)=1$, the local squared <speed> is $h_0^2\omega^2\cos^2(\omega t)e^{2kz}$. The depth integral is therefore
$$
T=\frac{\rho h_0^2\omega^2}{2}\cos^2(\omega t)\int_{-\infty}^0e^{2kz}\,dz=\boxed{\frac{\rho h_0^2\omega^2}{4k}\cos^2(\omega t).}
$$
It is independent of horizontal position; no further spatial average is needed for this <kinetic energy>. Replacing the upper boundary $Z$ by zero changes it only beyond quadratic order in <amplitude>.

Relative to the flat surface, the gravitational <energy> at each horizontal position changes by $\rho g\int_0^Z z\,dz=\rho gZ^2/2$. Averaging over one <wavelength> gives
$$
\boxed{\langle U\rangle_x=\frac{\rho gh_0^2}{4}\sin^2(\omega t).}
$$
The <energy of a deep-water standing gravity wave>, averaged over <wavelength>, is $T+\langle U\rangle_x$ and must be constant for a free inviscid <standing wave>, which requires equal coefficients of the complementary squared sine and cosine:
$$
\boxed{\omega^2=gk.}
$$
As an independent check, the linearized dynamic <boundary condition> $\partial_t\Phi+gZ=0$ at $z=0$ gives exactly $g-\omega^2/k=0$. Infinite depth, negligible <surface tension> and no dissipative forcing are part of this gravity-wave model.