12.1 Functionals and the first variation

A function takes a number and returns a number: f(x)=x2f(x) = x^2. A functional takes a whole function and returns a number. The length of a curve, the time a bead takes to slide down it, the energy stored in a bent beam — each assigns a single number to an entire function y(x)y(x), and each is a functional. The calculus of variations is the calculus of these objects: how to find the function that makes a functional as small (or as large, or as stationary) as possible.

What a functional is

Write a functional with square brackets to distinguish it from a function: J[y]J[y]. The typical form we meet is an integral over the function and its derivative,

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

where FF is an ordinary function of three arguments — the integrand — and the integral turns the whole curve y(x)y(x) on [a,b][a,b] into one number.

where
J[y]J[y]
the functional — a number assigned to the entire function y
F(x,y,y)F(x, y, y')
the integrand: an ordinary function of position, height, and slope
y(x)y(x)
the unknown function (the 'curve') we are free to choose on [a,b]
y(x)=dy/dxy'(x) = dy/dx
its slope

Two examples fix the idea, and both recur through the chapter:

The variational problem

The problem is to find the function y(x)y(x) that makes J[y]J[y] stationary, usually among all functions with fixed endpoints,

y(a)=A,y(b)=B.y(a) = A, \qquad y(b) = B.

The endpoints are pinned; the curve between them is free. This is the exact analogue of ordinary minimisation — but instead of searching a line of candidate numbers xx, we search an infinite-dimensional space of candidate functions. We need the variational version of “set the derivative to zero.”

Perturbing the curve: the first variation

In ordinary calculus, xx^* is a stationary point of ff if ff is unchanged to first order under a small nudge xx+εx^* \to x^* + \varepsilon. Import the idea directly. Suppose y(x)y(x) is the extremal we seek. Perturb it by a small multiple of an arbitrary test function η(x)\eta(x):

y(x)  y(x)+εη(x),η(a)=η(b)=0.y(x)\ \longrightarrow\ y(x) + \varepsilon\,\eta(x), \qquad \eta(a) = \eta(b) = 0.

The condition η(a)=η(b)=0\eta(a) = \eta(b) = 0 keeps the endpoints pinned — every competitor still runs from AA to BB. Now the functional becomes an ordinary function of the single number ε\varepsilon,

Φ(ε)    J[y+εη].\Phi(\varepsilon) \;\equiv\; J[y + \varepsilon\eta].

If yy genuinely extremises JJ, then ε=0\varepsilon = 0 must be a stationary point of Φ\Phi — for every choice of test function η\eta. The first variation δJ\delta J is defined as the first-order change, δJΦ(0)\delta J \equiv \Phi'(0), and the stationarity condition is

  δJ  =  ddεJ[y+εη]ε=0  =  0for all admissible η.  \boxed{\;\delta J \;=\; \frac{d}{d\varepsilon}\,J[y+\varepsilon\eta]\bigg|_{\varepsilon=0} \;=\; 0 \quad\text{for all admissible } \eta.\;}
x →y ↑AB ε →J ↑
J[y] = 1.0924  (excess +0.0924)

Whatever perturbation you add, the length only ever increases: the straight line sits at the bottom of the J(ε) curve, where the first variation δJ = J′(0) = 0. That stationarity condition, imposed for every perturbation, is what the Euler–Lagrange equation solves.

The interactive is the arc-length functional between two fixed points. The straight line is the extremal; the perturbation εsin(nπx)\varepsilon\sin(n\pi x) (which vanishes at both endpoints) bends it. The right panel plots Φ(ε)=J[y+εη]\Phi(\varepsilon) = J[y+\varepsilon\eta]: a curve with its minimum exactly at ε=0\varepsilon = 0. Whatever perturbation shape nn you pick, the length only ever increases away from the line, and the bottom of the curve — where Φ(0)=δJ=0\Phi'(0) = \delta J = 0 — is flat. That flatness, demanded for all η\eta, is the whole content of the variational principle.

Computing the first variation

Turning δJ=0\delta J = 0 into something solvable starts with differentiating Φ(ε)\Phi(\varepsilon) under the integral sign.

The first variation δJ = ∫ (F_y η + F_{y'} η′) dx Derivation

Write out Φ(ε)=abF(x,y+εη,y+εη)dx\Phi(\varepsilon) = \int_a^b F\big(x,\, y+\varepsilon\eta,\, y'+\varepsilon\eta'\big)\,dx and differentiate with respect to ε\varepsilon, using the chain rule on FF (refresher: partial derivatives →). Only the second and third arguments of FF carry ε\varepsilon:

dΦdε  =  ab[Fy(y+εη)ε  +  Fy(y+εη)ε]dx  =  ab[Fyη  +  Fyη]dx.\frac{d\Phi}{d\varepsilon} \;=\; \int_a^b \left[ \frac{\partial F}{\partial y}\,\frac{\partial(y+\varepsilon\eta)}{\partial\varepsilon} \;+\; \frac{\partial F}{\partial y'}\,\frac{\partial(y'+\varepsilon\eta')}{\partial\varepsilon} \right] dx \;=\; \int_a^b \left[ \frac{\partial F}{\partial y}\,\eta \;+\; \frac{\partial F}{\partial y'}\,\eta' \right] dx.

Setting ε=0\varepsilon = 0 (so the partials are evaluated on the unperturbed yy) gives the first variation:

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

This must vanish for every test function η\eta with η(a)=η(b)=0\eta(a)=\eta(b)=0. As it stands the condition mixes η\eta and its derivative η\eta', so we cannot yet “cancel η\eta.” The next lesson removes η\eta' by an integration by parts, after which the arbitrariness of η\eta forces a differential equation on yy — the Euler–Lagrange equation.

The pieces F/y\partial F/\partial y and F/y\partial F/\partial y' are ordinary partial derivatives of the integrand: treat xx, yy, and yy' as three independent slots and differentiate FF with respect to each. (For arc length, F=1+y2F = \sqrt{1+y'^2} gives F/y=0\partial F/\partial y = 0 and F/y=y/1+y2\partial F/\partial y' = y'/\sqrt{1+y'^2}.) Holding these straight is the one piece of bookkeeping the whole subject rests on.

Maxima, minima, and merely stationary

As in ordinary calculus, δJ=0\delta J = 0 locates stationary functions — it does not by itself say minimum, maximum, or saddle. The sign of the second variation δ2J=Φ(0)\delta^2 J = \Phi''(0) decides: a minimum needs δ2J0\delta^2 J \ge 0 for all η\eta (the Legendre condition, 2F/y20\partial^2 F/\partial y'^2 \ge 0, is the local test). In almost every physical problem the geometry or physics tells you which case you are in — the soap film is obviously a minimum of area, the light ray a minimum of time — so the practice is to solve δJ=0\delta J = 0 for the extremal and confirm the nature separately. We follow that practice throughout, and take up the second variation only where the character of the extremal is genuinely in doubt.

With the first variation in hand, the next lesson converts δJ=0\delta J = 0 from an integral condition into the differential equation that every extremal obeys.