Calculus of variations is the mathematics of choosing functions, curves and fields optimally. Ordinary calculus often asks which number minimises a function. Calculus of variations asks which entire path, shape or function makes a functional stationary or extremal.
The subject sits beneath geodesics, optics, mechanics, minimal surfaces, optimal control, PDEs and many modern optimisation methods. Its central move is to perturb a candidate function slightly, calculate how the total objective changes, and derive the condition required for first-order change to vanish.
Series route: Mathematics Learning Hub → How Mathematics Works → Calculus of Variations. Important neighbours include Calculus, Mathematical Optimisation, Differential Equations and Functional Analysis.
1. The unknown is a whole function
In ordinary optimisation, x may be a scalar or finite vector. In variational problems, the variable is a function y(x), curve γ(t) or field u(x).
The search space is therefore infinite-dimensional.
2. Functionals assign numbers to functions
A functional takes an entire function as input and returns a scalar.
A standard form is J[y]=∫ F(x,y,y′) dx. Different candidate functions produce different total values of J.
3. Endpoints can be fixed or free
A curve may be required to connect two specified points, or one or both endpoints may be free to move along a boundary.
Boundary conditions change the necessary conditions and therefore belong to the definition of the problem.
4. Variations perturb the candidate
Take a candidate y and consider nearby functions y+εη, where η is an admissible perturbation and ε is a small scalar.
The first variation measures the derivative of J[y+εη] with respect to ε at ε=0.
5. Stationarity requires the first variation to vanish
If y is an interior minimiser or maximiser under the admissible variations, the first variation must vanish for every allowed η.
This is the infinite-dimensional analogue of setting a derivative or gradient to zero.
6. Integration by parts moves derivatives off the variation
Differentiating the functional produces terms involving η and η′.
Integration by parts transfers the derivative from η′ to a coefficient, leaving an integral proportional to η plus boundary terms.
7. The fundamental lemma extracts a differential equation
If ∫ g(x)η(x)dx=0 for every sufficiently smooth compactly supported variation η, then g must vanish under standard hypotheses.
This converts an integral stationarity condition into a pointwise differential equation.
8. The Euler–Lagrange equation is the central condition
For J[y]=∫F(x,y,y′)dx with fixed endpoints, stationary functions satisfy ∂F/∂y − d/dx(∂F/∂y′)=0.
This differential equation is not guessed from the application; it is derived from the requirement that first-order variation vanish.
9. A stationary function need not minimise
The Euler–Lagrange equation gives necessary conditions in the standard setting, not automatic sufficiency.
Second variations, convexity, comparison arguments or other structure may be needed to establish a minimum.
10. The shortest curve in Euclidean space is a straight line
Curve length between two graph endpoints is J[y]=∫√(1+(y′)²)dx.
Because the integrand does not depend explicitly on y, the Euler–Lagrange condition implies a constant slope under the ordinary graph formulation.
The stationary path is the straight segment.
11. Geodesics generalise shortest paths
On a curved manifold, path length depends on the metric.
Applying variational reasoning to the energy or length functional produces geodesic equations.
This creates a direct bridge to Differential Geometry.
12. Fermat’s principle makes optics variational
In geometrical optics, light paths can be characterised through stationarity of optical travel time.
Snell’s law emerges from varying the path across media with different refractive indices.
13. Mechanics can be derived from stationary action
For a Lagrangian L(q,q̇,t), the action S[q]=∫L dt is a functional of the whole trajectory.
The Euler–Lagrange equations of this action produce the equations of motion for broad classes of mechanical systems.
The physical law is therefore expressed as a variational statement over paths.
14. Symmetry creates conserved quantities
When the action is invariant under a continuous family of transformations, Noether’s theorem connects that symmetry to a conserved quantity under appropriate assumptions.
Variational structure therefore links symmetry and dynamics.
15. Natural boundary conditions appear when endpoints are free
If variations do not vanish at an endpoint, the boundary term from integration by parts must also vanish.
This creates transversality or natural boundary conditions in addition to the Euler–Lagrange equation.
16. Isoperimetric constraints add global restrictions
A variational problem may minimise one functional while requiring another integral quantity to remain fixed.
Lagrange multipliers extend to this setting: combine the integrands and derive a modified Euler–Lagrange equation.
17. The classical isoperimetric problem asks for maximal area at fixed perimeter
Among closed plane curves of a given perimeter, the circle encloses maximal area.
This is a variational problem over shapes rather than one numerical variable.
18. Higher derivatives produce higher-order Euler–Lagrange equations
If the functional depends on y″ or higher derivatives, repeated integration by parts generates higher-order necessary conditions.
Bending-energy problems naturally produce such equations.
19. Several dependent variables produce systems
If q=(q₁,…,q_n), each component has its own Euler–Lagrange equation.
Variational principles therefore scale from one curve to coupled multi-coordinate systems.
20. Fields produce Euler–Lagrange PDEs
For a functional over a field u(x), the integrand can depend on u and its partial derivatives.
The stationarity condition becomes a partial differential equation.
Many field equations in physics arise this way.
21. Dirichlet energy produces Laplace’s equation
Consider J[u]=∫|∇u|² over a domain with fixed boundary values.
The Euler–Lagrange equation is Δu=0.
Harmonic functions can therefore be characterised both as PDE solutions and as energy minimisers.
22. Weak formulations arise naturally
The first-variation equation is already an integral identity against test functions.
This is precisely the architecture used for weak solutions in PDEs.
Calculus of variations and functional analysis therefore meet before classical differentiability is required.
23. Direct methods prove existence without solving explicitly
A direct method takes a minimising sequence, proves compactness or weak compactness, extracts a convergent subsequence and uses lower semicontinuity to show the limit minimises the functional.
This is often more powerful than trying to solve the Euler–Lagrange equation directly.
24. Coercivity prevents escape to infinity
A coercive functional grows large as the norm of admissible functions grows, helping keep minimising sequences bounded.
Without such control, a sequence can drive the objective down while leaving every compact region of the function space.
25. Lower semicontinuity protects limits
Lower semicontinuity ensures the limiting functional value does not jump below the limit inferior in the wrong direction.
This makes the limit of a minimising sequence a candidate for an actual minimiser.
26. Convexity can turn stationarity into global optimality
For convex variational problems, a stationary point can be a global minimiser under appropriate conditions.
Strict convexity can additionally give uniqueness.
This mirrors finite-dimensional optimisation.
27. Nonconvex functionals can produce multiple local minima
Phase transitions, pattern formation and nonlinear elasticity can involve energies with several competing wells.
The system may become trapped in one local structure even when a lower global energy exists elsewhere.
28. Minimal surfaces optimise area
A minimal surface is stationary for area under suitable variations.
The resulting mean-curvature condition links geometry, PDEs and variational calculus.
29. Optimal control extends variation to controlled dynamics
Optimal control chooses an input function u(t) to minimise a cost while the state follows a differential equation.
Pontryagin-type maximum principles and dynamic programming provide complementary frameworks.
This connects directly to Control Theory.
30. Discretisation turns variational problems into finite optimisation
Finite-element methods approximate an infinite-dimensional function space by a finite-dimensional basis.
The variational problem becomes a matrix optimisation or linear system while preserving much of the original energy structure.
31. A worked mechanism: shortest graph between two points
Let y(a)=A and y(b)=B and minimise J[y]=∫_a^b √(1+(y′)²) dx.
- The integrand F depends on y′ but not y.
- Euler–Lagrange gives d/dx(∂F/∂y′)=0.
- Thus y′/√(1+(y′)²) is constant.
- Hence y′ is constant.
- Therefore y is linear and the path is a straight segment.
32. Common calculus-of-variations failure modes
- Stationary=minimal confusion: treating Euler–Lagrange solutions as automatically minimising.
- Boundary blindness: dropping endpoint terms when endpoints are not fixed.
- Variation mismatch: using perturbations that violate constraints.
- Regularity overreach: assuming classical derivatives exist when the natural minimiser is only weakly differentiable.
- Existence blindness: solving necessary equations without proving an admissible minimiser exists.
- Discretisation confusion: treating a numerical mesh minimiser as exact proof for the continuous problem.
33. Calculus of variations as a mathematical machine
Functional → Admissible Function Space → Perturbation → First Variation → Euler–Lagrange/Weak Equation → Existence/Sufficiency Check → Numerical Approximation → Geometric or Physical Interpretation.
34. What mastery looks like
- distinguish functions from functionals;
- construct admissible variations;
- derive Euler–Lagrange equations by integration by parts;
- handle fixed and free boundaries;
- use multipliers for integral constraints;
- connect weak formulations to PDEs;
- separate necessary conditions from existence and sufficiency;
- recognise direct methods and convexity as structural tools;
- connect variational principles to mechanics, geometry and control.
35. Conclusion
Calculus of variations works by perturbing entire functions rather than single numbers. First variations produce Euler–Lagrange equations. Boundary terms expose additional conditions. Convexity can certify global minima. Direct methods prove existence. Weak formulations connect naturally to PDEs. Optimal control adds dynamic constraints.
Ordinary calculus asks which point is best. Calculus of variations asks which whole path, field or shape is best—and what differential law that optimality forces it to obey.
How Mathematics Works | Batch 10
- How Mathematics Works | Lie Groups & Lie Algebras
- How Mathematics Works | Harmonic Analysis
- Calculus of Variations — this article
- How Mathematics Works | Tensor Analysis
Return to the Mathematics Learning Hub or the How Mathematics Works root.