Skip to content

Calculus of Variations

Calculus of variations studies functions that make a functional stationary. A functional is a map whose input is a function and whose output is a number. The standard example is an action

S[q]=∫titfL(q,q˙,t) dt,S[q]=\int_{t_i}^{t_f}L(q,\dot q,t)\,dt,

where the input is a path q(t)q(t).

The central question is:

How does a quantity such as S[q]S[q] change when the whole path q(t)q(t) is varied?

In physics, this question produces Euler–Lagrange equations, stationary-action principles, variational approximations, and the semiclassical logic behind path integrals. For the mechanics-focused version of the same ideas, see Lagrangian Mechanics Review.

A functional assigns a number to a function. For a single real function y(x)y(x), a common form is

J[y]=∫abF(x,y(x),y′(x)) dx.J[y] = \int_a^b F(x,y(x),y'(x))\,dx.

Here FF is an ordinary function of three arguments, but JJ depends on the entire curve y(x)y(x). The value of J[y]J[y] can change even if yy is perturbed only on a small part of the interval.

Examples include:

  • arc length of a curve;
  • classical action of a path;
  • energy expectation as a function of a trial wavefunction;
  • energy functionals in mean-field and density-functional approximations;
  • Euclidean action functionals in instanton and statistical-mechanics problems.

Choose a trial curve y(x)y(x) and perturb it by a small function η(x)\eta(x):

yϵ(x)=y(x)+ϵη(x).y_\epsilon(x)=y(x)+\epsilon\eta(x).

For fixed-endpoint variations,

η(a)=η(b)=0.\eta(a)=\eta(b)=0.

The first variation is the coefficient of ϵ\epsilon in

J[y+ϵη]−J[y].J[y+\epsilon\eta]-J[y].

Equivalently,

δJ[y;η]=ddϵJ[y+ϵη]∣ϵ=0.\delta J[y;\eta] = \left. \frac{d}{d\epsilon} J[y+\epsilon\eta] \right\rvert_{\epsilon=0}.

A curve is stationary when

δJ[y;η]=0\delta J[y;\eta]=0

for all allowed variations η\eta.

For

J[y]=∫abF(x,y,y′) dx,J[y] = \int_a^b F(x,y,y')\,dx,

the first variation is

δJ=∫ab(∂F∂yη+∂F∂y′η′) dx.\delta J = \int_a^b \left( \frac{\partial F}{\partial y}\eta + \frac{\partial F}{\partial y'}\eta' \right)\,dx.

Integrate the second term by parts:

∫ab∂F∂y′η′ dx=[∂F∂y′η]ab−∫abddx(∂F∂y′)η dx.\int_a^b \frac{\partial F}{\partial y'}\eta'\,dx = \left[ \frac{\partial F}{\partial y'}\eta \right]_a^b - \int_a^b \frac{d}{dx} \left( \frac{\partial F}{\partial y'} \right)\eta\,dx.

For fixed endpoints, the boundary term vanishes. Therefore

δJ=∫ab[∂F∂y−ddx(∂F∂y′)]η dx.\delta J = \int_a^b \left[ \frac{\partial F}{\partial y} - \frac{d}{dx} \left( \frac{\partial F}{\partial y'} \right) \right]\eta\,dx.

If this is zero for every allowed η\eta, the bracket must vanish:

∂F∂y−ddx(∂F∂y′)=0.\frac{\partial F}{\partial y} - \frac{d}{dx} \left( \frac{\partial F}{\partial y'} \right) =0.

This is the Euler–Lagrange equation.

For a particle with coordinate q(t)q(t),

L(q,q˙,t)=12mq˙2−V(q).L(q,\dot q,t) = \frac12m\dot q^2-V(q).

The Euler–Lagrange equation is

∂L∂q−ddt(∂L∂q˙)=0.\frac{\partial L}{\partial q} - \frac{d}{dt} \left( \frac{\partial L}{\partial\dot q} \right) =0.

Since

∂L∂q=−dVdq,∂L∂q˙=mq˙,\frac{\partial L}{\partial q} = -\frac{dV}{dq}, \qquad \frac{\partial L}{\partial\dot q} = m\dot q,

one obtains

mq¨=−dVdq.m\ddot q=-\frac{dV}{dq}.

Newton’s equation appears as the stationary-action equation for the path.

For coordinates qi(t)q^i(t), the action

S[q]=∫L(qi,q˙i,t) dtS[q] = \int L(q^i,\dot q^i,t)\,dt

gives one Euler–Lagrange equation for each coordinate:

∂L∂qi−ddt(∂L∂q˙i)=0.\frac{\partial L}{\partial q^i} - \frac{d}{dt} \left( \frac{\partial L}{\partial \dot q^i} \right) =0.

For a field ϕ(x)\phi(x) with Lagrangian density L(ϕ,∂μϕ,x)\mathcal L(\phi,\partial_\mu\phi,x), the field-theory version is

∂L∂ϕ−∂μ(∂L∂(∂μϕ))=0.\frac{\partial\mathcal L}{\partial\phi} - \partial_\mu \left( \frac{\partial\mathcal L} {\partial(\partial_\mu\phi)} \right) =0.

This page only needs the structure. The compact derivative notation δS/δϕ(x)=0\delta S/\delta\phi(x)=0 is explained in Functional Derivatives. The full field-theory use belongs in QFT-facing material, but quantum-mechanical path integrals already use the same stationary-action idea.

If endpoints are not fixed, the boundary term

[∂F∂y′η]ab\left[ \frac{\partial F}{\partial y'}\eta \right]_a^b

does not vanish automatically. Stationarity then requires either:

  • restrictions on the allowed endpoint variations;
  • boundary conditions that make the boundary term vanish;
  • additional endpoint terms in the functional.

This is the variational origin of many natural boundary conditions. In quantum mechanics, boundary terms also appear when checking whether differential operators are symmetric or self-adjoint after integration by parts.

Often one wants to make J[y]J[y] stationary subject to a constraint

C[y]=c.C[y]=c.

Introduce a multiplier λ\lambda and vary

J~[y]=J[y]−λC[y].\widetilde J[y] = J[y]-\lambda C[y].

Stationarity gives an equation of the form

δJ=λ δC.\delta J=\lambda\,\delta C.

The multiplier is determined together with the extremizing function and the constraint.

This pattern is central in quantum mechanics. Extremizing the energy expectation while keeping the state normalized gives an eigenvalue equation. In a finite-dimensional Hilbert space, vary

F[ψ]=⟨ψ∣H∣ψ⟩−E(⟨ψ∣ψ⟩−1).\mathcal F[\psi] = \langle\psi\rvert H\lvert\psi\rangle - E \left( \langle\psi\rvert\psi\rangle-1 \right).

Stationarity with respect to ⟨ψ∣\langle\psi\rvert gives

H∣ψ⟩=E∣ψ⟩.H\lvert\psi\rangle=E\lvert\psi\rangle.

Thus the eigenvalue equation can be read as a constrained variational equation. The physical upper-bound use of this idea is Variational Principle, and finite-dimensional implementation is Rayleigh–Ritz Method.

A stationary point is a point where the first variation vanishes. It may be a minimum, maximum, or saddle. Classical action principles usually give stationary paths, not necessarily paths that minimize the action.

For energy variational calculations, the ground-state Rayleigh quotient has a minimum under suitable assumptions, which is why it gives an upper bound. Excited states and real-time actions are more subtle; saddle points are common.

Second variations, convexity, and spectral stability decide whether a stationary point is actually a minimum. Those refinements matter in stability analysis, instantons, and fluctuation determinants.

Path integrals weight histories by

eiS[q]/ℏ.e^{iS[q]/\hbar}.

When the action is large compared with ℏ\hbar, rapidly oscillating phases cancel except near stationary-action paths. This is the stationary-phase route from quantum amplitudes to classical equations of motion.

The conceptual bridge is treated in Why Path Integrals?. The Toolkit role of this page is to explain what “stationary action” mathematically means.

  • Saying “least action” when the action is only stationary.
  • Dropping boundary terms without checking the allowed variations.
  • Varying a function but forgetting that its derivative varies too.
  • Treating constraints as optional after normalization has been imposed.
  • Confusing a variational parameter derivative with a full functional variation.
  • Assuming a stationary point is automatically stable.
  • Ignoring domain and boundary conditions when applying variational arguments to differential operators.
  • I. M. Gelfand and S. V. Fomin, Calculus of Variations, Dover, 2000.
  • H. Goldstein, C. Poole, and J. Safko, Classical Mechanics, 3rd ed., Addison-Wesley, 2002.
  • G. B. Arfken, H. J. Weber, and F. E. Harris, Mathematical Methods for Physicists, 7th ed., Academic Press, 2013.
  • L. D. Landau and E. M. Lifshitz, Mechanics, 3rd ed., Butterworth-Heinemann, 1976.
  • R. Shankar, Principles of Quantum Mechanics, 2nd ed., Springer, 1994.
  1. Derive the Euler–Lagrange equation for
J[y]=∫abF(x,y,y′) dxJ[y] = \int_a^b F(x,y,y')\,dx

with fixed endpoints.

Solution

Use yϵ=y+ϵηy_\epsilon=y+\epsilon\eta with η(a)=η(b)=0\eta(a)=\eta(b)=0. Then

δJ=∫ab(Fyη+Fy′η′)dx.\delta J = \int_a^b \left( F_y\eta+F_{y'}\eta' \right)dx.

Integrating the second term by parts gives

δJ=[Fy′η]ab+∫ab(Fy−ddxFy′)η dx.\delta J = \left[F_{y'}\eta\right]_a^b + \int_a^b \left( F_y-\frac{d}{dx}F_{y'} \right)\eta\,dx.

The boundary term vanishes, and η\eta is arbitrary, so

Fy−ddxFy′=0.F_y-\frac{d}{dx}F_{y'}=0.
  1. Apply the Euler–Lagrange equation to
J[y]=∫ab12(y′)2 dxJ[y]=\int_a^b \frac12(y')^2\,dx

with fixed endpoints.

Solution

Here F=(1/2)(y′)2F=(1/2)(y')^2, so

∂F∂y=0,∂F∂y′=y′.\frac{\partial F}{\partial y}=0, \qquad \frac{\partial F}{\partial y'}=y'.

The Euler–Lagrange equation gives

−ddxy′=0,-\frac{d}{dx}y'=0,

or y′′=0y''=0. Thus the stationary curves are straight lines,

y(x)=Ax+B,y(x)=Ax+B,

with AA and BB fixed by the endpoint values.

  1. Use a Lagrange multiplier to show that stationary normalized states of ⟨ψ∣H∣ψ⟩\langle\psi\rvert H\lvert\psi\rangle satisfy an eigenvalue equation.
Solution

Vary

F[ψ]=⟨ψ∣H∣ψ⟩−E(⟨ψ∣ψ⟩−1).\mathcal F[\psi] = \langle\psi\rvert H\lvert\psi\rangle - E \left( \langle\psi\rvert\psi\rangle-1 \right).

The variation with respect to ⟨ψ∣\langle\psi\rvert gives

H∣ψ⟩−E∣ψ⟩=0.H\lvert\psi\rangle - E\lvert\psi\rangle =0.

Therefore

H∣ψ⟩=E∣ψ⟩.H\lvert\psi\rangle=E\lvert\psi\rangle.
  1. Why is it unsafe to discard boundary terms automatically?
Solution

Boundary terms vanish only when the allowed variations make them vanish, such as fixed-endpoint variations with η(a)=η(b)=0\eta(a)=\eta(b)=0. If endpoints are free or if the problem has nontrivial boundary conditions, stationarity may impose additional natural boundary conditions or require endpoint terms. Dropping the boundary term without checking the variation changes the problem.