Calculus of Variations
Functionals, the Euler-Lagrange equation, isoperimetric problems, the brachistochrone, and Lagrangian mechanics — with complete derivations, classic worked examples, and interactive practice.
While ordinary calculus finds extrema of functions (numbers in, numbers out), the calculus of variations finds extrema of functionals — mappings that take entire functions as input and return a single number.
The Euler-Lagrange equation is the fundamental necessary condition for an extremum of a functional. It is the variational analogue of setting a derivative to zero.
Derivation sketch: Let $\eta \in C^2[a,b]$ with $\eta(a) = \eta(b) = 0$. Compute $\delta J = \int_a^b \left[\frac{\partial F}{\partial y}\eta + \frac{\partial F}{\partial y'}\eta'\right]dx$. Integrate the second term by parts: $$\delta J = \left[\frac{\partial F}{\partial y'}\eta\right]_a^b + \int_a^b \left[\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'}\right]\eta\,dx.$$ The boundary term vanishes since $\eta(a) = \eta(b) = 0$. By the fundamental lemma of calculus of variations, the integrand must be identically zero.
Isoperimetric problems seek to optimise one functional subject to a constraint on another — the classical example being to find the curve of fixed perimeter enclosing maximum area.
The brachistochrone (from Greek: "shortest time") asks for the curve of fastest descent under gravity — one of the most celebrated problems in mathematics, posed by Johann Bernoulli in 1696.
By conservation of energy, the speed at height $y$ is $v = \sqrt{2gy}$. The time functional is:
$$T[y] = \int_0^{x_1} \frac{\sqrt{1 + (y')^2}}{\sqrt{2gy}}\,dx = \int_0^{x_1} \sqrt{\frac{1+(y')^2}{2gy}}\,dx.$$
Hamilton's principle is the variational foundation of classical mechanics: the true trajectory of a mechanical system extremises the action integral.
- A functional maps functions to real numbers. The first variation $\delta J = 0$ is the necessary condition for an extremum.
- The Euler-Lagrange equation $\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} = 0$ is the fundamental equation of the calculus of variations.
- The Beltrami identity provides a first integral when the integrand does not depend explicitly on $x$.
- Isoperimetric problems use Lagrange multipliers for functionals: extremise $J[y]$ subject to $K[y] = \ell$ by applying E-L to $F + \lambda G$.
- The brachistochrone (fastest descent under gravity) is a cycloid.
- Hamilton's principle states that physical motion extremises the action $S = \int L\,dt$, unifying mechanics with variational calculus.