Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.The best shape, not the best number
Which slide gets a marble from the top to a point lower down fastest? Most people guess the straight line, since it’s the shortest. It’s wrong! A curve that dips steeply first lets the marble build speed early and wins the race. Johann Bernoulli posed this puzzle in 1696, and the answer is a curve called a cycloid, the path traced by a point on a rolling wheel.
Here you’re not choosing a number but a whole curve. Rules that give a score to a whole function are called functionals, and finding the best function is the calculus of variations.
A rocket’s ascent path, a robot arm’s smoothest motion, a satellite’s fuel-optimal transfer orbit: each is “find the best function”. Nature works this way too. Every law of motion can be written as “the path that makes the action stationary”.
- 1. The fastest slide between two points at different heights is…
- 2. A functional takes ___ and returns ___.
- 3. On flat ground, the shortest path between two points is…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Functionals
A typical functional is , with fixed end values and . The function is called the Lagrangian.
| Problem | Functional | Optimal curve |
|---|---|---|
| shortest path | straight line | |
| brachistochrone | cycloid | |
| soap film between rings | catenoid | |
| hanging chain (fixed length) | potential energy | catenary |
| least action | Newton’s motion |
Like functions, functionals have minima. Like derivatives, they have a “derivative” (the first variation). The minimizer must make it zero.
- 1. ∫₀¹ y dx for y = x²?
- 2. The length of y = x on [0, 1]?
- 3. The minimal soap film between two rings is a…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.The Euler–Lagrange equation
Perturb a candidate by , where so the endpoints stay fixed. Differentiate at :
The second form comes from integrating by parts; the boundary terms vanish. For this to be 0 for every , the bracket must vanish (the fundamental lemma):
Examples:
- Length. has no , so is constant. Then is constant: a straight line.
- Least action. gives , Newton’s law for a projectile. In general, gives , which is Lagrangian mechanics.
- A Beltrami shortcut. If doesn’t depend on , then . That gives the catenary and the brachistochrone quickly.
- 1. The Euler–Lagrange equation is…
- 2. L = T − V in Euler–Lagrange gives…
- 3. If L has no explicit x, the conserved quantity is…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Derivation, carefully
Let . Differentiating under the integral (smooth ) gives . Integrating by parts gives , and the bracket vanishes because .
Fundamental lemma of the calculus of variations. If is continuous and for every smooth vanishing at the ends, then . Otherwise pick as a bump where , and the integral is positive. ∎
In Hilbert-space language (A3.5-5), is the gradient of in , so Euler–Lagrange says “the gradient is zero”. This viewpoint makes the calculus of variations a direct sibling of A3.5-10’s Fréchet derivatives.
Beltrami identity
If , then on extremals. For the brachistochrone, gives , which is solved by the cycloid.
Minimum, maximum or saddle?
only gives stationary functions, the analogue of critical points. The second variation decides, through the Legendre condition (needed for a minimum) and the Jacobi conjugate-point test. “Least” action is really stationary action. Over long times a physical path can stop being a minimum, as on a sphere beyond antipodal points.
Constraints: Lagrange multipliers again
To extremize subject to (for example, fixed length), apply Euler–Lagrange to , as in A3.2-9. Dido’s problem, the maximum area with fixed perimeter, gives a circle (Practice Code 5). The hanging chain of fixed length gives a catenary.
Exercise 3.1: Derive the Euler–Lagrange equation for L = ½y′² − ½y² and solve it with y(0) = 0, y(π/2) = 1
and , so . The solution is , and the boundary values give , , so .
- 1. The boundary terms vanish in the derivation because…
- 2. δJ = 0 guarantees a…
- 3. Dido's problem (max area, fixed perimeter) gives a…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Direct methods: discretize, then optimize
In practice, instead of solving the Euler–Lagrange ODE (a two-point boundary-value problem), you can discretize the functional and optimize the finite-dimensional problem directly. This is direct transcription. It’s how modern trajectory optimizers work:
- direct collocation (Hargraves and Paris, 1987; Kelly, 2017);
- pseudospectral methods, which planned NASA’s zero-propellant space-station maneuvers (Bedrossian, Bhatt, Kang and Ross, 2009);
- multiple shooting.
For the brachistochrone, a polygonal chute’s travel time is exact segment by segment: . So optimizing 39 interior heights by BFGS recovers the cycloid (Exercise 2).
From variations to optimal control and learning
- Optimal control generalizes the calculus of variations to subject to .
- Pontryagin’s maximum principle (1956) adds costate (adjoint) equations, which are the Euler–Lagrange equations with multipliers. It allows bounded controls, giving bang-bang rocket thrust.
- The adjoint equations are the continuous-time ancestor of backpropagation (A3.3-5) and of Neural-ODE adjoint training (Chen et al., 2018).
- Robotics. CHOMP (Ratliff et al., 2009) and TrajOpt (Schulman et al., 2014) optimize trajectory functionals: smoothness ∫‖ẍ‖² plus obstacle cost, using functional gradient descent. Minimum-jerk models of human reaching come from minimizing ∫‖x⃛‖² (Flash and Hogan, 1985).
- Variational integrators. Discretizing the action rather than the equations gives integrators that conserve momentum and nearly conserve energy for very long simulations of orbits, molecules and multibody robots (Marsden and West, 2001). That’s Exercise 1’s idea taken seriously.
- Variational inference minimizes a functional (the KL divergence, or the negative ELBO) over distributions. Its stationarity conditions give mean-field updates, the calculus of variations in probability space (Blei, Kucukelbir and McAuliffe, 2017).
References
- I. M. Gelfand, S. V. Fomin (1963). Calculus of Variations. Prentice Hall (Dover reprint).
- J. Bernoulli (1696). “Problema novum ad cujus solutionem mathematici invitantur.” Acta Eruditorum.
- L. Pontryagin, V. Boltyanskii, R. Gamkrelidze, E. Mishchenko (1962). The Mathematical Theory of Optimal Processes. Wiley.
- C. Hargraves, S. Paris (1987). “Direct trajectory optimization using nonlinear programming and collocation.” Journal of Guidance, Control, and Dynamics, 10(4).
- M. Kelly (2017). “An introduction to trajectory optimization: how to do your own direct collocation.” SIAM Review, 59(4).
- N. Bedrossian, S. Bhatt, W. Kang, I. M. Ross (2009). “Zero-propellant maneuver guidance.” IEEE Control Systems Magazine, 29(5).
- N. Ratliff, M. Zucker, J. A. Bagnell, S. Srinivasa (2009). “CHOMP: gradient optimization techniques for efficient motion planning.” ICRA.
- T. Flash, N. Hogan (1985). “The coordination of arm movements: an experimentally confirmed mathematical model.” Journal of Neuroscience, 5(7).
- J. Marsden, M. West (2001). “Discrete mechanics and variational integrators.” Acta Numerica, 10.
- D. Blei, A. Kucukelbir, J. McAuliffe (2017). “Variational inference: a review for statisticians.” JASA, 112.