4.10.13Advanced Topics (Elite Level)

Euler-Lagrange equation — derivation

1,961 words9 min readdifficulty · medium6 backlinks

WHAT are we optimizing?

The classic example: the shortest path between two points has L=1+y2L=\sqrt{1+y'^2}, because arc length is J[y]=ab1+y2dxJ[y]=\int_a^b\sqrt{1+y'^2}\,dx. We want the y(x)y(x) that makes this smallest.

Recall Why can't ordinary calculus do this directly?

Because yy is not one number — it's infinitely many numbers (one height per xx). Plain ddx\frac{d}{dx} can't search over all curves. We need a way to perturb the whole curve and demand the integral doesn't change to first order.


HOW: the variation trick (derivation from scratch)

Step 1 — Build a family of nearby curves. Suppose y(x)y(x) is the true extremal. Perturb it: Y(x,ε)  =  y(x)+εη(x)Y(x,\varepsilon) \;=\; y(x) + \varepsilon\,\eta(x)

Why this step? We need to wiggle the whole curve. η(x)\eta(x) is an arbitrary smooth "wiggle shape" and ε\varepsilon is a small dial controlling the size of the wiggle. Setting ε=0\varepsilon=0 recovers the true curve.

Step 2 — Respect the fixed endpoints. Since every competitor must pass through the same endpoints, Y(a)=yaY(a)=y_a and Y(b)=ybY(b)=y_b for all ε\varepsilon. This forces η(a)=η(b)=0\boxed{\eta(a)=\eta(b)=0}

Why this step? If η\eta were nonzero at an endpoint, the perturbed curve would miss the required endpoint — not allowed.

Step 3 — Turn the functional into an ordinary function of ε\varepsilon. Φ(ε)  =  abL(x,Y,Y)dx\Phi(\varepsilon) \;=\; \int_a^b L\big(x,\,Y,\,Y'\big)\,dx Because the true curve is at ε=0\varepsilon=0, and it extremizes JJ, the ordinary function Φ(ε)\Phi(\varepsilon) must have a stationary point at ε=0\varepsilon=0: dΦdεε=0=0\left.\frac{d\Phi}{d\varepsilon}\right|_{\varepsilon=0}=0

Why this step? We've reduced an infinite-dimensional problem to a 1-D calculus problem! Now we use ordinary ddε\frac{d}{d\varepsilon}.

Step 4 — Differentiate under the integral. dΦdε=ab(LYYε+LYYε)dx\frac{d\Phi}{d\varepsilon}=\int_a^b\left(\frac{\partial L}{\partial Y}\frac{\partial Y}{\partial\varepsilon}+\frac{\partial L}{\partial Y'}\frac{\partial Y'}{\partial\varepsilon}\right)dx Since Yε=η\dfrac{\partial Y}{\partial\varepsilon}=\eta and Yε=η\dfrac{\partial Y'}{\partial\varepsilon}=\eta', and evaluating at ε=0\varepsilon=0 (so YyY\to y): 0=ab(Lyη+Lyη)dx0=\int_a^b\left(\frac{\partial L}{\partial y}\,\eta+\frac{\partial L}{\partial y'}\,\eta'\right)dx

Why this step? Chain rule: LL depends on ε\varepsilon only through YY and YY'.

Step 5 — Integrate the second term by parts to free η\eta from its derivative. abLyηdx=[Lyη]ab=0 (endpoints!)abddx ⁣(Ly)ηdx\int_a^b\frac{\partial L}{\partial y'}\,\eta'\,dx=\underbrace{\left[\frac{\partial L}{\partial y'}\,\eta\right]_a^b}_{=\,0\ \text{(endpoints!)}}-\int_a^b\frac{d}{dx}\!\left(\frac{\partial L}{\partial y'}\right)\eta\,dx

Why this step? The boundary term vanishes because of Step 2 (η(a)=η(b)=0\eta(a)=\eta(b)=0). This is exactly why the endpoint condition mattered. Now every term has a bare η\eta.

Step 6 — Factor out η\eta. 0=ab(LyddxLy)η(x)dx0=\int_a^b\left(\frac{\partial L}{\partial y}-\frac{d}{dx}\frac{\partial L}{\partial y'}\right)\eta(x)\,dx

Step 7 — Apply the Fundamental Lemma of the Calculus of Variations.

Why this step? η\eta is arbitrary. If the bracket g(x)g(x) were nonzero anywhere, we could choose an η\eta that bumps up exactly there, making the integral nonzero — contradiction. (See worked example below for the steel-man.)



Useful shortcut: the Beltrami identity

Derive it: compute dLdx\dfrac{dL}{dx} totally: dLdx=Lx+Lyy+Lyy\frac{dL}{dx}=\frac{\partial L}{\partial x}+\frac{\partial L}{\partial y}y'+\frac{\partial L}{\partial y'}y'' Substitute the E–L equation Ly=ddxLy\frac{\partial L}{\partial y}=\frac{d}{dx}\frac{\partial L}{\partial y'}: dLdx=Lx+yddxLy+yLy=Lx+ddx ⁣(yLy)\frac{dL}{dx}=\frac{\partial L}{\partial x}+y'\frac{d}{dx}\frac{\partial L}{\partial y'}+y''\frac{\partial L}{\partial y'}=\frac{\partial L}{\partial x}+\frac{d}{dx}\!\left(y'\frac{\partial L}{\partial y'}\right) So ddx ⁣(LyLy)=Lx\dfrac{d}{dx}\!\left(L-y'\dfrac{\partial L}{\partial y'}\right)=\dfrac{\partial L}{\partial x}. If L/x=0\partial L/\partial x=0:


Worked Examples


Common Mistakes (Steel-manned)


Recall Feynman: explain it to a 12-year-old

Imagine a wire bent between two nails, and you want the shape that makes a bead slide down fastest. You can't try every shape — there are infinitely many. So you take one shape and jiggle it a tiny bit. If jiggling makes the slide-time go down, that shape wasn't the best — you'd keep jiggling. The best shape is the one where tiny jiggles change nothing (like the bottom of a valley is flat). Writing "jiggle changes nothing" as a clean equation gives the Euler–Lagrange equation. It turns "try every curve" into "solve one equation".


Active-Recall Flashcards

What is a functional?
A rule J[y]=abL(x,y,y)dxJ[y]=\int_a^b L(x,y,y')\,dx that maps each function y(x)y(x) to a number.
State the Euler–Lagrange equation.
Lyddx(Ly)=0\frac{\partial L}{\partial y}-\frac{d}{dx}\left(\frac{\partial L}{\partial y'}\right)=0.
Why must η(a)=η(b)=0\eta(a)=\eta(b)=0 in the derivation?
Endpoints are fixed, so every competing curve shares them; this also kills the boundary term in integration by parts.
What role does integration by parts play?
It moves the derivative off η\eta' onto Ly\frac{\partial L}{\partial y'} so η\eta appears bare and can be factored out.
State the Fundamental Lemma of calculus of variations.
If abgηdx=0\int_a^b g\,\eta\,dx=0 for all smooth η\eta vanishing at endpoints, then g0g\equiv0 on [a,b][a,b].
Why is ddxLy\frac{d}{dx}\frac{\partial L}{\partial y'} a total derivative?
Because Ly\frac{\partial L}{\partial y'} depends on xx directly and through y(x),y(x)y(x),y'(x); chain rule gives three terms.
When does the Beltrami identity apply and what is it?
When LL has no explicit xx: then LyLy=constL-y'\frac{\partial L}{\partial y'}=\text{const}.
What does E–L give for L=1+y2L=\sqrt{1+y'^2}?
y=y'= const, i.e. a straight line (shortest path).
What does E–L give for L=12mq˙2V(q)L=\frac12 m\dot q^2-V(q)?
mq¨=V(q)m\ddot q=-V'(q), i.e. Newton's F=maF=ma.
What happens to the boundary term if endpoints are free?
It must vanish on its own, giving natural boundary conditions Lya,b=0\frac{\partial L}{\partial y'}\big|_{a,b}=0.

Connections

Concept Map

integrand is

requires

perturbed into

uses

forces

reduces J to

extremum gives

apply

then

kills boundary term in

with

yields

Functional J of y

Lagrangian L

Fixed endpoints y at a and b

Family Y equals y plus eps eta

Wiggle eta

eta zero at a and b

Phi of eps

dPhi deps equals zero at eps zero

Differentiate under integral

Integration by parts

Fundamental lemma of variations

Euler-Lagrange ODE

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, normal calculus mein hum poochhte hain "kaunsa number xx function f(x)f(x) ko minimize karta hai?" Lekin yahan game alag hai — hume poora curve y(x)y(x) dhoondhna hai jo ek integral (jise functional bolte hain, J[y]=abLdxJ[y]=\int_a^b L\,dx) ko minimize kare. Jaise do points ke beech sabse chhota path, ya wo wire-shape jispe bead sabse fast slide kare (brachistochrone). Yahan unknown ek number nahi, ek puri function hai.

Trick yeh hai: maan lo sahi curve y(x)y(x) hai. Usko thoda "jiggle" karo — Y=y+εη(x)Y=y+\varepsilon\,\eta(x), jahan η\eta koi bhi wiggle-shape hai aur ε\varepsilon chhota knob hai. Kyunki endpoints fixed hain, η(a)=η(b)=0\eta(a)=\eta(b)=0 rakhna zaroori hai. Ab functional ek simple function Φ(ε)\Phi(\varepsilon) ban gaya, aur valley ke bottom ki tarah Φ(0)=0\Phi'(0)=0 hona chahiye. Isse infinite-dimensional problem 1-D calculus ban gaya — yahi asli jaadu hai.

Phir integration by parts lagao taaki η\eta' hat ke sirf η\eta bache. Boundary term zero ho jaata hai kyunki η\eta endpoints pe zero hai (isiliye fixed-endpoint condition itni important thi). Bachta hai (LyddxLy)ηdx=0\int (\frac{\partial L}{\partial y}-\frac{d}{dx}\frac{\partial L}{\partial y'})\,\eta\,dx=0 har η\eta ke liye. Fundamental Lemma kehta hai: agar yeh sab η\eta ke liye zero hai, toh bracket khud hi zero hoga. Bas — yahi Euler–Lagrange equation hai.

Yeh kyun matter karta hai? Kyunki Newton ka F=maF=ma, geodesics, optics ka Fermat's principle — sab isi ek equation se nikalte hain. Ek important galti: ddxLy\frac{d}{dx}\frac{\partial L}{\partial y'} ko mat cancel karo Ly\frac{\partial L}{\partial y'} se — woh total derivative hai, chain rule se teen terms deta hai. Aur agar LL mein xx explicitly nahi hai toh Beltrami identity (LyLy=L-y'\frac{\partial L}{\partial y'}= const) use karke kaam aasaan ho jaata hai.

Go deeper — visual, from zero

Test yourself — Advanced Topics (Elite Level)

Connections