12.2 The Euler–Lagrange equation

The first variation of 12.1 left us with a condition that still mixed the test function η\eta and its derivative η\eta':

δJ  =  ab(Fyη  +  Fyη)dx  =  0for all η.\delta J \;=\; \int_a^b \left( \frac{\partial F}{\partial y}\,\eta \;+\; \frac{\partial F}{\partial y'}\,\eta' \right) dx \;=\; 0 \quad\text{for all } \eta.

This lesson removes η\eta', invokes the arbitrariness of η\eta, and lands on the single differential equation every extremal satisfies — the Euler–Lagrange equation, the workhorse of the whole subject.

The fundamental lemma

Everything hinges on one small, intuitive fact.

Fundamental lemma of the calculus of variations Derivation

Claim. If g(x)g(x) is continuous on [a,b][a,b] and

abg(x)η(x)dx  =  0\int_a^b g(x)\,\eta(x)\,dx \;=\; 0

for every smooth test function η\eta with η(a)=η(b)=0\eta(a)=\eta(b)=0, then g(x)0g(x) \equiv 0 on [a,b][a,b].

Why. Suppose not — say g(x0)>0g(x_0) > 0 at some interior point. By continuity gg stays positive on a small interval around x0x_0. Choose a test function η\eta that is a smooth positive bump living entirely inside that interval and zero elsewhere (such bumps exist). Then gηdx>0\int g\,\eta\,dx > 0, because the integrand is positive where η0\eta \neq 0 and zero elsewhere — contradicting the hypothesis that the integral vanishes for all η\eta. The same argument with a negative bump handles g(x0)<0g(x_0) < 0. So gg can be neither positive nor negative anywhere: g0g \equiv 0. ∎

The lemma is the variational analogue of “if a vector is orthogonal to every vector, it is zero.” It is what lets us pass from “an integral against every η\eta vanishes” to “the coefficient of η\eta vanishes pointwise” — provided we can first get the condition into the single form gηdx=0\int g\,\eta\,dx = 0.

Integrating by parts

The obstacle is the η\eta' term. Remove it with integration by parts, trading the derivative off η\eta and onto the rest:

abFyη  dx  =  [Fyη]ab=0    abddx ⁣(Fy)η  dx.\int_a^b \frac{\partial F}{\partial y'}\,\eta'\; dx \;=\; \underbrace{\left[ \frac{\partial F}{\partial y'}\,\eta \right]_a^b}_{=\,0} \;-\; \int_a^b \frac{d}{dx}\!\left( \frac{\partial F}{\partial y'} \right)\eta\; dx.

The boundary term vanishes because η(a)=η(b)=0\eta(a) = \eta(b) = 0 — the payoff of pinning the endpoints. Substituting back, the first variation collapses to the single-form condition

δJ  =  ab[Fy    ddx ⁣(Fy)]η  dx  =  0for all η.\delta J \;=\; \int_a^b \left[ \frac{\partial F}{\partial y} \;-\; \frac{d}{dx}\!\left( \frac{\partial F}{\partial y'} \right) \right]\eta\; dx \;=\; 0 \quad\text{for all } \eta.

Now the fundamental lemma applies with g=F/yddx(F/y)g = \partial F/\partial y - \tfrac{d}{dx}(\partial F/\partial y'): the bracket must vanish identically.

The equation

  Fy    ddx ⁣(Fy)  =  0.  \boxed{\;\frac{\partial F}{\partial y} \;-\; \frac{d}{dx}\!\left( \frac{\partial F}{\partial y'} \right) \;=\; 0.\;}
where
F/y\partial F/\partial y
partial derivative of the integrand w.r.t. the height slot y (x, y' held fixed)
F/y\partial F/\partial y'
partial derivative of the integrand w.r.t. the slope slot y' (x, y held fixed)
ddx\dfrac{d}{dx}
total derivative in x — acts on everything that depends on x, including y(x) and y'(x) inside ∂F/∂y'

Two derivatives that are easy to confuse, and the distinction is the crux:

Because that last term carries yy'', the Euler–Lagrange equation is in general a second-order ODE for y(x)y(x) (Foundations Ch 5). The variational problem — a search over an infinite-dimensional space of curves — has become an ordinary differential equation with two boundary conditions y(a)=Ay(a)=A, y(b)=By(b)=B. That reduction is the entire practical power of the method.

First worked example: the shortest path

Find the curve of least length between two points — the arc-length functional F=1+y2F = \sqrt{1 + y'^2}.

Straight lines minimise length Derivation

Since FF depends on yy' only, F/y=0\partial F/\partial y = 0, and Euler–Lagrange reduces to

ddx ⁣(Fy)=0Fy=const.\frac{d}{dx}\!\left( \frac{\partial F}{\partial y'} \right) = 0 \quad\Longrightarrow\quad \frac{\partial F}{\partial y'} = \text{const}.

Compute the partial: Fy=y1+y2\dfrac{\partial F}{\partial y'} = \dfrac{y'}{\sqrt{1+y'^2}}. Setting it equal to a constant CC and solving,

y1+y2=Cy2=C2(1+y2)y=C1C2m,\frac{y'}{\sqrt{1+y'^2}} = C \quad\Longrightarrow\quad y'^2 = C^2(1+y'^2) \quad\Longrightarrow\quad y' = \frac{C}{\sqrt{1-C^2}} \equiv m,

a constant. So y=mx+cy = mx + c — a straight line, with mm and cc fixed by the two endpoints. The obvious answer, but now derived from a principle rather than assumed, and by exactly the machinery that will hand us the non-obvious answers of the next lesson.

Two shortcuts: first integrals

When the integrand is missing one of its slots, the second-order equation drops to first order. These two special cases solve most classic problems.

  F    yFy  =  const.  \boxed{\;F \;-\; y'\,\frac{\partial F}{\partial y'} \;=\; \text{const}.\;}
The Beltrami identity, and why it is 'energy' Derivation

Suppose F=F(y,y)F = F(y, y') with no explicit xx. Compute the total xx-derivative of the combination FyF/yF - y'\,\partial F/\partial y':

ddx ⁣(FyFy)=dFdxyFyyddxFy.\frac{d}{dx}\!\left( F - y'\frac{\partial F}{\partial y'} \right) = \frac{dF}{dx} - y''\frac{\partial F}{\partial y'} - y'\frac{d}{dx}\frac{\partial F}{\partial y'}.

With no explicit xx, the chain rule gives dFdx=Fyy+Fyy\dfrac{dF}{dx} = \dfrac{\partial F}{\partial y}y' + \dfrac{\partial F}{\partial y'}y''. Substitute:

=Fyy+FyyyFyyddxFy=y(FyddxFy).= \frac{\partial F}{\partial y}y' + \frac{\partial F}{\partial y'}y'' - y''\frac{\partial F}{\partial y'} - y'\frac{d}{dx}\frac{\partial F}{\partial y'} = y'\left( \frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} \right).

The bracket is exactly the Euler–Lagrange expression, which vanishes on an extremal. So the whole derivative is zero and FyF/yF - y'\,\partial F/\partial y' is constant along any solution.

This is one of the most important facts in physics in disguise. When FF is a Lagrangian L(y,y˙)L(y,\dot y) with no explicit time, the conserved combination yF/yFy'\partial F/\partial y' - F is the energy (the Hamiltonian). Time-translation symmetry of the Lagrangian \Rightarrow conservation of energy — the special case of Noether’s theorem we prove in general in 12.5.

Check: Beltrami on the shortest path Worked Example

For F=1+y2F = \sqrt{1+y'^2} (which is also independent of xx), the Beltrami identity gives FyyF=1+y2y21+y2=11+y2=constF - y'\partial_{y'}F = \sqrt{1+y'^2} - \dfrac{y'^2}{\sqrt{1+y'^2}} = \dfrac{1}{\sqrt{1+y'^2}} = \text{const}, so y=consty' = \text{const} — the straight line again, reached by the other shortcut. Both first integrals are available whenever FF misses both xx and yy; pick whichever is cleaner.

The history — Euler's construction, Lagrange's δ, and a new calculus

The subject was born from Johann Bernoulli’s 1696 brachistochrone challenge (12.3), but its general machinery is due to Leonhard Euler and Joseph-Louis Lagrange. Euler, in 1744, obtained the equation now bearing both names by a laborious limiting argument — approximating the curve by a polygon of many segments, extremising over the vertices, and letting the segments shrink. In 1755 the nineteen-year-old Lagrange sent Euler a far slicker method: the δ\delta-notation and the perturbation y+εηy + \varepsilon\eta used in 12.1, which sidesteps the polygon entirely. Euler recognised its superiority at once, held back his own results so the young man could publish first, and named the new field the calculus of variations after Lagrange’s δ\delta-variations. The collaboration produced not only the equation but the variational reformulation of all of mechanics that Lagrange completed in his Mécanique analytique (1788).

The next lesson turns the Euler–Lagrange equation and these two first integrals loose on the problems that made the subject famous.