02 / Calculus of variations
Many possible paths.
One minimum.
Keep the endpoints fixed. Bend the curve and watch its energy rise. This is optimization over functions, rather than a single number.
A path of least energy
Fixed endpoints · unit intervalThe second bend oscillates twice as fast. Compare its energy cost with the first.
What are we minimizing?
For paths from height 0 to height 1 over one unit of time, define the energy as the integral of squared slope:
The sliders explore a two-parameter family. Both sine terms vanish at the endpoints.
Orthogonality of the cosine terms gives an exact energy, rather than a numerical approximation:
The second bend costs four times as much energy as the first when their amplitudes are equal. Faster oscillation means steeper slopes.
Why the straight line wins.
The Euler–Lagrange equation for this functional says the second derivative must vanish at a smooth stationary path:
There is also a global argument. With the endpoints fixed, the integral of the slope is 1, so:
Equality requires unit slope almost everywhere. The straight line is therefore the unique minimizer among absolutely continuous paths with square-integrable derivative, not just among the paths shown by the sliders.
“Minimize energy” continuously removes the two bends. It visualizes the known solution; it is not a numerical solver for arbitrary variational problems.