The Brachistochrone Problem
Adapted from the Mathematica file by Robert Root

The brachistochrone problem was posed by Johann Bernoulli in Acta Eruditorum in June 1696. He introduced the problem as follows:

I, Johann Bernoulli, address the most brilliant mathematicians in the world. Nothing is more attractive to intelligent people than an honest, challenging problem, 
whose possible solution will bestow fame and remain as a lasting monument. Following the example set by Pascal, Fermat, etc., I hope to gain the gratitude of the 
whole scientific community by placing before the finest mathematicians of our time a problem which will test their methods and the strength of their intellect. If 
someone communicates to me the solution of the proposed problem, I shall publicly declare him worthy of praise. ...there are fewer who are likely to solve our 
excellent problems, aye, fewer even among the very mathematicians who boast that [they]... have wonderfully extended its bounds by means of the golden theorems 
which (they thought) were known to no one, but which in fact had long previously been published by others.

Given two points A and B in a vertical plane, what is the curve traced out by a point acted on only by gravity, which starts at A and reaches B in the shortest time?

That is, what is the path from A to B for which a marble starting at A will roll down to B in the shortest time?  The word brachistochrone is derived from the Greek 
words "brachistos" (shortest) and "chronos" (time).

Galileo (who had studied the problem back in 1638) believed the path would be an arc of a circle, which is not correct (but an excellent guess).  In 1697, proofs that the 
solution is a cycloid were published by Johann Bernoulli (who knew the answer when he posed this problem), Isaac Newton, Gottfried Leibnitz, and Jacob Bernoulli
(elder brother of Johann).
(see http://www-history.mcs.st-andrews.ac.uk/HistTopics/Brachistochrone.html for more details)

(* RUN THIS TO SEE ANIMATION *)
g=9.8;x=0.572917(u-Sin[u]);y=1-0.572917 (1-Cos[u]);
dx=D[x,u];dy=D[y,u];
conversionc=Table[{Integrate[Sqrt[dx^2+dy^2]/Sqrt[2g(1-y)],{u,0,U}],U},{U,0.05,2.45,.05}];
conversionc=PrependTo[conversionc,{0,0}];
f=Interpolation[conversionc];
Animate[Show[ParametricPlot[{u,1-u},{u,0,1}],ParametricPlot[{0.572917(t-Sin[t]),1-0.572917 (1-Cos[t])},{t,0,2.41}],ListPlot[{If[t<2/Sqrt[g],{g t^2/4,1-g t^2/4},{1,0}],If[t<0.583,{0.572917(f[t]-Sin[f[t]]),1-0.572917 (1-Cos[f[t]])},{1,0}]},PlotStyle->{Black,PointSize[Large]}]],{t,0,0.7}]

To calculate the time it takes to traverse the path, we need to evaluate the path integral ∫(1/v)ds of the reciprocal of the speed (since time equals distance divided by speed--we're summing up the time it takes to traverse each bit of arc length ds with speed v).  We find a formula for the speed by using conservation of energy: the kinetic plus potential energy is constant over time.

Exercise 1.  Solve for the speed v: (1/2)mv2+ mgy = mg (original potential energy with v=0 when at y=1).

To find the traversal time for a straight line connecting (0,1) to (1,0), we use parametrization x=u, y=1-u, for 0≤u≤1, to calculate the line integral of the speed.  We'll assume units of meters and seconds, so we see that it takes about 0.64 seconds for the marble to roll down the straight line path (I use "u" as the parameter since t=time and s=arc length are confusing as parameters in this context):

g=9.8;
x=u;y=1-u;
dx=D[x,u];dy=D[y,u];
TraversalTimeForLine=NIntegrate[1/Sqrt[2g(1-y)]Sqrt[dx^2+dy^2],{u,0,1}]

Exercise 2.  Find the traversal time for a parabola y=(1-x)^2 connecting (0,1) to (1,0).

Exercise 3.  Find the traversal times for parabolas y=a(1-x)^2+(1-a)(1-x) connecting (0,1) to (1,0) using values a=1/4, 1/2, 1, 3, and 5.  Plot the five parabolas (a=1/4, 1/2, 1, 3, 5) so you can see what paths they represent.  Which one yields the shortest time?

Exercise 4.  Find a circle that passes through (0,1) and (1,0) that does not have a horizontal tangent at (0,1).  (A horizontal tangent at the starting position implies that the marble will just sit at (0,1) and never start rolling!)  Plot your circle to make sure that it is a reasonable path.  Find the traversal time for the piece of circle from (0,1) to (1,0).

Exercise 5.  Now we will look at the cycloid that gives the fastest traversal time.  If the top point is at coordinate (0, 1), then the cycloid is given parametrically by the equations x=A(u-Sin[u])   and y= 1-A(1-Cos[u]),  where u is a parameter, and the constant A is determined by the location of the second point. Observe that u=0 yields the starting point (0,1).  Solve for the values of A and u that yield the end point (1, 0) using the FindRoot command given below, with positive numbers entered for the guesses.

x=A(u-Sin[u])
y= 1-A(1-Cos[u])
FindRoot[{x==1,y==0},{A,(guess a number)},{u,(guess a number)}]

Exercise 6.  Find the traversal time for the cycloid in Exercise 5.

For neat animations and more information about the brachistochrone problem, go to http://curvebank.calstatela.edu/brach/brach.htm