Solution (source code)

= Solution

For fixed endpoint values, stationarity requires the <Euler-Lagrange equation> $f_y-d(f_{y'})/dx=0$. Differentiate $y'f_{y'}-f$ along an extremal: its derivative is $y'[d(f_{y'})/dx-f_y]-f_x$. Thus when $f_x=0$ the <Beltrami identity> makes that quantity constant.

Take $y$ as depth measured downward. <Conservation of energy> from rest gives $mv^2/2-mgy=0$, hence speed $v=\sqrt{2gy}$. With <arc length> $ds=\sqrt{1+y'^2}\,dx$, the <travel time> is $T=(2g)^{-1/2}\int_0^{x_B}\sqrt{(1+y'^2)/y}\,dx$. For $f=\sqrt{(1+y'^2)/y}$, the Beltrami quantity is $-1/\sqrt{y(1+y'^2)}$. Thus $y(1+y'^2)=c>0$.

Put $y=c\sin^2\theta$ and take $y'=\cot\theta$ along the first arch. Since $dy/d\theta=2c\sin\theta\cos\theta$, one obtains $dx/d\theta=2c\sin^2\theta$. Integrating from the initial cusp gives the <cycloid> solving the <brachistochrone problem>:
$$
\boxed{x=c(\theta-\tfrac12\sin2\theta),\qquad y=c\sin^2\theta.}
$$
For the equal-height target, the first complete arch has $\theta_B=\pi$, so $c=l/\pi$. Also $ds/d\theta=2c\sin\theta$ and $v=\sqrt{2gc}\sin\theta$ for $0<\theta<\pi$. Therefore
$$
\boxed{T_{\min}=\pi\sqrt{\frac{2c}{g}}=\sqrt{\frac{2\pi l}{g}}.}
$$
The endpoint zeros of speed cancel the zeros of $ds/d\theta$, leaving finite travel time. Global minimality follows from the <maximum-depth bound for a brachistochrone>: any competing track with maximum depth $h$ satisfies $T\geq[l/\sqrt h+\pi\sqrt h]/\sqrt{2g}\geq\sqrt{2\pi l/g}$. The displayed cycloid attains both inequalities with $h=l/\pi$.

\Image[/past-exam-of-the-mathematics-course-of-the-year-2-of-the-natural-sciences-course-of-the-university-of-cambridge/2006/paper-1-equal-height-brachistochrone.png]
{title=The equal-height brachistochrone is one complete cycloid arch}
{description=Original curve with depth drawn downward. The maximum depth is $l/\pi$, and markers equally spaced in the cycloid parameter are equally spaced in travel time. The bead starts and ends at rest in the ideal energy-conserving model.}