Euler-Lagrange Equation
Ordinary calculus finds the lowest point of a curve by setting a derivative to zero. The calculus of variations asks the same question one dimension of infinity higher: among all the smooth curves that join two fixed points, which one makes a given integral — a length, a time, an action — as small (or as stationary) as possible? The quantity being optimised, , is a functional: it eats an entire function and returns a single number. The Euler–Lagrange equation is the exact analogue of "" for such a problem — the local, pointwise differential equation that the optimal curve is forced to satisfy at every interior point. The route from the global statement (this integral is stationary) to the local one (this differential equation holds everywhere) is one of the most reused arguments in physics. Perturb the candidate curve by an arbitrary small wiggle that respects the endpoints, demand that the leading change in vanish, integrate by parts to strip the derivative off the wiggle, and then invoke the fundamental lemma: because the wiggle was arbitrary, the bracket multiplying it must vanish identically. That bracket is the Euler–Lagrange equation. Its reach is enormous. Feed it an arc-length integrand and it returns straight lines and geodesics; feed it a descent-time integrand and out comes the brachistochrone cycloid; feed it the action and it reproduces Newton's laws as Lagrange's equations of motion. Optics, elasticity, minimal surfaces, and every classical and quantum field theory are governed by the same template — which is why this single equation is the spine of theoretical physics.
- The Euler–Lagrange equation is the differential equation an extremal of a functional must satisfy when its first variation vanishes for every admissible variation.
- For one function it reads , a generally second-order ODE for .
- It follows from integrating the first variation by parts — using to kill the boundary term — and applying the fundamental lemma of the calculus of variations.
- Stationarity is necessary, not sufficient: the equation locates extremals, but the second variation decides whether each is a minimum, maximum, or saddle.
- Structural shortcuts exist: if has no explicit a momentum is conserved; if has no explicit the Beltrami identity gives an energy first integral that lowers the order.
- Applied to the action it becomes Lagrange's equations of motion — the variational heart of mechanics, optics, and field theory.
- Key idea: stationarity of under arbitrary endpoint-fixed variations is equivalent, through integration by parts and the fundamental lemma, to the pointwise differential equation .
Stationarity of under arbitrary endpoint-fixed variations is equivalent, via integration by parts and the fundamental lemma, to the pointwise differential equation .
Where this lives today
The Euler–Lagrange equation is not a museum piece; it is the working grammar of modern theoretical physics. Every fundamental theory is now defined by writing down a Lagrangian (or Lagrangian density) and handing it to the field version of equation (4): the Standard Model of particle physics is specified by a single Lagrangian whose Euler–Lagrange equations are the Dirac, Yang–Mills, and Higgs equations, and general relativity's Einstein field equations are the Euler–Lagrange equations of the Einstein–Hilbert action . In engineering and computation the same principle powers the finite-element method, which finds approximate extremals of energy functionals to model stressed structures, heat flow, and electromagnetic fields; and it underlies optimal control and trajectory optimisation, where spacecraft and robots follow paths that extremise fuel or time — modern brachistochrones. Machine learning's continuous-time models (neural ODEs, optimal-transport formulations) reach for the same variational calculus, and general-relativistic ray tracing for black-hole imaging integrates the geodesic equation, itself the Euler–Lagrange equation of arc length. Three centuries after Bernoulli's puzzle, "write an action and make it stationary" remains the single most productive move in physics.
The physical picture
Picture the functional as an altitude reading over a landscape whose points are not pairs but entire curves — one axis for every value can take. A candidate extremal sits at a place where the ground is locally flat: no first-order tilt in any direction. A "direction" here is a test function , a smooth wiggle you add to the curve. To keep the two endpoints pinned the wiggle must vanish there, , so admissible perturbations form a wall-to-wall family of bumps that leave and untouched. Stationarity means the first variation — the directional derivative of along — is zero for every such bump. The first figure freezes one candidate curve and one competitor sharing its endpoints.
Two currents run through the algebra of that flatness. First, changing to perturbs the integrand through both slots: a term from the value and a term from the slope. Integration by parts trades the awkward for a plain , but leaves behind a boundary term — harmless when endpoints are fixed, but the germ of natural boundary conditions when an endpoint is free. Second, the object behaves like a momentum conjugate to , and the equation reads "rate of change of momentum equals force." When does not depend on the force is zero and the momentum is conserved — the variational seed of every conservation law. The second figure shows what all this machinery buys: the single most famous extremal in physics.
The core equations
Everything begins with the object being optimised. A functional maps a whole admissible curve to one real number by integrating a given local integrand — the Lagrangian — along it.
where: — the functional, a number assigned to each admissible curve ; — the integrand (Lagrangian), a given smooth function of three independent slots; — the independent variable (a length, a time, a parameter); — the function being optimised, fixed at the endpoints; — its slope, treated as an independent third argument of . Reading: the whole shape of between and sets the value of . To probe stationarity we compare against its neighbours. Every neighbour is the extremal plus a scaled test function that leaves the endpoints untouched, so the comparison stays inside the admissible class.
where: — a small real bookkeeping parameter; all expansions run in powers of ; — an arbitrary smooth test function that vanishes at the fixed endpoints. Reading: the whole one-parameter family collapses to the candidate curve at . The first variation is the derivative of along that family at — the exact analogue of an ordinary directional derivative, and the quantity that stationarity sets to zero.
where: — the first variation, the Gâteaux (directional) derivative of along . Reading: the change in splits into a value-channel and a slope-channel ; the whole derivation is the job of merging these two channels. Setting for all and clearing the slope-channel by parts yields the central result — the local law obeyed by every extremal.
where: — partial derivative of holding and fixed; — the total derivative along the curve, acting through , , and by the chain rule. Reading: at every interior point the value-channel must exactly balance the rate of change of the slope-channel. Expanding the total derivative exposes the equation's true order: generically it is a second-order ODE, degenerate only where the coefficient of vanishes.
where: ; — the coefficient of , non-vanishing for a genuine (non-degenerate) variational problem. Reading: the extremal solves a second-order boundary-value problem, fixed by the two endpoint values. When carries no explicit , the equation admits a first integral for free — the variational "energy," constant along every extremal.
where: — the Beltrami "energy" or Hamiltonian of the problem; — the explicit -dependence, zero for autonomous integrands. Reading: for an -independent integrand the second-order equation drops to first order, which is what makes the brachistochrone and the catenoid solvable in closed form.
The goal is to turn the global demand "the first variation vanishes for every admissible perturbation" into a single local differential equation. We start from the first variation (3), which mixes and its derivative ; the obstruction to concluding anything is that and are not independent, so we cannot simply read off two conditions. The fix is integration by parts, which converts the term into an term plus a boundary contribution, after which the whole integrand multiplies a single arbitrary factor and the fundamental lemma finishes the job.
Step 1. Write the first variation from (3), , and integrate the second term by parts: . Why: parts is the only move that removes the derivative from the arbitrary function η so that a single common factor can be extracted.
Step 2. Kill the boundary term. Since admissible variations obey , the bracket vanishes identically. Why: fixed endpoints are exactly the condition that annihilates the boundary contribution — release an endpoint and this same term survives, producing the natural boundary condition there.
Step 3. Collect the surviving integral into one bracket: , and impose stationarity for every admissible . Why: only after parts does the whole first variation appear as (a fixed continuous function) times (an arbitrary function), the exact setup the fundamental lemma requires.
Step 4. Apply the fundamental lemma of the calculus of variations: if a continuous satisfies for all smooth vanishing at the ends, then . Hence . Why: were the bracket nonzero anywhere, one could choose an η bumped up exactly there to make the integral positive, contradicting stationarity — so it must vanish pointwise. *Verified: reproduces equation (4); the boundary term recovers the natural condition at a free end; matches Stone & Goldbart Ch. 1, Arfken & Weber, and Gelfand & Fomin §3.*
Go deeper · Derivation B · 1 minThe Beltrami identity for autonomous integrands
The aim is to show that when the integrand carries no explicit dependence on the independent variable , the second-order Euler–Lagrange equation possesses a first integral — a quantity constant along every extremal — so the problem drops one order and often becomes separable. The strategy is to compute the total -derivative of the combination directly, using the chain rule and the product rule, and then eliminate the awkward term with the Euler–Lagrange equation itself; the terms conspire to cancel, leaving only the explicit -dependence on the right.
Step 1. Differentiate totally along the extremal: . Why: the total derivative must track x through all three slots of L, and this is the only place the explicit ∂ₓL enters.
Step 2. Differentiate the momentum piece by the product rule: , then use Euler–Lagrange (4) to replace . Why: substituting the equation of motion is what injects the extremal condition, without which no cancellation occurs.
Step 3. Subtract Step 2 from Step 1. The pair and the pair each cancel, leaving . Why: the cancellation is the whole content of the identity — it says the energy changes only through the explicit time/position dependence of L.
Step 4. Impose autonomy : then , a first integral. Why: an x-independent integrand has a conserved "energy," exactly as a time-independent Lagrangian conserves mechanical energy — the variational origin of energy conservation. *Verified: reproduces equation (6); for with the constant is the Jacobi energy integral; drives the brachistochrone and minimal-surface-of-revolution (catenoid) solutions. Consistent with Gelfand & Fomin §4 and Goldstein Ch. 2.*
Go deeper · Derivation C · 1 minNewton's second law from Hamilton's principle
The purpose here is to demonstrate that Lagrange's equations of motion — the Euler–Lagrange equations with the independent variable taken to be time and the integrand taken to be the mechanical Lagrangian — are not a new physical postulate but a rewriting of Newton's second law. We take a single particle of mass moving in a potential , form the action , apply the Euler–Lagrange equation component by component, and watch fall out, thereby identifying stationary action with the equations of motion.
Step 1. Write the Lagrangian with independent variable , so , , and the conjugate momentum is . Why: the slope-channel ∂_{y'}L is literally the ordinary linear momentum here, which is what makes the identification physical.
Step 2. Compute the value-channel: , since only the potential depends on position. Why: this term is the generalised force, and it is the negative gradient of the potential — Newton's force.
Step 3. Assemble the Euler–Lagrange equation : . Why: the total time-derivative of momentum is what the variational principle balances against the force.
Step 4. Read off , i.e. . Why: this is Newton's second law exactly, so requiring the action to be stationary is equivalent to obeying the equations of motion — Hamilton's principle. *Verified: identical to Newtonian dynamics; a free particle () gives , uniform motion; the cornerstone of Lagrangian mechanics, Goldstein Ch. 1–2.*
Limiting cases
Structural features of collapse the general second-order equation into far simpler forms — the first tools any practitioner reaches for.
| Case | Result | Meaning |
|---|---|---|
| independent of | A conserved momentum: the equation integrates once immediately. Shortest path, , gives — a straight line. | |
| independent of (autonomous) | The Beltrami identity, an energy first integral. Drops the order by one; solves the brachistochrone and the catenoid. | |
| independent of | Degenerate: the "equation" is algebraic, not differential — no genuine extremal unless it holds identically. | |
| linear in , | The terms cancel; depends only on the endpoints when (an exact differential). |
Worked examples
1 · Shortest path in the plane (confidence builder)
Among all smooth curves joining and , which minimises the arc length ? Find the curve and its length.
Step 1. Identify the integrand . It contains neither nor explicitly, only — so the " independent of " shortcut applies and is conserved.
Step 2. Set the conserved momentum constant: . Solving, , so , a constant slope.
Step 3. Integrate: . The endpoints fix the constants — from , and from . The extremal is the straight line , as expected: the plane's geodesic.
Step 4. Evaluate the length. With , , matching the Pythagorean distance . The extremal is with length , and the Euler–Lagrange machinery reproduces elementary geometry as a consistency check.
2 · The brachistochrone: fastest descent (fully worked)
A bead slides without friction from rest at to under gravity , with measured downward. Which curve minimises the travel time, and how much faster is it than a straight ramp?
Step 1. Build the time functional. Energy conservation from rest gives the speed , and the time is . The integrand has no explicit — autonomous — so the Beltrami identity (6) applies.
Step 2. Apply Beltrami: . Squaring and rearranging gives the defining relation , with set by the Beltrami constant.
Step 3. Recognise the cycloid. The relation is solved by , — the curve traced by a point on a wheel of radius rolling along the top. Fitting at gives , so and closes consistently.
Step 4. Compute the cycloid time. Along the cycloid (the factors cancel), so .
Step 5. Compare with the straight ramp . Its length is ; the along-ramp acceleration is ; from rest, gives .
Step 6. The cycloid wins by . The Euler–Lagrange extremal of the descent-time functional is the cycloid , , and it reaches in 1.003 s against the ramp's 1.189 s — the counter-intuitive result Bernoulli posed as a public challenge in 1696.
Physics of the portrait
The Euler–Lagrange equation carries two names because it was built twice: once geometrically, by the greatest calculator of the eighteenth century, and once analytically, by a teenager who wrote to him with a cleaner method.
Origins · 1 minEuler and Lagrange and how this was discovered
The problem that started it all was public theatre: in 1696 Johann Bernoulli challenged "the sharpest mathematicians in the world" to find the curve of fastest descent, and Newton, Leibniz, and the Bernoullis answered with brilliant but ad hoc tricks. Leonhard Euler, Johann's student in Basel, spent two decades turning those tricks into a method. His 1744 treatise Methodus inveniendi lineas curvas maximi minimive proprietate gaudentes gave the first general equation for an extremal — but by a laborious geometric limit, replacing the curve with a polygon of many vertices and letting the spacing shrink. It worked, yet it was ungainly. Then in August 1755 a nineteen-year-old in Turin, Joseph-Louis Lagrange, sent Euler a letter introducing a purely analytic device: the variation symbol , an operator that perturbs a whole function at once and commutes cleanly with differentiation and integration. Lagrange's -calculus reduced Euler's pages of geometry to a few lines of algebra — exactly the derivation in this article. Euler, with rare generosity, set aside his own approach, named the subject the "calculus of variations" after Lagrange's symbol, and delayed publishing so the young man would get credit. Lagrange went on to build all of mechanics on it: his 1788 Mécanique analytique famously boasted not a single diagram, deriving the motion of every system from one variational principle. The equation is their joint monument — Euler's generality wearing Lagrange's algebra.
Going further
Texts. Stone & Goldbart, Mathematics for Physics, Ch. 1 (Calculus of Variations) · Arfken, Weber & Harris, Mathematical Methods for Physicists, 7th ed., Ch. 22 · Gelfand & Fomin, Calculus of Variations, §§3–4 (the cleanest modern treatment) · Riley, Hobson & Bence, Mathematical Methods for Physics and Engineering, 3rd ed., Ch. 22 · Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., Ch. 2.
Provenance. The first-variation and Euler–Lagrange derivations are standard textbook results (Stone & Goldbart Ch. 1; Gelfand & Fomin §3). A verifier should: (1) reproduce the integration-by-parts + fundamental-lemma argument for equation (4); (2) confirm the Beltrami identity (6) from the total -derivative of ; (3) recompute the plane-geodesic example — , for , ; (4) recompute the brachistochrone — cycloid m, s versus the straight ramp s with m, m/s², a 15.6 % saving; (5) verify yields (Goldstein Ch. 2). All numbers are elementary and machine-checkable.
Prerequisites. Functionals and Function Spaces · First Variation and Stationarity · Fundamental Lemma of the Calculus of Variations. Leads to. Beltrami Identity and First Integrals · Natural and Essential Boundary Conditions · Functionals of Several Functions and Higher Derivatives · Hamilton's Principle of Stationary Action · Lagrangian Mechanics · Constrained Variation and Lagrange Multipliers.
Ask the tutor: Want to see the same variation-by-parts argument applied to your own functional — a geodesic on a surface, a hanging cable, or a field Lagrangian — worked line by line?
Why is y′ treated as independent of y inside L when y′ is literally the derivative of y?
This is the single most confusing point, and the resolution is bookkeeping, not physics. When we form the partial derivatives and , we regard as an ordinary function of three separate real slots and differentiate slot by slot, exactly as you would with . The link " is the derivative of " is only reimposed afterwards, when we substitute an actual curve and apply the total derivative . Keeping the two steps apart is what makes the chain rule in equation (5) come out right; conflating them early is a common source of wrong signs and missing terms.
What exactly is the difference between δ (variation) and d (differential)?
The variation changes the function at fixed : it compares with a neighbouring curve , holding the independent variable pinned. The differential changes the point along a single curve: it compares with . Because acts at fixed , it commutes with (so ) and with the integral over — the two properties that make the whole derivation go through in a few lines. Lagrange's insight in 1755 was precisely to give this "vary the whole function" operation its own symbol and algebra, separating it cleanly from ordinary differentiation.
Is the Euler-Lagrange equation always second order?
Generically yes, but not always. Expanding the total derivative gives the coefficient of as ; when that is non-zero the equation is a genuine second-order ODE needing two boundary conditions (the fixed endpoints). If the problem is degenerate: an linear in makes the terms cancel and the equation becomes algebraic (often with no admissible extremal), and an with no at all reduces to the algebraic condition . Higher-derivative functionals — a beam's bending energy , for instance — raise the order further, giving the fourth-order Euler–Poisson equation.
How does a free endpoint change the equation?
The interior equation is untouched — it is still — but the boundary term you discarded now returns to work. With a fixed endpoint the variation vanishes there, killing . Release that endpoint and is free to be non-zero, so the only way can vanish for every is if the coefficient itself vanishes: at the free end. This is a natural (or "free") boundary condition, generated by the variational problem rather than imposed by hand — the reason a hanging chain meets a frictionless ring horizontally, and a beam's free end carries no bending moment.
When should I use the Beltrami identity instead of the full equation?
Reach for Beltrami whenever the integrand has no explicit — that is, only. In that autonomous case the identity is a first integral: it is already one order lower than the Euler–Lagrange equation, so instead of a second-order ODE you solve a first-order (usually separable) one. The brachistochrone, the minimal surface of revolution (catenoid), and any geodesic on a surface of revolution all yield to it directly. If does depend on explicitly, Beltrami is not conserved and you must integrate the full equation — though a different first integral may exist if some coordinate is instead cyclic (absent from ).
Does stationary action mean nature minimises something?
Not quite, and the loose phrase "least action" is a historical misnomer. Hamilton's principle demands only that the action be stationary — — not minimal. For short enough time intervals the true path is indeed a local minimum of the action, but past a "conjugate point" (a kinetic focus) it becomes a saddle: nearby paths exist with smaller action, yet the physical trajectory still satisfies . The physics lives entirely in the vanishing first variation, which yields the equations of motion; whether that extremal is a minimum or a saddle is a separate second-variation question with no dynamical consequence. Nature makes the action stationary, not necessarily least.