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 interval
Your pathMinimum-energy path
A fixed-endpoint path and the straight-line minimizerThe orange path bends between fixed endpoints (0,0) and (1,1). The dashed line is the minimum-energy path.-101200.250.50.751Path heightTime

The second bend oscillates twice as fast. Compare its energy cost with the first.

Path energy2.560
Energy above minimum1.560
Minimum energy1.000
Fixed endpoints0 → 1

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:

E[y]=∫01(y′(t))2 dtE[y]=\int_0^1 \bigl(y'(t)\bigr)^2\,dt
y(0)=0,y(1)=1y(0)=0,\qquad y(1)=1

The sliders explore a two-parameter family. Both sine terms vanish at the endpoints.

y(t)=t+asin⁡(πt)+bsin⁡(2πt)y(t)=t+a\sin(\pi t)+b\sin(2\pi t)

Orthogonality of the cosine terms gives an exact energy, rather than a numerical approximation:

E[y]=1+π2a22+2π2b2E[y]=1+\frac{\pi^2a^2}{2}+2\pi^2b^2

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:

ddt(2y′(t))=0\frac{d}{dt}\bigl(2y'(t)\bigr)=0
y′′(t)=0⟹y(t)=ty''(t)=0\quad\Longrightarrow\quad y(t)=t

There is also a global argument. With the endpoints fixed, the integral of the slope is 1, so:

E[y]=1+∫01(y′(t)−1)2 dt≥1E[y]=1+\int_0^1\bigl(y'(t)-1\bigr)^2\,dt\geq1

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.