Brachistochrone Race
Race frictionless beads down a straight line, a circular arc, a parabola and a cycloid between the same two points. The cycloid always wins — the shortest path is never the fastest.
Drag the endpoint B anywhere on the canvas to reshape the problem — the cycloid is re-solved instantly. Pause the race and drag the two purple handles to build your own ramp and try to beat it.
Racing…
g = 9.81 m/s² · μ = 0.00
Analytic check — the cycloid's exact time
θmax = 3.50837 rad · R = 1.5516 m · T = θmax·√(R/g) = 1.3953 s
The simulated cycloid time above should match this to about a millisecond when friction is 0 — the integrator is tracking the closed-form solution, not approximating it.
The shortest path is not the fastest path
Every bead in the race starts at the same point A, is released from rest at the same instant, and must reach the same point B. There is no friction and no air resistance; the only difference between them is the shape of the wire they slide along.
The straight line is, by definition, the shortest route — and it finishes last. The winner is the cycloid, which is roughly 9% longer than the straight line yet arrives about 20% sooner at the default geometry. This is the brachistochrone problem, from the Greek brákhistos (shortest) and khrónos (time): the curve of quickest descent.
The reason is a trade. A bead's speed depends only on how far it has already fallen — v = √(2gy) by energy conservation. A curve that drops steeply at the start buys high speed early, and then spends the rest of the run covering horizontal distance fast. The straight line rations its drop evenly and therefore crawls through its whole first half. Extra distance is cheap; time spent moving slowly is expensive.
How the simulation works
Each ramp is precomputed as a densely sampled polyline with a cumulative arc-length table. A bead is then advanced along its own curve by integrating ds/dt = v(y(s)) with a midpoint (RK2) step, and its arc length s is mapped back to an (x, y) by binary search. For a frictionless bead this is not an approximation of the dynamics — energy conservation makes it exact.
The one subtlety is the release: at y = 0 the speed is exactly zero, so a naive integrator never starts. The first step instead uses the local slope, s ≈ ½·g·(dy/ds)·dt², which is the correct constant-acceleration behaviour over an infinitesimal arc.
Turning friction on switches the integrator to the full constrained equation of motion, dv/dt = g·(sin α − μ·cos α), where α is the local slope angle. A bead stops permanently if it reaches zero speed on a stretch too shallow to overcome μ.
The four curves, side by side
Times below are for the default geometry — B is 6 m across and 3 m down, with g = 9.81 m/s² and no friction. Note that the ranking by length is the exact reverse of the ranking by time.
| Curve | Definition | Length | Time |
|---|---|---|---|
| Cycloid | x = R(θ − sin θ), y = R(1 − cos θ) | 7.34 m | 1.395 s |
| Circular arc | vertical tangent at A, r = (bx² + by²)/2bx | 8.30 m | 1.438 s |
| Parabola | vertex at B: y = by(2u − u²) | 6.89 m | 1.494 s |
| Straight line | y = (by/bx)·x | 6.71 m — shortest | 1.749 s — slowest |
Why the cycloid's time has a closed form. Once you solve for the R and θmax that put the curve through B, the descent time collapses to T = θmax·√(R/g). The simulator prints that value and you can check it against the measured time — they agree to about a millisecond, which is the cleanest possible confirmation that the integrator is honest.
For the special case where B is the bottom of the cycloid (θmax = π), the time is simply π·√(R/g) — a quarter of the period of a cycloidal pendulum.
1696: Bernoulli's challenge and the lion's paw
In June 1696 Johann Bernoulli published the problem in Acta Eruditorum as an open challenge to "the sharpest mathematicians of all the world", giving six months for a solution. Leibniz solved it the day he received it and asked Bernoulli to extend the deadline to Easter 1697 so foreign mathematicians would have a fair chance.
The story that has outlived the mathematics concerns Isaac Newton. By then he had left Cambridge and was Warden of the Royal Mint. According to the account left by his niece's husband, John Conduitt, Newton received the problem in the late afternoon of 29 January 1697, worked it through before going to bed, and had the solution ready by the next morning. He published it anonymously in the Philosophical Transactions.
Bernoulli is said to have recognised the author instantly — "tanquam ex ungue leonem", roughly "I recognise the lion by his paw". Newton, less charmed, reportedly grumbled: "I do not love to be dunned and teased by foreigners about mathematical things."
Five solutions were ultimately published: from Newton, Leibniz, Jacob Bernoulli, Johann Bernoulli himself, and Guillaume de l'Hôpital. All arrived at the same answer — the cycloid. Johann's own solution was the most inventive: he reasoned by analogy with Fermat's principle in optics, imagining light refracting through infinitely many thin layers of increasing speed, and applied Snell's law to get the condition sin α / v = constant — which is precisely the defining property of a cycloid.
What a cycloid is — and the tautochrone surprise
A cycloid is the path traced by a single marked point on the rim of a circle rolling along a straight line. Roll a coin along a table edge and follow one spot on its edge: that arch is a cycloid. The brachistochrone is an inverted cycloid — the same arch flipped so it hangs downward, generated by a circle rolling along the underside of the release line.
The same curve has a second, stranger property that was discovered first. In 1659 Christiaan Huygens proved the cycloid is the tautochrone (or isochrone): a bead released from any point on an inverted cycloid reaches the bottom in exactly the same time, regardless of how high up it starts. A bead released near the bottom travels a short distance slowly; one released near the top travels far but picks up more speed. The two effects cancel exactly.
Huygens was after a better pendulum clock. An ordinary pendulum is only approximately isochronous — its period grows with swing amplitude, so a clock loses time as its mainspring unwinds. In his Horologium Oscillatorium (1673) he showed that a pendulum whose bob is constrained by cycloidal cheeks swings along a cycloid and is exactly isochronous. The engineering never quite paid off — friction against the cheeks cost more accuracy than the correction gained — but the mathematics was permanent.
That the curve of fastest descent and the curve of equal descent times are the same curve was, as Johann Bernoulli wrote, cause for admiration: "Nature always acts in the simplest way." You can see the tautochrone property in the simulator by leaving the cycloid in place and noticing that its bead is already at full speed while the others are still creeping.
The problem that invented a branch of mathematics
Ordinary calculus finds the number that minimises a function. The brachistochrone asks for something categorically harder: the function that minimises a number. The quantity being minimised is the total descent time, written as an integral over the unknown curve y(x):
T[y] = ∫ √( (1 + y'²) / (2·g·y) ) dx
You cannot differentiate that with respect to a single variable, because the input is an entire curve with infinitely many degrees of freedom. Problems of this shape are called variational problems, and the field that solves them — the calculus of variations — grew directly out of this challenge and the ones Bernoulli posed after it.
Leonhard Euler (a student of Johann Bernoulli) and then Joseph-Louis Lagrange turned the ad-hoc tricks into a general method. Their result, the Euler-Lagrange equation, is the exact analogue of "set the derivative to zero", but for functions:
∂L/∂y − d/dx ( ∂L/∂y' ) = 0
Feed the brachistochrone's integrand into it and the cycloid falls out. That is the real legacy of this puzzle: the same equation, applied to the difference between kinetic and potential energy, is Lagrangian mechanics, and it reappears in optics as Fermat's principle, in general relativity as the geodesic equation, and in modern physics as the principle of least action. A question about the fastest slide turned out to be a question about how nature chooses paths at all.
Things to try
- Make B shallow: drag B far to the right with only a small drop. The cycloid's advantage grows dramatically — at 8 m across and 2 m down it beats the straight line by 35%, because the line has almost no gradient to accelerate on.
- Make B steep: a nearly vertical B shrinks every gap. As the drop approaches pure free-fall, all four curves converge on the same answer — there is no horizontal distance left to be clever about.
- Beat the cycloid: pause and drag the purple handles. You cannot win. Every ramp you draw is slower, which is what a proof of optimality feels like from the inside.
- Add friction: push μ past about 0.3 and the winner changes — the circular arc overtakes the cycloid. The cycloid's long, flat run-out is ideal when sliding is free, but it becomes a liability when every metre of contact costs energy. The brachistochrone is only the fastest curve for the frictionless problem Bernoulli actually posed.
- Check the mathematics: compare the measured cycloid time to the printed
T = θmax·√(R/g). They should agree to three decimal places at any geometry.