Calculus of Variations

⚡ Key Takeaways

Calculus of Variations is the branch of mathematics that finds functions which minimize or maximize integral quantities (functionals). Key result: a function extremizing ∫abL(x,y,y′) dx\int_a^b L(x,y,y')\,dx must satisfy the Euler–Lagrange equation ∂L∂y−ddx∂L∂y′=0\frac{\partial L}{\partial y} - \frac{d}{dx}\frac{\partial L}{\partial y'} = 0. Applies to: mechanics, optics, geometry (geodesics), economics, control theory. Origins: Bernoulli's brachistochrone (1696), formalized by Euler (1744) and Lagrange (1755).

💡 The Core Insight

To find the function that extremizes a functional, perturb it slightly and demand that the first-order change vanishes — exactly as f′(x)=0f'(x)=0 at an ordinary extremum. The perturbation is an arbitrary function η(x)\eta(x), and demanding zero first variation for all η\eta forces a local condition at every point: the Euler–Lagrange equation. The whole subject is the differential calculus of f′(x)=0f'(x)=0 lifted to infinite dimensions.

Formal Statement

DefinitionFunctional and the Basic Problem

A functional JJ maps functions to real numbers. The classical (fixed-endpoint) problem is to extremize

1
J[y]=∫abL(x, y(x), y′(x)) dx\quad J[y] = \int_a^b L\big(x,\,y(x),\,y'(x)\big)\,dx

Derivation hint: LL is the <strong>Lagrangian</strong> (integrand); y(x)y(x) is the unknown curve with prescribed endpoints y(a)=yay(a)=y_a, y(b)=yby(b)=y_b; y′=dy/dxy'=dy/dx. The admissible class is y∈C2[a,b]y \in C^2[a,b] satisfying the boundary conditions. The symbols are:

  • xx — independent variable;
  • yy — the function to be determined;
  • y′y' — its derivative;
  • L(x,y,y′)L(x,y,y') — a given smooth function of three arguments.
DefinitionFirst Variation

Replace yy by y+εηy+\varepsilon\eta where η(a)=η(b)=0\eta(a)=\eta(b)=0 and ε∈R\varepsilon\in\mathbb{R}. The first variation is

2
δJ=ddεJ[y+εη]∣ε=0\quad \delta J = \left.\frac{d}{d\varepsilon}J[y+\varepsilon\eta]\right|_{\varepsilon=0}

Derivation hint: differentiate J[y+εη]J[y+\varepsilon\eta] under the integral sign and set ε=0\varepsilon=0; this is the directional derivative of JJ in the "direction" η\eta. A function yy is a stationary point (extremal) of JJ if δJ=0\delta J = 0 for every admissible η\eta.

TheoremEuler–Lagrange Equation

If y∈C2[a,b]y\in C^2[a,b] extremizes J[y]=∫abL(x,y,y′) dxJ[y]=\int_a^b L(x,y,y')\,dx among functions with fixed endpoints, then yy satisfies

3
∂L∂y−ddx ⁣(∂L∂y′)=0\quad \frac{\partial L}{\partial y} - \frac{d}{dx}\!\left(\frac{\partial L}{\partial y'}\right) = 0

Derivation hint: set the first variation to zero, integrate the η′\eta' term by parts, then invoke the fundamental lemma since η\eta is arbitrary.

TheoremBeltrami Identity — Autonomous Case

If LL does not depend explicitly on xx (i.e. ∂L/∂x=0\partial L/\partial x = 0), then any extremal satisfies the first integral

4
L−y′ ∂L∂y′=C\quad L - y'\,\frac{\partial L}{\partial y'} = C

Derivation hint: compute ddx(L−y′ Ly′)\frac{d}{dx}\big(L - y'\,L_{y'}\big), substitute the Euler–Lagrange equation, and observe the result is ∂L/∂x=0\partial L/\partial x = 0, so the bracket is constant CC.

Why It Holds / Derivation

ProofDeriving the Euler–Lagrange Equation

Step 1 — Embed in a family. Suppose yy is an extremal. Form Y(x,ε)=y(x)+εη(x)Y(x,\varepsilon)=y(x)+\varepsilon\eta(x) with η∈C2\eta\in C^2, η(a)=η(b)=0\eta(a)=\eta(b)=0. Define Φ(ε)=J[Y]=∫abL(x,Y,Y′) dx\Phi(\varepsilon)=J[Y]=\int_a^b L(x,Y,Y')\,dx. Since yy is stationary, Φ\Phi has an extremum at ε=0\varepsilon=0, so Φ′(0)=0\Phi'(0)=0.

Step 2 — Differentiate under the integral. By the chain rule,

5
Φ′(0)=∫ab(∂L∂y η+∂L∂y′ η′)dx=0\quad \Phi'(0)=\int_a^b\left(\frac{\partial L}{\partial y}\,\eta + \frac{\partial L}{\partial y'}\,\eta'\right)dx = 0

Derivation hint: ∂Y/∂ε=η\partial Y/\partial\varepsilon=\eta and ∂Y′/∂ε=η′\partial Y'/\partial\varepsilon=\eta'; evaluate partials of LL at ε=0\varepsilon=0.

Step 3 — Integrate by parts. For the second term,

6
∫ab∂L∂y′ η′ dx=[∂L∂y′ η]ab−∫abη ddx ⁣(∂L∂y′)dx\quad \int_a^b \frac{\partial L}{\partial y'}\,\eta'\,dx = \left[\frac{\partial L}{\partial y'}\,\eta\right]_a^b - \int_a^b \eta\,\frac{d}{dx}\!\left(\frac{\partial L}{\partial y'}\right)dx

Derivation hint: standard integration by parts with u=∂L/∂y′u=\partial L/\partial y', dv=η′ dxdv=\eta'\,dx.

Step 4 — Kill the boundary term. Because η(a)=η(b)=0\eta(a)=\eta(b)=0, the bracket vanishes. Combining,

7
∫abη(x)[∂L∂y−ddx∂L∂y′]dx=0\quad \int_a^b \eta(x)\left[\frac{\partial L}{\partial y}-\frac{d}{dx}\frac{\partial L}{\partial y'}\right]dx = 0

Derivation hint: substitute [6] into [5] and factor out η\eta.

Step 5 — Apply the fundamental lemma. Since η\eta is arbitrary (subject only to vanishing endpoints), the bracketed quantity must vanish identically; otherwise choose η\eta matching its sign to make the integral positive. Hence

8
∂L∂y−ddx∂L∂y′=0.■\quad \frac{\partial L}{\partial y}-\frac{d}{dx}\frac{\partial L}{\partial y'}=0. \qquad\blacksquare

Derivation hint: this is the <strong>fundamental lemma of the calculus of variations</strong> — a continuous function whose weighted integral against all such η\eta is zero must be identically zero.

∎
mathematician · Leonhard Euler | 1707–1783

Euler systematized the subject in his 1744 treatise Methodus inveniendi lineas curvas maximi minimive proprietate gaudentes, deriving the central equation by a discretization argument (replacing the curve with a polygon and taking a limit). The elegant variational derivation came from the young Joseph-Louis Lagrange, whose 1755 letter to Euler introduced the δ\delta-operator and the perturbation method used today. Euler graciously named the field after Lagrange's method, and the resulting equation bears both names.

Building Intuition

🧠 Intuition

Think of the functional J[y]J[y] as a landscape sitting over an infinite-dimensional space whose "points" are entire curves. At a minimizing curve the landscape is flat in every direction — and the directions are precisely the perturbations η(x)\eta(x). Demanding flatness in all directions at once is far stronger than in finite dimensions, and that overdetermination is what crushes the problem down to a pointwise differential equation. The boundary term in the integration by parts is "the gradient leaking out the ends"; fixing the endpoints with η(a)=η(b)=0\eta(a)=\eta(b)=0 plugs the leak. When the endpoints are free, that leaked term cannot be dropped and instead yields natural boundary conditions Ly′=0L_{y'}=0 at the ends.

Figure
A curve y(x) and a perturbed competitor y+εη, both pinned at the endpoints
x y a b y(x) extremal y + εη εη(x)

Worked Examples

ExampleShortest Path Between Two Points

Given: Minimize arc length J[y]=∫x1x21+y′2 dxJ[y]=\int_{x_1}^{x_2}\sqrt{1+y'^2}\,dx between (0,0)(0,0) and (4,3)(4,3).

Step 1 — Identify the Lagrangian. L=1+y′2L=\sqrt{1+y'^2}. Note ∂L/∂y=0\partial L/\partial y = 0 and LL has no explicit xx.

Step 2 — Euler–Lagrange. Since ∂L/∂y=0\partial L/\partial y=0, equation [3] gives ddx∂L∂y′=0\frac{d}{dx}\frac{\partial L}{\partial y'}=0, so ∂L∂y′=\frac{\partial L}{\partial y'}= const:

9
y′1+y′2=C\quad \frac{y'}{\sqrt{1+y'^2}}=C

Derivation hint: differentiate LL with respect to y′y' and set it equal to a constant from the conserved-momentum form of E–L.

Step 3 — Solve. This forces y′=y'= const =m=m, hence y=mx+by=mx+b (a straight line). Apply endpoints: b=0b=0, m=3/4m=3/4.

Step 4 — Compute length. J=1+(3/4)2⋅4=25/16⋅4=54⋅4J=\sqrt{1+(3/4)^2}\cdot 4 = \sqrt{25/16}\cdot4 = \tfrac54\cdot4.

y=34x,J=5 units\boxed{y=\tfrac34 x,\qquad J = 5\ \text{units}}
ExampleThe Brachistochrone

Given: A bead slides without friction from (0,0)(0,0) to (x1,y1)(x_1,y_1) under gravity gg. Find the curve minimizing descent time. Measuring yy downward, speed v=2gyv=\sqrt{2gy}, so

10
T[y]=∫0x11+y′22gy dx\quad T[y]=\int_0^{x_1}\frac{\sqrt{1+y'^2}}{\sqrt{2gy}}\,dx

Derivation hint: time =∫ds/v=\int ds/v with ds=1+y′2 dxds=\sqrt{1+y'^2}\,dx and energy conservation 12v2=gy\tfrac12 v^2 = gy.

Step 1 — Autonomous in xx. L=(1+y′2)/(2gy)L=\sqrt{(1+y'^2)/(2gy)} has no explicit xx, so use the Beltrami identity [4]:

11
L−y′∂L∂y′=12gy 1+y′2=C\quad L - y'\frac{\partial L}{\partial y'}=\frac{1}{\sqrt{2gy}\,\sqrt{1+y'^2}}=C

Derivation hint: substitute LL into [4]; the y′y' terms combine over a common denominator 1+y′2\sqrt{1+y'^2}.

Step 2 — Rearrange. This gives y(1+y′2)=ky(1+y'^2)=k where k=1/(2gC2)k=1/(2gC^2) is constant.

Step 3 — Parametrize. Substituting y′=cot⁡(θ/2)y'=\cot(\theta/2) yields the cycloid

x=k2(θ−sin⁡θ),y=k2(1−cos⁡θ)\boxed{x=\tfrac{k}{2}(\theta-\sin\theta),\quad y=\tfrac{k}{2}(1-\cos\theta)}

For a drop to (x1,y1)=(π,2)(x_1,y_1)=(\pi,2) m, one finds k=2k=2 m, θ∈[0,π]\theta\in[0,\pi], giving descent time T=π/g≈1.00T=\pi/\sqrt{g}\approx1.00 s (with g=9.81g=9.81 m/s², T≈1.00T\approx1.00 s).

Common Misconceptions

⚠️ Common mistake

Stationary ≠ minimum. The Euler–Lagrange equation is a necessary condition for an extremum, not sufficient. Its solutions are stationary points; they may be minima, maxima, or saddle points (or none of these). To confirm a minimum you need second-order tests — the second variation δ2J≥0\delta^2 J\ge0, the Legendre condition ∂2L/∂y′2≥0\partial^2 L/\partial y'^2\ge0, and the Jacobi condition (no conjugate points in (a,b)(a,b)). A solution of E–L can fail to be a minimizer if a conjugate point appears.

⚠️ Common mistake

Existence is not guaranteed. Writing down the Euler–Lagrange equation presumes a smooth minimizer exists. Many functionals have no minimizer in the smooth class, or the infimum is not attained. The modern direct method addresses existence separately, requiring coercivity and (sequential weak lower) semicontinuity — properties tied to convexity of LL in y′y'.

CounterexampleWeierstrass's Non-Existence Example

Consider J[y]=∫−11x2 y′2 dxJ[y]=\int_{-1}^{1} x^2\,y'^2\,dx with y(−1)=−1y(-1)=-1, y(1)=1y(1)=1. The infimum is 00 (approached by curves that rise steeply near x=0x=0 where the weight x2x^2 vanishes), but no admissible C1C^1 function attains J=0J=0, since that would require y′=0y'=0 wherever x≠0x\neq0, contradicting the boundary conditions. The Euler–Lagrange equation has solutions, yet the minimization problem has no smooth solution — a famous demonstration that E–L alone settles nothing about existence.

Connections

connection

The calculus of variations is the mathematical engine of Lagrangian mechanics: with L=T−VL=T-V (kinetic minus potential energy), Hamilton's Principle states that physical trajectories extremize the action ∫L dt\int L\,dt, and [3] becomes Newton's laws in disguise. A Legendre transform of LL produces the Hamiltonian and connects to Hamiltonian Mechanics and symplectic geometry. The role of symmetries is captured by Noether's Theorem, which links continuous symmetries of LL to conserved quantities (the Beltrami identity [4] is the special case of time-translation symmetry). When constraints are present, Lagrange Multipliers generalize to isoperimetric and holonomic constraint problems. Replacing one independent variable by several upgrades [3] to a partial differential equation, linking to Partial Differential Equations and the Dirichlet Principle for harmonic functions.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1696 — Johann Bernoulli poses the brachistochrone problem as a public challenge; solutions arrive from Newton, Leibniz, l'Hôpital, and both Bernoullis.
- 1697 — Newton solves it overnight (anonymously), prompting Bernoulli's remark, "I recognize the lion by his claw."
- 1744 — Euler publishes Methodus inveniendi…, the first systematic treatment, deriving the central equation via polygonal approximation.
- 1755 — Lagrange (age 19) writes to Euler introducing the δ\delta-calculus and the perturbation method; the field is named calculus of variations.
- 1786 — Legendre proposes the second-variation sign condition (Ly′y′≥0L_{y'y'}\ge0) for distinguishing minima.
- 1837 — Jacobi develops the theory of conjugate points, completing the second-order sufficiency analysis.
- 1879 — Weierstrass introduces strong variations, the excess function, and rigorous sufficiency conditions; exposes flaws in the naive Dirichlet Principle.
- 1900 — Hilbert's 19th, 20th, and 23rd problems revitalize the field; Hilbert rehabilitates the direct method and the Dirichlet Principle.
- 1915 — Emmy Noether proves her theorem linking variational symmetries to conservation laws.

Subtleties & Limits

open-problem

The leap from finite to infinite dimensions introduces genuine hazards. Regularity: does a minimizer obtained by the direct method possess enough derivatives to satisfy the Euler–Lagrange equation classically? Hilbert's 19th problem (analyticity of minimizers for analytic, convex LL) was settled for scalar problems by De Giorgi and Nash (1957), but partial regularity is the best possible for vector-valued problems — singular sets genuinely occur, and their structure remains an active research frontier. Lavrentiev's phenomenon: the infimum over Lipschitz functions can strictly exceed the infimum over smooth ones, so the choice of admissible class is not innocent. Non-convex functionals may fail to attain their infimum, forcing the machinery of relaxation, Young measures, and quasiconvexity (Morrey) — and deciding whether a given function is quasiconvex is, in general, undecidable in known terms. These issues mean the clean undergraduate story (write E–L, solve) is the surface of a deep and still-developing theory.

See Also

Hamilton's Principle · Euler–Lagrange Equation · Geodesics · Minimal Surfaces · Noether's Theorem · Pontryagin's Maximum Principle · Direct Method in the Calculus of Variations · Brachistochrone Problem