A soap film stretched between two wires settles into a shape with the minimum possible surface area. Light passing through different media bends so as to travel along the path of shortest time. A planet orbiting the sun follows the trajectory that makes a quantity called the action stationary.
In each case, nature appears to be solving an optimization problem. Not “find the value of that minimizes ” — ordinary calculus handles that — but something stranger: “find the entire shape, path, or function that minimizes a quantity depending on the whole shape.”
The mathematics that makes this precise is called the calculus of variations. It was developed in the eighteenth century, primarily by Euler and Lagrange, and it is one of the most consequential branches of analysis. Modern physics, in essentially all its forms, is built on it: classical mechanics is calculus of variations applied to the action, electromagnetism is calculus of variations applied to a different action, general relativity is calculus of variations applied to spacetime curvature, and quantum field theory is calculus of variations applied to fields with extra integration over all possible histories.
This article is about what the subject is, where it came from, and why it has stayed at the center of physics for almost three centuries.
The brachistochrone
The starting problem of the field — and one of the cleanest illustrations — is the brachistochrone problem, posed by Johann Bernoulli in 1696.
Place two points and at different heights, with above . Connect them with some curve. Roll a frictionless bead from down the curve under gravity. Which curve gets the bead from to in the shortest time?
The naïve guess is a straight line — shortest distance, fastest path. But that’s wrong. Consider the bead’s speed: it accelerates as it falls. A curve that drops steeply at first will let the bead pick up speed quickly, even though it covers more ground than the straight line. The optimum balances these effects. The right answer turns out to be an arc of a cycloid — the curve traced by a point on the rim of a rolling circle.
The brachistochrone problem cannot be solved by ordinary calculus. There is no single variable to differentiate against. The unknown is a whole curve, and you have to find the curve that minimizes a quantity (total time) computed from the entire shape.
Bernoulli’s challenge was answered, almost immediately, by Newton (anonymously, but the style was unmistakable), Leibniz, l’Hôpital, and Bernoulli’s brother Jakob. Each used a different ad-hoc technique. The general method came forty years later from Euler.
What a functional is
The mathematical innovation is to think of curves as inputs to a function — not real-number inputs, but full-curve inputs. The output is a number.
Define to be the total time the bead takes to roll along the curve . Different curves give different times, so assigns a number to each curve. We want to find the curve that minimizes .
A function whose input is itself a function (and whose output is a number) is called a functional. The calculus of variations is the calculus of functionals.
The key technical move is to imagine perturbing the curve slightly. Let be the curve we’re considering, and let be a small “wiggle” function that vanishes at the endpoints. Define the perturbed curve
The functional becomes a function of the single real variable :
For to minimize , the derivative of at must be zero — otherwise some choice of perturbation would lower . This is the variational analogue of the ordinary first-derivative condition .
The Euler-Lagrange equation
For a functional of the form
— where is some function of the position , the value of , and its slope — the condition that extremizes becomes a differential equation:
This is the Euler-Lagrange equation. It was derived by Euler in 1744 and given its modern variational treatment by Lagrange in 1755. It is the central tool of the calculus of variations: the problem “find minimizing ” reduces to “solve this ODE for .”
The Euler-Lagrange equation bridges optimization and differential equations. A problem about whole curves is converted into a problem about pointwise constraints. It is, in some sense, the analog of the fundamental theorem of calculus — it relates an integrated quantity (the functional) to a pointwise condition (the equation).
For the brachistochrone, the right is the time integrand; solving the resulting ODE gives the cycloid.
Mechanics from a single principle
The most consequential application of calculus of variations is the principle of least action in physics.
For a mechanical system, define the Lagrangian , where is kinetic energy and is potential energy. The action is the integral of the Lagrangian over time:
The principle of least action — actually “stationary action,” but the historical name stuck — states: the actual trajectory taken by the system between fixed initial and final states is the one that makes stationary.
Apply the Euler-Lagrange equation:
For a particle in a potential , with , this gives
which is exactly Newton’s second law: .
So Newtonian mechanics is the Euler-Lagrange equation of an action principle. This was derived by Lagrange around 1788 and is the foundation of what is now called Lagrangian mechanics.
The reformulation seems like a notational convenience until you realize what it makes possible. Lagrangian mechanics generalises cleanly to:
- Constrained systems (like a pendulum on a rod or a bead on a wire) — handled by choosing generalized coordinates.
- Continuous media (fluids, elastic solids) — Lagrangian density instead of point Lagrangian.
- Field theory (electromagnetism, gravity) — fields are infinite-dimensional generalised coordinates.
- Special and general relativity — Lagrangian formulations exist that respect the relevant symmetries.
- Quantum mechanics — Feynman’s path integral formulation explicitly sums over all paths.
The principle of least action is one of the most unifying ideas in physics. Almost every physical theory written down in the twentieth century has been formulated as “stationary action of some Lagrangian.” Discovering the right Lagrangian is, often, what physicists mean by “discovering a new theory.”
Other classical applications
Beyond mechanics, the calculus of variations underlies a long list of classical and modern problems.
Geodesics. On a curved surface, the shortest path between two points is a geodesic. Geodesics are stationary curves of the arc-length functional . The geodesic equation falls directly out of Euler-Lagrange. This is the mathematical content of “spacetime is curved and objects move along geodesics” in general relativity.
Minimal surfaces. A soap film bounded by a closed curve takes the shape with minimum area for that boundary. The condition that a surface minimizes area locally (a “stationary surface”) is a partial differential equation called the minimal surface equation — derived as the Euler-Lagrange equation of the area functional. Famous examples include the catenoid, helicoid, and Scherk’s surface.
Fermat’s principle. Light follows the path that minimizes (or extremizes) total optical path length. This is the basis of all of geometric optics — refraction, reflection, mirages, lenses — and is precisely an application of the calculus of variations to a path-length functional.
Isoperimetric problems. Among all closed curves of a given perimeter, the circle encloses the maximum area. Among all closed surfaces of a given area, the sphere encloses the maximum volume. These ancient observations become rigorous theorems via variational methods.
Brachistochrones in modern guise. Optimal control theory, used in everything from rocket trajectories to robot motion planning, is calculus of variations with control inputs. The Pontryagin maximum principle is a generalised Euler-Lagrange equation.
The “least” in “least action”
A historical note: physics textbooks usually call it “the principle of least action,” but the actual principle is “stationary action” — the action is at a critical point, not necessarily a minimum. For short time intervals, classical mechanics’ action is genuinely a minimum; for longer intervals, it can be a saddle point. The mathematical condition is that the first variation vanishes, not that the second variation is positive-definite.
The looser language survives because it’s catchier and because in most everyday situations the stationary point is in fact a minimum. But strict purists will use “stationary” or “extremal” instead.
What the subject teaches
The calculus of variations is the mathematics that makes precise an old physical intuition: nature is parsimonious. Whatever is happening — a soap film settling, a planet orbiting, a quantum field evolving — is the answer to an optimization problem with a specific function being optimized.
That intuition wasn’t obviously correct in 1696. It is now, in a precise mathematical sense, what we mean by physics. Almost every fundamental physical law since Newton has been reformulated as a stationary-action principle. The unifying perspective allows physicists to compare theories, identify their symmetries (via Noether’s theorem), and explore extensions.
For a mathematics student, the calculus of variations is a beautiful subject in its own right — full of clean theorems, elegant proofs, and surprising applications. For a physics student, it is essentially the language in which all of modern theoretical physics is written. For a working engineer, optimal control theory and shape optimization are direct descendants.
The leap from “calculus of one variable” to “calculus of functions” is one of the larger conceptual jumps in mathematics. Most students who manage it never look at differential equations the same way again. The realization that minimizing distances becomes minimizing actions, and that the same mathematical machinery works for both, is one of the moments that mathematics starts to feel less like a collection of techniques and more like a single language. That language, perhaps more than any other, is the language nature seems to be speaking.
Frequently asked
Is the calculus of variations just optimization in disguise?
Yes, but on infinite-dimensional spaces. Ordinary calculus optimizes over real numbers (one variable) or vectors (finitely many variables). Calculus of variations optimizes over function spaces — the variable is an entire function or curve, and the quantity being minimized is a number depending on that function (a 'functional').
What is an 'action' in physics?
Action is a number associated with a possible history of a system — the integral of the Lagrangian (kinetic minus potential energy) over time. The principle of least action says: nature follows the history that makes this number stationary. It's the unifying language of mechanics, electromagnetism, general relativity, and quantum field theory.
Did Euler invent calculus of variations?
Largely, yes. Euler systematized the subject in 1744 with his book Methodus Inveniendi Lineas Curvas. Joseph-Louis Lagrange refined the methods around 1755 with what is now called Lagrangian mechanics. The Euler-Lagrange equation, the central tool of the field, bears both their names.