On this page
Ordinary calculus finds the number x that makes f(x) smallest. The calculus of variations asks which whole function y(x) makes an integral smallest: the shortest curve, the quickest slide, the path a ball takes. One differential equation answers all of them.
What is the Euler–Lagrange equation?
Take J[y] = ∫ F(x, y, y′) dx from x = a to x = b, with y(a) and y(b) fixed. A function that makes J stationary must satisfy ∂F/∂y − d/dx (∂F/∂y′) = 0. That is the Euler–Lagrange equation.
The equation was discovered in the 1750s by Leonhard Euler and Joseph-Louis Lagrange, in connection with the tautochrone problem, according to Wikipedia's article on the Euler–Lagrange equation. The MacTutor biography of Lagrange records that he sent Euler his results on the tautochrone, containing his method of maxima and minima, in a letter dated 12 August 1755, when he was 19, and that Euler replied on 6 September saying how impressed he was.
If you have used Lagrange multipliers for constrained optimisation, this is the same instinct one level up: at a minimum, a small allowed change changes nothing to first order.
How do you derive the Euler–Lagrange equation?
Turn a question about functions into a question about one number.
Suppose y(x) is the minimiser. Pick any smooth function η(x) with η(a) = η(b) = 0, so the endpoints stay pinned.
Look at the family y + εη. Now J(ε) is an ordinary function of the number ε, with a minimum at ε = 0, so dJ/dε = 0 there.
Differentiate under the integral: at ε = 0, ∫ (∂F/∂y · η + ∂F/∂y′ · η′) dx = 0.
Integrate the second term by parts. The boundary term [η ∂F/∂y′] vanishes because η is zero at both ends, leaving ∫ η (∂F/∂y − d/dx ∂F/∂y′) dx = 0.
This holds for every allowed η. If the bracket were non-zero somewhere, a small bump of η there would make the integral non-zero. So the bracket is zero everywhere: the Euler–Lagrange equation.
Why is the shortest path between two points a straight line?
Arc length is J = ∫ √(1 + y′²) dx, so F = √(1 + y′²). Work it through for A = (0, 0) and B = (3, 4):
∂F/∂y = 0, because F has no y in it.
So d/dx (∂F/∂y′) = 0, which means y′/√(1 + y′²) is a constant.
That forces y′ itself to be constant: a straight line, as in the Wikipedia worked example linked above.
Fitting the endpoints gives y = 4x/3, with length √(3² + 4²) = 5.
Now test it. Bend the line: y = 4x/3 + ε sin(πx/3), where η = sin(πx/3) is zero at x = 0 and x = 3. Expanding in ε, the first-order term is zero (the Euler–Lagrange equation at work) and the second-order term gives length ≈ 5 + (27π²/1500)ε², about 5 + 0.18ε². Every bend of this kind, up or down, makes the path longer, which is what a minimum looks like.
What is the Beltrami identity and when does it help?
When F does not depend on x explicitly, the Beltrami identity says F − y′ ∂F/∂y′ = C, a constant. You solve a first-order equation instead of a second-order one.
Check it on the straight line: √(1 + y′²) − y′²/√(1 + y′²) = 1/√(1 + y′²) = C, so y′ is constant again. A classic use is the brachistochrone, the curve of fastest descent, whose answer the same page shows is a cycloid.
How does the same equation give Lagrangian mechanics?
Swap x for time t and y for position x(t). For many systems the Lagrangian is L = T − V, kinetic minus potential energy, and the motion keeps the action (the time integral of L) stationary, as the Wikipedia article on Lagrangian mechanics explains.
Work it for one particle on a line, with L = ½mẋ² − V(x):
∂L/∂x = −dV/dx.
∂L/∂ẋ = mẋ, so d/dt (∂L/∂ẋ) = mẍ.
Euler–Lagrange: −dV/dx − mẍ = 0, so mẍ = −dV/dx.
That is Newton's second law with force −dV/dx. For a spring, V = ½kx² gives mẍ = −kx, simple harmonic motion. The equation that found a shortest path also rebuilds Newton's mechanics; for how calculus itself began, read who invented calculus, Newton or Leibniz.
A checklist for any variational problem
Write the quantity as ∫ F(x, y, y′) dx and fix the endpoints.
Compute ∂F/∂y and ∂F/∂y′.
If F has no y, ∂F/∂y′ is constant. If F has no x, use the Beltrami identity.
Solve the differential equation and fit the boundary conditions.
Check with a bent path y + εη: nothing should change to first order in ε.
If integration by parts or partial derivatives feels shaky, the Fermi Concept Library covers every concept in physics, chemistry, biology, mathematics and computing, so you can close that gap first. To practise problems like these, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.



