Solution (source code)

= Solution

For velocity $\mathbf u=\nabla\phi$ and a conservative body force $-\nabla\chi$, the unsteady <Bernoulli equation> is
$$
\boxed{\phi_t+\frac12|\nabla\phi|^2+\frac p\rho+\chi=C(t).}
$$
It follows by integrating the inviscid <Euler equations> in space; a purely time-dependent potential gauge can absorb $C(t)$.

Use a coordinate along the thin U-tube from the left surface to the right, and let the right surface rise by $\zeta$ while the left falls by $\zeta$. <Incompressibility> and uniform area give velocity $\dot\zeta$ along the whole fluid column. If its total length is $L$, the velocity-potential difference between the surfaces is $L\dot\zeta$; the column length stays constant as their displacements cancel. Both surfaces have atmospheric pressure and the same speed. Subtracting their Bernoulli balances, with $\chi=gy$, therefore yields
$$
L\ddot\zeta+2g\zeta=0.
$$
In the long-leg approximation underlying the requested formula, the base bend contributes negligible length and $L=2h$. Consequently
$$
\boxed{h\ddot\zeta+g\zeta=0,\qquad\omega=\sqrt{g/h}.}
$$
If the horizontal connector or bend has nonnegligible length, it belongs in $L$ and the general frequency is $\sqrt{2g/L}$; the stated height alone would then not determine the inertia.