First Variation and Stationarity

Ordinary calculus finds the extrema of f:Rn→Rf:\mathbb{R}^n\to\mathbb{R} by demanding that its differential vanish: df=∇f⋅dx=0\mathrm{d}f=\nabla f\cdot\mathrm{d}x=0 for every displacement dx\mathrm{d}x. The calculus of variations asks the same question one level up, about functionals — machines that eat an entire function y(x)y(x) and return a number J[y]J[y]. The length of a curve, the travel time of a sliding bead, the action of a trajectory: each is a functional, and each physical problem is the demand that its functional be stationary. The first variation makes that demand precise. The construction is disciplined and, once seen, unmistakably ordinary. Embed the candidate yy in a one-parameter family y+εηy+\varepsilon\eta, where η\eta perturbs the whole curve, and watch g(ε)=J[y+εη]g(\varepsilon)=J[y+\varepsilon\eta] as ε\varepsilon sweeps through zero. Because gg is an honest function of one variable, all of single-variable calculus reawakens: the first variation is simply g′(0)g'(0), and stationarity at yy is nothing more than g′(0)=0g'(0)=0 — but now required for every direction η\eta. That word every is the whole engine. In finite dimensions ∇f⋅v=0\nabla f\cdot v=0 for all vv collapses to nn equations ∇f=0\nabla f=0; for functionals, ∫( ⋅ )η dx=0\int(\,\cdot\,)\eta\,\mathrm{d}x=0 for all η\eta forces the bracket to vanish at every interior point — an infinity of conditions packaged as one differential equation (Euler–Lagrange), with the leftover boundary term dictating the boundary conditions. Stationarity, not minimality, is the universal language: Hamilton's principle, geodesics, Fermat's principle, and the brachistochrone are all one statement — some functional has δJ=0\delta J=0.

Key takeaways
  • A functional J[y]J[y] assigns a number to each admissible function yy; the first variation δJ\delta J is the analogue of the differential df\mathrm{d}f for such maps.
  • Formally δJ[y;η]=ddεJ[y+εη]∣ε=0\delta J[y;\eta]=\left.\dfrac{\mathrm{d}}{\mathrm{d}\varepsilon}J[y+\varepsilon\eta]\right|_{\varepsilon=0} — the Gâteaux derivative of JJ at yy along the admissible perturbation η\eta.
  • A function is stationary (an extremal) when δJ[y;η]=0\delta J[y;\eta]=0 for every admissible η\eta; this is df=0\mathrm{d}f=0 lifted to infinite dimensions.
  • For J[y]=∫abF(x,y,y′) dxJ[y]=\int_a^b F(x,y,y')\,\mathrm{d}x one integration by parts gives δJ=∫ab ⁣(Fy−ddxFy′)η dx+[Fy′η]ab\delta J=\int_a^b\!\big(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'}\big)\eta\,\mathrm{d}x+\big[F_{y'}\eta\big]_a^b — a bulk term plus a boundary term.
  • Arbitrariness of η\eta plus the fundamental lemma forces the bulk bracket to zero (Euler–Lagrange); the boundary term yields essential or natural boundary conditions.
  • Stationary is not minimal: δJ=0\delta J=0 locates minima, maxima, and saddles alike, exactly as f′(x)=0f'(x)=0 does; the second variation δ2J\delta^2 J decides which.
  • Key idea: replace the gradient of a function by the first variation of a functional — a function is stationary when δJ[y;η]=0\delta J[y;\eta]=0 for all admissible η\eta, and that arbitrariness is what converts the scalar δJ=0\delta J=0 into a differential equation plus boundary conditions.
The core insight

Replace the gradient of a function by the first variation of a functional: a function is stationary when δJ[y;η]=0\delta J[y;\eta]=0 for every admissible perturbation η\eta, and the arbitrariness of η\eta is exactly what turns one scalar equation δJ=0\delta J=0 into a differential equation plus boundary conditions.

Where this lives today

The first variation is not a museum piece — it is a live computational engine. The finite element method, which simulates aircraft wings, bridges, and beating hearts, is built directly on it: one writes the energy of a structure as a functional, takes its first variation to obtain the "weak form," and discretizes that rather than the raw differential equation. The essential-versus-natural split of Derivation 2 is exactly what a finite-element engineer respects — displacement (essential) conditions are imposed on the trial functions, while traction (natural) conditions emerge from the boundary term, precisely as Fy′=0F_{y'}=0 did above. In optimal control, Pontryagin's maximum principle is the first variation of a cost functional under dynamical constraints, routing spacecraft and training control policies. In general relativity, Einstein's field equations are the statement that the first variation of the Einstein–Hilbert action vanishes, δ ⁣∫R−g d4x=0\delta\!\int R\sqrt{-g}\,\mathrm{d}^4x=0: the same δS=0\delta S=0 Lagrange applied to a sliding bead now shapes spacetime. And the entire Standard Model is one Lagrangian plus the demand of stationary action, the first variation unpacking that single line into every equation of motion. Wherever a system "chooses" a configuration by optimising something, the first variation is how that choice is computed.

The physical picture

Picture the functional JJ as the altitude of a landscape over an infinite-dimensional space whose every point is an entire curve y(x)y(x). To walk away from yy in a direction η\eta is to deform the whole curve into y+εηy+\varepsilon\eta, sliding it continuously as ε\varepsilon grows. The first variation is the slope of that landscape along the chosen direction; stationarity means the ground is dead flat in every direction at once — and because there are infinitely many independent directions, flatness in all of them is an enormously strong condition. The first figure fixes the geometry: a bundle of admissible curves pinned at the same two endpoints, differing only by the variation η\eta that swells and shrinks in between.

Figure
Admissible curves share the fixed endpoints y(a) and y(b); a variation η morphs the extremal into y + εη with η(a) = η(b) = 0. The first variation δJ is the slope of J along η, and stationarity demands δJ = 0 in every such direction.
One functional, infinitely many directions η — stationary means flat along every one x y a b extremal y(x) y + εη εη(x) y(a) y(b) η(a) = η(b) = 0 at the pinned ends

Slice the landscape along a single direction η\eta and the infinite-dimensional problem shrinks to a curve g(ε)=J[y+εη]g(\varepsilon)=J[y+\varepsilon\eta] that ordinary calculus handles at sight: flat to first order (g′(0)=0g'(0)=0) at an extremal, curving up, down, or into a saddle at second order. The second figure draws that slice for a concrete functional whose numbers we pin down exactly, so "the first variation vanishes" becomes an arithmetic fact — a parabola with a horizontal tangent and a definite curvature.

Figure
The one-dimensional slice g(ε) = J evaluated on y+εη, for the functional ∫₀¹ ½y′² dx with extremal y = x and variation η = sin πx. Here g(ε) = 0.5 + (π²/4)ε², so the first variation g′(0) = δJ = 0 and the second variation g″(0) = δ²J = π²/2 ≈ 4.93 > 0 — a genuine minimum.
A slice through the functional: g(ε) = 0.5 + (π²/4)ε², flat at ε = 0 ε g(ε) = J[y+εη] −1 +1 0.5 tangent slope g′(0) = δJ = 0 curvature g″(0) = δ²J = π²/2 ≈ 4.93 g(±1) ≈ 2.97 min at ε = 0, value J[y] = 0.5 — stationary AND minimal here

Why insist on stationary rather than minimal? Because the first-order condition is blind to the sign of the curvature — it cannot tell a valley from a ridge from a mountain pass. The action of a free particle is minimized over short times but only a saddle over long ones, yet the equations of motion are identical. Physics asks only for δJ=0\delta J=0; the character of the extremum is a separate, second-order question.

The core equations

The first variation is defined by freezing the direction η\eta and differentiating with respect to the amplitude ε\varepsilon — the directional (Gâteaux) derivative of JJ, the functional analogue of ∇f⋅v\nabla f\cdot v.

δJ[y;η]  =  ddε J[y+εη]∣ε=0(1)\delta J[y;\eta]\;=\;\left.\frac{\mathrm{d}}{\mathrm{d}\varepsilon}\,J[y+\varepsilon\eta]\right|_{\varepsilon=0} \qquad (1)

where: J[y]J[y] — a functional mapping the function yy to a real number; yy — the candidate (base) function tested for stationarity; η\eta — an admissible variation, a perturbing function of the same class; ε\varepsilon — a real scalar whose ε→0\varepsilon\to0 limit extracts the linear part; δJ[y;η]\delta J[y;\eta] — the first variation, the leading-order change of JJ in the direction η\eta. Expanding JJ in powers of the amplitude names its Taylor tower: the coefficient of ε\varepsilon is the first variation, and the coefficient of ε2\varepsilon^2 is the second variation, which decides the extremum type.

J[y+εη]  =  J[y]  +  ε δJ[y;η]  +  12ε2 δ2J[y;η]  +  O(ε3)(2)J[y+\varepsilon\eta]\;=\;J[y]\;+\;\varepsilon\,\delta J[y;\eta]\;+\;\tfrac{1}{2}\varepsilon^2\,\delta^2 J[y;\eta]\;+\;O(\varepsilon^3) \qquad (2)

where: δ2J\delta^2 J — the second variation, positive for a minimum and negative for a maximum along η\eta; O(ε3)O(\varepsilon^3) — higher-order terms negligible as ε→0\varepsilon\to0. This is the Maclaurin series of g(ε)g(\varepsilon) read term by term. Stationarity is the vanishing of the entire first variation — not for one lucky direction but for all admissible ones at once.

δJ[y;η]  =  0for all admissible η    ⟺    y is stationary(3)\delta J[y;\eta]\;=\;0\quad\text{for all admissible }\eta \;\;\Longleftrightarrow\;\; y\ \text{is stationary} \qquad (3)

where: admissible η\eta — variations smooth enough and respecting the imposed boundary constraints (vanishing where the endpoint value is prescribed). One direction proves nothing; the quantifier "for all" does the work. For the canonical integral functional the chain rule turns the definition into an integral over the two partial derivatives of FF — the raw first variation, before integration by parts.

δJ  =  ∫ab ⁣(∂F∂y η+∂F∂y′ η′) dx(4)\delta J\;=\;\int_a^b\!\Big(\frac{\partial F}{\partial y}\,\eta+\frac{\partial F}{\partial y'}\,\eta'\Big)\,\mathrm{d}x \qquad (4)

where: F(x,y,y′)F(x,y,y') — the integrand, the Lagrangian density; Fy=∂F/∂yF_y=\partial F/\partial y — partial derivative holding x,y′x,y' fixed; Fy′=∂F/∂y′F_{y'}=\partial F/\partial y' — partial derivative with respect to the slope; η′=dη/dx\eta'=\mathrm{d}\eta/\mathrm{d}x. The two terms track how FF responds to shifting the height yy and the slope y′y'. Integrating the η′\eta' term by parts factors out a common η\eta and exiles the leftover to the endpoints — the master formula of the whole subject, from which every Euler–Lagrange equation and boundary condition falls out.

δJ  =  ∫ab ⁣(∂F∂y−ddx∂F∂y′)η dx  +  [∂F∂y′ η]ab(5)\delta J\;=\;\int_a^b\!\Big(\frac{\partial F}{\partial y}-\frac{\mathrm{d}}{\mathrm{d}x}\frac{\partial F}{\partial y'}\Big)\eta\,\mathrm{d}x\;+\;\Big[\frac{\partial F}{\partial y'}\,\eta\Big]_a^b \qquad (5)

where: ddxFy′\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'} — total derivative along the curve, accounting for the xx, y(x)y(x), y′(x)y'(x) dependence of Fy′F_{y'}; [ ⋅ ]ab[\,\cdot\,]_a^b — the boundary term at the two endpoints. The bulk integrand is what the fundamental lemma acts on; the bracket is the seed of the boundary conditions. When the endpoints are pinned the boundary term dies, and the arbitrariness of η\eta forces the bracket in (5)(5) to vanish pointwise — the Euler–Lagrange equation every extremal obeys.

∂F∂y−ddx∂F∂y′=0(6)\frac{\partial F}{\partial y}-\frac{\mathrm{d}}{\mathrm{d}x}\frac{\partial F}{\partial y'}=0 \qquad (6)

where: the equation holds at every interior point x∈(a,b)x\in(a,b) for a stationary yy. It is generally second order, its two constants fixed by the boundary data. When the integrand carries no explicit xx, the Euler–Lagrange equation has an automatic first integral — the Beltrami identity — lowering the order by one before any solving begins.

∂F∂x=0    ⟹    F−y′ ∂F∂y′=const(7)\frac{\partial F}{\partial x}=0 \;\;\Longrightarrow\;\; F-y'\,\frac{\partial F}{\partial y'}=\text{const} \qquad (7)

where: the constant is fixed by one boundary condition. This is the variational shadow of energy conservation — xx-translation symmetry of FF produces a conserved quantity, a baby Noether theorem. For a vector-valued curve y=(y1,…,yn)y=(y_1,\dots,y_n) the same steps give one equation Fyi−ddxFyi′=0F_{y_i}-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y_i'}=0 per component, since the components of η\eta are independently arbitrary.

Derivation AFrom stationarity to the Euler-Lagrange equation

This is the flagship calculation of the calculus of variations, and every later structure inherits from it: take the fixed-endpoint problem J[y]=∫abF(x,y,y′) dxJ[y]=\int_a^b F(x,y,y')\,\mathrm{d}x with y(a)y(a) and y(b)y(b) prescribed, compute its first variation from the definition, impose stationarity, and let the arbitrariness of the variation collapse a single scalar equation into a pointwise differential equation via the fundamental lemma. The Euler–Lagrange equation then appears as the forced consequence of demanding flatness in every direction, not a formula to memorise. The boxed result is Fy−ddxFy′=0F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'}=0.

Step 1. Form g(ε)=∫abF(x, y+εη, y′+εη′) dxg(\varepsilon)=\int_a^b F(x,\,y+\varepsilon\eta,\,y'+\varepsilon\eta')\,\mathrm{d}x and differentiate under the integral sign at ε=0\varepsilon=0, legitimate because FF is smooth and the interval is fixed. Why: this reduces an infinite-dimensional derivative to an ordinary one-variable derivative — the move that makes the subject tractable.

Step 2. Apply the chain rule: since ∂(y+εη)/∂ε=η\partial(y+\varepsilon\eta)/\partial\varepsilon=\eta and ∂(y′+εη′)/∂ε=η′\partial(y'+\varepsilon\eta')/\partial\varepsilon=\eta', evaluating at ε=0\varepsilon=0 gives δJ=∫ab(Fy η+Fy′ η′) dx\delta J=\int_a^b(F_y\,\eta+F_{y'}\,\eta')\,\mathrm{d}x. Why: this exposes the two channels through which the deformation feeds into FF — height and slope — and is exactly equation (4)(4).

Step 3. Integrate the second term by parts with u=Fy′u=F_{y'}, dv=η′ dx\mathrm{d}v=\eta'\,\mathrm{d}x: ∫abFy′η′ dx=[Fy′η]ab−∫ab(ddxFy′)η dx\int_a^b F_{y'}\eta'\,\mathrm{d}x=[F_{y'}\eta]_a^b-\int_a^b(\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'})\eta\,\mathrm{d}x, so δJ=∫ab(Fy−ddxFy′)η dx+[Fy′η]ab\delta J=\int_a^b(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'})\eta\,\mathrm{d}x+[F_{y'}\eta]_a^b. Why: shifting the derivative off η′\eta' onto Fy′F_{y'} makes η\eta a common factor — the only way the fundamental lemma can later be applied.

Step 4. Impose the fixed-endpoint conditions: admissible variations may not disturb the prescribed values, so η(a)=η(b)=0\eta(a)=\eta(b)=0 and the boundary term [Fy′η]ab[F_{y'}\eta]_a^b vanishes. Why: this is where the essential boundary conditions enter and remove the boundary term, leaving a pure bulk integral.

Step 5. Set δJ=0\delta J=0 for all such η\eta: ∫ab(Fy−ddxFy′)η dx=0\int_a^b(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'})\eta\,\mathrm{d}x=0 for every continuous η\eta vanishing at the ends. By the fundamental lemma the bracket must vanish at every interior point, giving Fy−ddxFy′=0F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'}=0. Why: a continuous function that integrates to zero against every test function must itself be zero — the mechanism that turns one scalar equation into an infinity of pointwise ones. *Verified: reproduces the standard Euler–Lagrange derivation in Stone & Goldbart §1.2, Arfken & Weber Ch. 22, and Gelfand & Fomin §3.*

Go deeper · Derivation B · 1 minThe natural boundary condition from a free endpoint
Derivation BThe natural boundary condition from a free endpoint

When an endpoint is not held fixed, the boundary term in the master formula can no longer be discarded, and its survival forces a condition on Fy′F_{y'} at that end — a condition the problem chooses for itself rather than one imposed by hand, which is why it is called natural. Running the same machinery with a free right endpoint, while tracking which part of the arbitrariness of η\eta enforces the interior equation and which enforces the boundary equation, makes the essential-versus-natural split transparent. Take y(a)y(a) prescribed but y(b)y(b) free, so η(a)=0\eta(a)=0 while η(b)\eta(b) ranges freely. The boxed result is Fy′∣x=b=0F_{y'}\big|_{x=b}=0.

Step 1. Write the master formula with the boundary term expanded at each end: δJ=∫ab(Fy−ddxFy′)η dx+Fy′(b) η(b)−Fy′(a) η(a)\delta J=\int_a^b(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'})\eta\,\mathrm{d}x+F_{y'}(b)\,\eta(b)-F_{y'}(a)\,\eta(a). Why: keeping the endpoints separate is essential once they carry different constraints.

Step 2. Drop the fixed end using η(a)=0\eta(a)=0: δJ=∫ab(Fy−ddxFy′)η dx+Fy′(b) η(b)\delta J=\int_a^b(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'})\eta\,\mathrm{d}x+F_{y'}(b)\,\eta(b). Why: the prescribed left value kills its boundary contribution, isolating the free-endpoint physics on the right.

Step 3. Exploit the arbitrariness in stages. First restrict to variations that also vanish at bb: these see only the integral, and the fundamental lemma forces the interior bracket to zero — the Euler–Lagrange equation still holds. Why: the extremal obeys the same interior equation regardless of the free end, so the bulk term is settled first.

Step 4. With the integral now zero, the remaining requirement is Fy′(b) η(b)=0F_{y'}(b)\,\eta(b)=0 for all η(b)\eta(b); since η(b)\eta(b) is unconstrained, its coefficient must vanish: Fy′(b)=0F_{y'}(b)=0. Why: an arbitrary nonzero multiplier is annihilated only if its coefficient is zero — the natural, Neumann-type condition the variational principle supplies for free. *Verified: matches the treatment of natural boundary conditions in Gelfand & Fomin §6 and Riley, Hobson & Bence Ch. 22.*

Go deeper · Derivation C · 1 minThe Beltrami first integral when the integrand hides x
Derivation CThe Beltrami first integral when the integrand hides x

Many of the classic variational problems — geodesics, the brachistochrone, the catenary, minimal surfaces of revolution — share the feature that their integrand FF depends on yy and y′y' but not explicitly on xx. In exactly that case the Euler–Lagrange equation, normally second order, admits a first integral that reduces it to first order before any real integration is attempted. The aim is to derive that shortcut directly from the Euler–Lagrange equation and recognise it as the variational form of energy conservation under translation of the independent variable. The boxed result is F−y′Fy′=constF-y'F_{y'}=\text{const}.

Step 1. Take the total xx-derivative of F−y′Fy′F-y'F_{y'}, using the chain rule on F=F(y,y′)F=F(y,y'): ddx(F−y′Fy′)=Fyy′+Fy′y′′−y′′Fy′−y′ddxFy′\tfrac{\mathrm{d}}{\mathrm{d}x}(F-y'F_{y'})=F_y y'+F_{y'}y''-y''F_{y'}-y'\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'}. Why: this combination is engineered so the y′′y'' terms cancel, leaving something proportional to the Euler–Lagrange expression.

Step 2. Cancel the two y′′Fy′y''F_{y'} terms and factor: ddx(F−y′Fy′)=y′(Fy−ddxFy′)\tfrac{\mathrm{d}}{\mathrm{d}x}(F-y'F_{y'})=y'\big(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'}\big). Why: the derivative has collapsed onto the Euler–Lagrange bracket, so a stationary curve makes the right-hand side vanish.

Step 3. On an extremal the bracket is zero, hence F−y′Fy′=constF-y'F_{y'}=\text{const}. Why: a quantity with zero derivative along the curve is conserved — Noether's theorem in miniature, with xx-translation symmetry producing the "Hamiltonian" y′Fy′−Fy'F_{y'}-F. *Verified: the Beltrami identity as given in Arfken & Weber Ch. 22 and Lanczos, The Variational Principles of Mechanics; it reproduces the cycloid for the brachistochrone and the catenary for the minimal surface of revolution.*

Limiting cases

The first variation specializes cleanly whenever the problem simplifies — each row is a genuine reduction.

CaseResultMeaning
Finite-dimensional analogueδJ  ⟷  df=∑i∂f∂xi dxi\delta J\;\longleftrightarrow\;\mathrm{d}f=\sum_i \tfrac{\partial f}{\partial x_i}\,\mathrm{d}x_iWhen the function space is just Rn\mathbb{R}^n, the first variation is the ordinary differential and stationarity is ∇f=0\nabla f=0.
Fixed endpointsη(a)=η(b)=0  ⇒  δJ=∫ab ⁣(Fy−ddxFy′)η dx\eta(a)=\eta(b)=0\;\Rightarrow\;\delta J=\int_a^b\!\big(F_y-\tfrac{\mathrm{d}}{\mathrm{d}x}F_{y'}\big)\eta\,\mathrm{d}xThe boundary term drops and stationarity is pure Euler–Lagrange.
Free endpoint[Fy′η]ab=0  ⇒  Fy′∣x=b=0\big[F_{y'}\eta\big]_a^b=0\;\Rightarrow\;F_{y'}\big|_{x=b}=0An unconstrained end forces the natural boundary condition Fy′=0F_{y'}=0 there.
No explicit xx dependence∂xF=0  ⇒  F−y′Fy′=const\partial_x F=0\;\Rightarrow\;F-y'F_{y'}=\text{const}Stationarity admits the Beltrami first integral, lowering the order before solving.
No explicit yy dependence∂yF=0  ⇒  Fy′=const\partial_y F=0\;\Rightarrow\;F_{y'}=\text{const}The Euler–Lagrange equation integrates once immediately: Fy′F_{y'} is conserved (a momentum).

Worked examples

1 · The first variation of a quadratic functional, fully numerical (confidence builder)

Take J[y]=∫0112 y′2 dxJ[y]=\int_0^1 \tfrac12\,y'^2\,\mathrm{d}x on curves with y(0)=0y(0)=0, y(1)=1y(1)=1. Show that y(x)=xy(x)=x is stationary, and use the specific admissible variation η(x)=sin⁡πx\eta(x)=\sin\pi x to compute δJ\delta J and δ2J\delta^2 J explicitly.

Step 1. Here F=12y′2F=\tfrac12 y'^2, so Fy=0F_y=0, Fy′=y′F_{y'}=y', and the Euler–Lagrange equation (6)(6) reads y′′=0y''=0, whose endpoint-matching solution is the straight line y(x)=xy(x)=x with y′=1y'=1.

Step 2. Compute the first variation from equation (4)(4) along η=sin⁡πx\eta=\sin\pi x, admissible since η(0)=η(1)=0\eta(0)=\eta(1)=0. With Fy=0F_y=0 and Fy′=1F_{y'}=1, δJ=∫01η′ dx=∫01πcos⁡πx dx=[sin⁡πx]01=0\delta J=\int_0^1\eta'\,\mathrm{d}x=\int_0^1 \pi\cos\pi x\,\mathrm{d}x=[\sin\pi x]_0^1=0 — δJ=0\delta J=0, confirming stationarity along this direction.

Step 3. Expand the full functional to expose the second variation. With y′=1+εη′y'=1+\varepsilon\eta', J[y+εη]=12∫01(1+2εη′+ε2η′2) dxJ[y+\varepsilon\eta]=\tfrac12\int_0^1(1+2\varepsilon\eta'+\varepsilon^2\eta'^2)\,\mathrm{d}x. The constant term gives J[y]=12J[y]=\tfrac12; the linear term ε∫01η′ dx=0\varepsilon\int_0^1\eta'\,\mathrm{d}x=0; the quadratic term uses ∫01η′2 dx=∫01π2cos⁡2πx dx=π2/2\int_0^1\eta'^2\,\mathrm{d}x=\int_0^1\pi^2\cos^2\pi x\,\mathrm{d}x=\pi^2/2.

Step 4. Assemble: J[y+εη]=12+12ε2⋅π22=0.5+π24ε2J[y+\varepsilon\eta]=\tfrac12+\tfrac12\varepsilon^2\cdot\tfrac{\pi^2}{2}=\mathbf{0.5+\tfrac{\pi^2}{4}\varepsilon^2}. Matching the Taylor form (2)(2), δJ=0\delta J=0 and δ2J=π22≈4.93>0\delta^2 J=\tfrac{\pi^2}{2}\approx\mathbf{4.93>0} — an upward parabola, so the extremal is a genuine local minimum, exactly the curve of the second figure. The straight line is stationary (δJ=0\delta J=0) and here minimal (δ2J>0\delta^2 J>0).

2 · The brachistochrone by Beltrami: recovering the cycloid

A bead slides frictionlessly from the origin to a lower point under gravity gg. The descent time is T[y]=∫0x11+y′22gy dxT[y]=\int_0^{x_1}\sqrt{\dfrac{1+y'^2}{2gy}}\,\mathrm{d}x (yy downward). Find the curve that makes TT stationary.

Step 1. The integrand F=(1+y′2)/(2gy)F=\sqrt{(1+y'^2)/(2gy)} has no explicit xx, so the Beltrami identity (7)(7) applies. With Fy′=y′2gy 1+y′2F_{y'}=\dfrac{y'}{\sqrt{2gy}\,\sqrt{1+y'^2}}, the combination F−y′Fy′=12gy 1+y′2=constF-y'F_{y'}=\dfrac{1}{\sqrt{2gy}\,\sqrt{1+y'^2}}=\text{const}.

Step 2. Square and absorb constants: y (1+y′2)=Cy\,(1+y'^2)=C for a positive CC set by the endpoint. This first-order equation already encodes the whole extremal — Beltrami removed one order of differentiation for free.

Step 3. The substitution y′=cot⁡(θ/2)y'=\cot(\theta/2) turns y(1+y′2)=Cy(1+y'^2)=C into y=C2(1−cos⁡θ)y=\tfrac{C}{2}(1-\cos\theta), and integrating dx=dy/y′\mathrm{d}x=\mathrm{d}y/y' gives x=C2(θ−sin⁡θ)x=\tfrac{C}{2}(\theta-\sin\theta). These are the parametric equations of a cycloid — traced by a point on a rolling circle of radius C/2C/2.

Step 4. The fastest descent is not the straight line but the cycloid, which dives steeply to build speed and flattens near the end — the founding result of the calculus of variations (Johann Bernoulli, 1696), falling out the instant one notices FF has no explicit xx. The brachistochrone is a cycloid, x=C2(θ−sin⁡θ)x=\tfrac{C}{2}(\theta-\sin\theta), y=C2(1−cos⁡θ)y=\tfrac{C}{2}(1-\cos\theta).

3 · A free endpoint chooses its own boundary condition

Minimize J[y]=∫01(12y′2+12y2) dxJ[y]=\int_0^1\big(\tfrac12 y'^2+\tfrac12 y^2\big)\,\mathrm{d}x with y(0)=1y(0)=1 but y(1)y(1) left free. Find the extremal and the condition at x=1x=1.

Step 1. Here F=12y′2+12y2F=\tfrac12 y'^2+\tfrac12 y^2, so Fy=yF_y=y, Fy′=y′F_{y'}=y', and the Euler–Lagrange equation (6)(6) is y′′−y=0y''-y=0 with general solution y(x)=Acosh⁡x+Bsinh⁡xy(x)=A\cosh x+B\sinh x.

Step 2. The fixed left end gives the essential condition y(0)=A=1y(0)=A=1; the free right end lets Derivation 2 supply the natural condition y′(1)=0y'(1)=0.

Step 3. With y′(x)=Asinh⁡x+Bcosh⁡xy'(x)=A\sinh x+B\cosh x, imposing y′(1)=0y'(1)=0 gives sinh⁡1+Bcosh⁡1=0\sinh 1+B\cosh 1=0, so B=−tanh⁡1≈−0.7616B=-\tanh 1\approx-0.7616 and y(x)=cosh⁡x−tanh⁡1 sinh⁡xy(x)=\cosh x-\tanh 1\,\sinh x. The variational principle itself picked the Neumann condition y′(1)=0y'(1)=0 — nothing was imposed there by hand.

Physics of the portrait

The first variation and the very symbol δ\delta are the signature of one mind: born geometrically with Euler, the calculus of variations became an algorithm in the hands of Joseph-Louis Lagrange.

Origins · 1 minJoseph-Louis Lagrange and how this was discovered
JL
Joseph-Louis Lagrange
1736–1813 · founder of the analytic δ-variation method and of analytical mechanics

Lagrange was nineteen when, in 1755, he wrote to Leonhard Euler describing a purely analytic way to attack the extremal problems Euler had been solving with laborious geometric constructions. His idea was to introduce a variation δy\delta y of the unknown function — an infinitesimal change in the whole curve, independent of the change dy\mathrm{d}y along it — manipulated by rules formally parallel to differentiation. This δ\delta-calculus turned the subject from a collection of clever tricks into a machine: write the functional, take its first variation, integrate by parts, set it to zero. Euler was so taken that he set aside his own approach, coined the name "calculus of variations," and delayed publishing so the young Lagrange could receive full credit. In the Mécanique analytique (1788) Lagrange recast all of mechanics as a single variational statement, proudly noting the book contained not one diagram. The stationary-action formulation of physics, the Euler–Lagrange equations, Lagrange multipliers, and the notation δJ\delta J that opens every derivation here are all his — the language in which Hamilton, Jacobi, and eventually field theory and quantum mechanics would be written.

History
1696
— Johann Bernoulli poses the brachistochrone as a public challenge to Europe's mathematicians
1744
— Euler's Methodus inveniendi gives the first general variational (Euler) equation, derived geometrically
1755
— Lagrange sends Euler his analytic δ-method; the calculus of variations becomes an algorithm
1786
— Legendre studies the second variation and its sign as a test for minima
1788
— Lagrange's Mécanique analytique recasts all mechanics as stationary action
1879
— du Bois-Reymond sharpens the fundamental lemma, securing the passage from δJ = 0 to the Euler–Lagrange equation

Going further

Texts. Gelfand & Fomin, Calculus of Variations, §§1–6 (the cleanest modern treatment of the first variation and natural boundary conditions) · Stone & Goldbart, Mathematics for Physics, Ch. 1 · Arfken, Weber & Harris, Mathematical Methods for Physicists, 7th ed., Ch. 22 · Riley, Hobson & Bence, Mathematical Methods for Physics and Engineering, 3rd ed., Ch. 22 · Lanczos, The Variational Principles of Mechanics, Chs. 1–2 · Byron & Fuller, Mathematics of Classical and Quantum Physics, Ch. 2.

Provenance. The definition of the first variation, the master formula, and the natural-boundary-condition derivation follow Gelfand & Fomin §§1–6 and Stone & Goldbart Ch. 1; the Beltrami first integral follows Arfken & Weber Ch. 22 and Lanczos. A verifier should recompute: (i) the chain-rule and integration-by-parts steps yielding the master formula; (ii) worked example 1, confirming δJ=0\delta J=0 and J[y+εη]=0.5+π24ε2J[y+\varepsilon\eta]=0.5+\tfrac{\pi^2}{4}\varepsilon^2 so δ2J=π2/2≈4.93\delta^2 J=\pi^2/2\approx4.93; (iii) that the brachistochrone integral y(1+y′2)=Cy(1+y'^2)=C integrates to the cycloid; (iv) worked example 3, y′′−y=0y''-y=0 with y(0)=1y(0)=1, y′(1)=0y'(1)=0 giving y=cosh⁡x−tanh⁡1 sinh⁡xy=\cosh x-\tanh1\,\sinh x. No numerical constants are asserted beyond standard textbook results.

Prerequisites. Functionals and Function Spaces · Multivariable calculus and directional derivatives · Integration by parts. Leads to. Fundamental Lemma of the Calculus of Variations · Euler–Lagrange Equation · Natural and Essential Boundary Conditions · Hamilton's Principle of Stationary Action.

Ask the tutor: ask me to work any variational problem end to end — write its first variation, extract the Euler–Lagrange equation and boundary conditions, and test whether the extremal is actually a minimum.

What is the difference between δy and dy?

They point in different directions. The differential dy=y′(x) dx\mathrm{d}y=y'(x)\,\mathrm{d}x measures how the curve changes as you move along it. The variation δy=εη(x)\delta y=\varepsilon\eta(x) measures how it changes when you swap it for a different curve at the same xx — a vertical shift of the whole graph. Lagrange's insight was that δ\delta obeys the same formal rules as d\mathrm{d} (it commutes with differentiation, δy′=(δy)′\delta y'=(\delta y)', and with integration), so variations can be manipulated algebraically. Keeping the two straight is the single most important habit in the subject: d\mathrm{d} moves you along one curve, δ\delta moves you between curves.

Why must the variation η vanish at fixed endpoints?

Because an admissible variation may not violate the constraints that define the problem. If y(a)y(a) and y(b)y(b) are prescribed, every competing curve passes through those same two points, so the difference from the base curve — which is εη\varepsilon\eta — must be zero there, giving η(a)=η(b)=0\eta(a)=\eta(b)=0. This is not a convenience; it encodes the physical statement that the endpoints are held. Relax an endpoint and η\eta there becomes free, the boundary term survives, and it hands you a natural boundary condition in exchange. So "where is η\eta forced to vanish?" is really "which boundary data are prescribed?".

Is the fundamental lemma really necessary, or is it obvious?

It feels obvious but genuinely needs proof, and the proof is where the rigour lives. The claim: if a continuous h(x)h(x) satisfies ∫abh η dx=0\int_a^b h\,\eta\,\mathrm{d}x=0 for every smooth η\eta vanishing at the ends, then h≡0h\equiv0 on (a,b)(a,b). The proof is constructive — if h(x0)>0h(x_0)>0 somewhere, build a "bump" η\eta positive only near x0x_0, and the integral is strictly positive, a contradiction. Without this lemma the leap from "δJ=0\delta J=0 for all η\eta" to "the bracket vanishes pointwise" — the leap that produces Euler–Lagrange — would be unjustified.

Does δJ = 0 guarantee a solution exists or is unique?

No, and this is a common overreach. The first variation is a necessary condition on any smooth extremal; it says nothing about whether an extremal exists, is unique, or is even smooth. Famous functionals (Weierstrass's examples, the Lavrentiev phenomenon) have no minimizer, or minimizers the Euler–Lagrange equation cannot see because they are not differentiable. Establishing existence is the province of the direct method, which uses lower-semicontinuity and compactness rather than δJ\delta J. So δJ=0\delta J=0 narrows the search to critical points; it does not promise the hunt succeeds.

How does the first variation reduce to ordinary calculus?

Parametrise the curve by finitely many numbers and the functional collapses to an ordinary function. If yy is represented by coefficients c1,…,cnc_1,\dots,c_n (amplitudes in a finite basis), then J[y]J[y] becomes a plain f(c1,…,cn)f(c_1,\dots,c_n) and the first variation becomes its differential df=∑i(∂f/∂ci) dci\mathrm{d}f=\sum_i(\partial f/\partial c_i)\,\mathrm{d}c_i; stationarity is exactly ∇f=0\nabla f=0. This is the literal content of the Ritz and Galerkin methods, which approximate a variational problem by a finite-dimensional one and solve ∇f=0\nabla f=0 numerically — the calculus of variations is multivariable calculus taken to infinitely many coordinates.

Why is the physical principle "stationary action" and not "least action"?

Because nature only enforces the first-order condition δS=0\delta S=0, which is agnostic about curvature. The principle was named "least action" (Maupertuis, Euler) in an era that assumed nature economises, and for many short-time problems the action is indeed minimized. But the general statement is stationarity: the physical trajectory is a critical point, and it can be a saddle. For a harmonic oscillator over a time longer than half a period the true path is no longer a minimum, yet it still satisfies the equations of motion, because those come from δS=0\delta S=0 alone. "Least action" is safe shorthand only once you have checked the second variation.

Before this

Where this leads