I always want to do the calculation by myself, just for fun.

The problem is, given 2 points, A and B, with height difference H, and horizontal distance d, only under gravity and without friction, what is the shortest-time curve to connect the two points?

The problem is visualized in above figure. s(x) is the path length. The velocity depends on the height.

\displaystyle \frac{1}{2}mv^2 = mgh \Rightarrow v=  \sqrt{2gy}

The total travel time from point A to point B is

\displaystyle T = \int \frac{ds}{v(x)}

\displaystyle ds^2 = dx^2 + dy^2 \Rightarrow ds = dx \sqrt{1+ y'(x)^2}

put everything together

\displaystyle T = \int \frac{ds}{v(x)} = \int \sqrt{\frac{1+y'(x)^2}{2g y(x)}} dx = \int \frac{1}{\sqrt{2g}} L(x, y, y') dx

We want to minimize the total travel time by variate the path y(x) . This is exactly the same a the Lagrangian mechanics. The Lagrangian equation is

\displaystyle \frac{\partial L}{ \partial y} - \frac{d}{dx} \left( \frac{\partial L}{\partial y'} \right) = 0

Let’s compute the partial derivatives,

\displaystyle \frac{\partial L}{ \partial y} = - \frac{(1+y'^2)^{1/2}}{2 y^{3/2}}

\displaystyle \frac{\partial L}{ \partial y'} = - \frac{y'}{\sqrt{y}(1+y'^2)^{1/2}} =K

The total derivative is

\displaystyle \frac{dK}{dx} = \frac{\partial K}{ \partial y} \frac{dy}{dx} + \frac{\partial K}{ \partial y'} \frac{dy'}{dx} + \frac{\partial K}{ \partial x}

\displaystyle \frac{\partial K}{ \partial y} = - \frac{y'}{2 y^{3/2}(1+y'^2)^{1/2}}

\displaystyle \frac{\partial K}{ \partial y'} = \frac{1}{y^{1/2}(1+y'^2)^{3/2}}

\displaystyle \frac{dK}{dx} = \frac{2y y'' - y'^2 -y'^4}{2y^{3/2}(1+y'^2)^{3/2}}

finally,

\displaystyle - \frac{(1+y'^2)^{1/2}}{2 y^{3/2}} = \frac{2y y'' - y'^2 -y'^4}{2y^{3/2}(1+y'^2)^{3/2}} \Rightarrow  -(1+y'^2)^2 = 2y y'' - y'^2 -y'^4

\displaystyle  2y y'' + y'^2 +  1 = 0 \Rightarrow \frac{1}{y'}\frac{d}{dx}\left( y(1+y'^2) \right) = 0

Thus,

\displaystyle y(1+y'^2)  = C


From here, I am not sure how to get to the cycloid. For a cycloid drawn from a circle with radius R, a downward cycloid is

\displaystyle x(\theta) = R( \theta - \sin\theta ) \\ y(\theta) = R(\cos\theta -1 )

Lets check is the cycloid fulfill the requirement.

\displaystyle \frac{dy}{dx} = \frac{dy}{d\theta}\frac{d\theta}{dx} = \frac{-\sin\theta}{1-\cos\theta}

\displaystyle y(1+y'^2) = R(\cos\theta -1) \left( 1 + \frac{\sin^2\theta}{(1-\cos\theta)^2} \right) = 2R =C

So, the cycloid is the solution. Below is a cycloid with 1 unit of radius.


We now knew that the cycloid is the solution, but we have to find the constant C, or the radius R, so that the curve pass through the points A and B.

Fixing point A at (0,0), the point B at (d, -H) and it is on the cycloid. Thus,

\displaystyle d = R( \theta_0 - \sin\theta_0 ) \\ -H = R(\cos\theta_0 -1 )

Solve for \theta_0 , combine the equations,

\displaystyle \frac{d}{H} = \frac{ \theta_0 - \sin\theta_0 }{1 - \cos\theta_0 } \Rightarrow d - H \theta_0 = d \cos\theta_0 - H \sin\theta_0

Set d = G \cos\phi, H = G \sin\phi,  G = \sqrt{d^2 + H^2}, \tan\phi = H/d,

\displaystyle  d - H \theta_0 = G \cos(\phi+\theta_0),  0 < \theta_0 \leq 2\pi

There may be no analytical solution. The solution is the intercept between the 2 curves below.

In the above example, d = 10, H = 5, and \theta_0 = 3.50837, R = 2.586 . The brachistochrone curve look like this:


Since we know the solution now, so, what is the minimum travel time from point A to point B?

\displaystyle ds =d\theta R \sqrt{ \left(\frac{dx}{d\theta}\right)^2 + \left(\frac{dy}{d\theta}\right)^2} = d\theta \sqrt{2}\sqrt{1-\cos\theta} = \sqrt{2R} \sqrt{y} d\theta

\displaystyle \frac{ds}{v} = \sqrt{2R} \frac{\sqrt{y}}{\sqrt{2g y}} d\theta = \sqrt{R} d\theta

which is a constant of \theta !! So the travel time is

\displaystyle T = \sqrt{\frac{R}{g}} \theta_0

Also, the motion in term of time is

\displaystyle x(t) = R \left( \sqrt{\frac{g}{R}}t - \sin\left(\sqrt{\frac{g}{R}} t\right) \right) \\ y(t) = R\left(\cos\left(\sqrt{\frac{g}{R}}t\right) -1 \right)


Now, Lets us investigate the travel time for a straight line from point A to point B. The path is

\displaystyle x = -\frac{d}{H} y

The travel time is

\displaystyle t = \int \frac{ds}{\sqrt{2gy}} = \int \frac{\sqrt{H^2+d^2}}{H\sqrt{2gy}} dy = \frac{\sqrt{H^2+d^2}}{H\sqrt{g}} \sqrt{2y}

Thus, the coordinate in term of time is

\displaystyle x(t) = \frac{1}{\sqrt{2}} \frac{d H \sqrt{g}}{H^2+d^2} t^2 \\ y(t) = - \frac{1}{\sqrt{2}} \frac{H \sqrt{g}}{H^2+d^2}  t^2


Next, we also check a curve that, if H > d , then, the path go vertical down by H-d, than do a circular path with radius d. If H < d, then do a circular path with radius H, and a horizontal path to point B.

Lets only study the case when d > H .

The circular path motion is

\displaystyle x(\phi) = H - H \cos\phi \\ y(\phi) = -H \sin\phi,  \phi = [0, \pi/2]

the path length is s(\phi) = H \phi

\displaystyle t_1 = \int \frac{ds}{\sqrt{2gy}} = \int \frac{H}{\sqrt{2g H \sin\phi}}  d\phi = \sqrt{\frac{H}{2g}} \left(2.6221 - 2 F\left( \frac{1}{2} \left( \frac{\pi}{2} - \phi \right) , 2 \right) \right)

where the $latex F(x, m) is the elliptic integral of the 1st kind.

The rest of the path takes time

\displaystyle t_2 = \frac{d-H}{\sqrt{2gH}}

Here is the comparison to all 3 paths