Finds functions that minimize or maximize integral quantities, such as the shortest path or least time.
IntuitionWhat curve costs the least?
Ordinary calculus finds the input number that minimizes an output number. Calculus of variations asks a stranger question: among all possible functions satisfying some boundary condition, which whole function minimizes an integral built from it? A ray of light bends through glass so as to minimize travel time (Fermat's principle); a hanging chain settles into the shape that minimizes potential energy; a soap film stretched across a wire loop minimizes surface area. In every case, the unknown is not a number but an entire curve.
A straight line drawn on the plane as the shortest candidate curve between two fixed endpoints, with a slope triangle marking its rise.
One candidate path for the length functional: the straight line y=2x−1 from (−2,−2) to (4,1). A variational problem compares this fixed curve against every other curve joining the same endpoints; the straight segment is the shortest — the answer given by the Euler–Lagrange equation for J[y]=∫1+(y′)2dx.
SchoolThe shortest path and the most enclosed area
Definition: Functional
A functional is a rule that assigns a single number to an entire function, instead of to a single number. Calculus of variations studies functionals built as integrals of a function together with its derivative, and looks for the function that makes this integral as small (or as large) as possible.
J[y]=∫x0x1L(x,y,y′)dx
Here x0 and x1 are the fixed endpoints, y(x) is the unknown curve with given values at the endpoints, y′(x) is its derivative, and L (the Lagrangian) is a given function of three slots that encodes the quantity being accumulated — arc length, travel time, energy, and so on.
Let y(x) be a twice continuously differentiable function on [x0,x1] with fixed endpoint values y(x0)=y0, y(x1)=y1. If y extremizes the functional J[y]=∫x0x1L(x,y,y′)dx among all such curves, then y satisfies ∂y∂L−dxd∂y′∂L=0 for every x∈(x0,x1).
Why is it true?
This mirrors setting an ordinary derivative to zero at a minimum, but here the 'direction' we perturb in is not a single number but an entire admissible variation of the curve. Requiring the first-order change to vanish for every such variation forces the pointwise balance between the direct y-dependence of L and the y′-dependence, encoded exactly by this equation.
Proof
Fix an arbitrary smooth function η(x) with η(x0)=η(x1)=0, and consider the one-parameter family of competitor curves yϵ(x)=y(x)+ϵη(x), all of which share the same endpoint values as y. Define ϕ(ϵ)=J[yϵ]; since y is assumed to extremize J, the ordinary function ϕ has a critical point at ϵ=0, so ϕ′(0)=0.
Differentiating under the integral sign, ϕ′(ϵ)=∫x0x1[∂y∂Lη+∂y′∂Lη′]dx, where the partial derivatives of L are evaluated along yϵ. Setting ϵ=0 gives ∫x0x1[∂y∂Lη+∂y′∂Lη′]dx=0.
Integrate the second term by parts: ∫x0x1∂y′∂Lη′dx=[∂y′∂Lη]x0x1−∫x0x1dxd∂y′∂Lηdx. The boundary term vanishes because η(x0)=η(x1)=0, leaving ∫x0x1[∂y∂L−dxd∂y′∂L]ηdx=0.
This integral vanishes for every admissible η. By the fundamental lemma of the calculus of variations — if a continuous function integrates to zero against every such test function, the function itself must be identically zero — the bracketed quantity vanishes at every x, which is exactly ∂y∂L−dxd∂y′∂L=0.
If the Lagrangian L=L(y,y′) has no explicit dependence on x, then along any extremal y(x) the quantity L−y′∂y′∂L=C is constant.
Why is it true?
This is a conserved quantity, exactly analogous to conservation of energy: when the 'rules' L do not change as we slide along x, a specific combination of L and y′ stays fixed. It gives a first-order equation in place of the second-order Euler–Lagrange equation, which is often much easier to solve directly.
Proof
Define H(x)=L(y,y′)−y′∂y′∂L evaluated along an extremal y(x), and differentiate with respect to x using the chain rule: dxdH=∂y∂Ly′+∂y′∂Ly′′−y′′∂y′∂L−y′dxd∂y′∂L.
The two terms containing y′′ cancel exactly, leaving dxdH=y′(∂y∂L−dxd∂y′∂L).
But y(x) is an extremal, so by the Euler–Lagrange equation the bracketed factor is identically zero along y. Hence dxdH=0 everywhere on the interval, which means H(x)=L−y′∂y′∂L is constant, proving the claim.
UndergraduateReal-World Applications and Worked Examples
Calculus of variations underlies geodesics in general relativity and robot motion planning (shortest/least-cost path on a curved space), Fermat's principle in optics and lens design, minimal-surface soap films and architectural shell design, and optimal-control problems in economics and aerospace engineering (minimum-fuel trajectories). The two worked examples below derive the two most famous variational curves by hand.
Example: The brachistochrone problem
A bead slides without friction under gravity along a wire from the origin (0,0) down to a lower point (x1,y1) (taking y positive downward). Among all wire shapes joining these two points, which one lets the bead arrive in the least time?
Solution
By conservation of energy, starting from rest at y=0, the bead's speed at height y satisfies v=2gy. Since speed is arc length per unit time, the total travel time is T[y]=∫0x12gy1+(y′)2dx, using ds=1+(y′)2dx.
The integrand L=2gy1+(y′)2 depends on y and y′ but not explicitly on x, so the Beltrami identity L−y′∂y′∂L=C applies directly. Computing ∂y′∂L=2gy1+(y′)2y′ and simplifying L−y′∂y′∂L gives 2gy1+(y′)21=const, which rearranges to y[1+(y′)2]=k for some constant k.
This first-order equation is solved by the substitution y′=cot(θ/2), which after integration yields the parametric family x=a(θ−sinθ),y=a(1−cosθ) with a=k/2 — a cycloid, the curve traced by a point on the rim of a rolling circle.
So the fastest path is not the straight line: the cycloid initially drops more steeply than a straight line, trading extra distance for extra speed gained early, and this trade-off is exactly what the Euler–Lagrange/Beltrami machinery makes precise.
Example: Isoperimetric problem: maximum area for a fixed perimeter
Among all smooth simple closed curves in the plane with a given fixed perimeter L0, which one encloses the largest area?
Solution
This is a constrained variational problem: maximize the area A=21∮(xdy−ydx) subject to the constraint that the perimeter ∮(x′)2+(y′)2dt=L0 is fixed, where the curve is parametrized by t.
As with constrained optimization in ordinary calculus, introduce a Lagrange multiplier λ and extremize the combined functional A−λ⋅(perimeter) freely (no constraint), by applying the Euler–Lagrange equation separately to the x(t) and y(t) components.
Carrying out this variation shows that the curvature of an extremal curve must be constant along its entire length — a curve of constant curvature in the plane is precisely a circle. So among all closed curves of perimeter L0, only the circle of radius r=L0/(2π) can be an extremal.
Since a circle of that radius indeed encloses area A=πr2=L02/(4π), and no closed curve of the same perimeter can enclose more (this is the isoperimetric inequality), the circle is confirmed as the maximizer — matching the everyday observation that round shapes 'use' their boundary most efficiently.
An ellipse on the plane with its two foci marked; when the two axes are equal the ellipse becomes a circle, the curve enclosing maximal area for a given perimeter.
The isoperimetric answer: a closed curve of perimeter L encloses at most A≤4πL2, with equality only for the circle. Drag the sliders to deform the ellipse a2x2+b2y2=1 — at a=b it becomes a circle, the winner; every genuine ellipse loses area for its perimeter.
In the Euler–Lagrange equation, what condition must y(x) satisfy for it to hold?
What is the shape of the brachistochrone, the curve of fastest descent under gravity?
For the functional J[y]=∫01(y′)2dx with y(0)=0, y(1)=1, which curve does the Euler–Lagrange equation select?
Among all simple closed curves enclosing a fixed perimeter, which shape maximizes the enclosed area?