← Essays
Essays · Learning the Subject

In Praise of the Calculus of Variations: One Move, Many Equations

What can a student learn once and then use again and again, from a sliding bead to an atom in a molecule? The calculus of variations is one of the best answers there is: for the effort it asks, it returns the Euler–Lagrange equation, mechanics, Noether’s theorem, a way into optimal control and the field equations. This page is a tribute to it and a short tutorial.

1. One Move Worth Owning

Ordinary calculus asks at which number a function stops changing to first order. The calculus of variations asks the same of a quantity that depends on a whole curve, motion or field. The move is always the same: change the unknown a little, keep the first order, integrate by parts, and read what multiplies the change and what is left on the boundary. When the unknown is limited, say a force that cannot exceed a maximum, it cannot always be changed in both directions; sections 7 and 8 show what to do then.

That is a small thing to practise, and the return is large. The same few lines give the shape of the fastest slide, Newton’s second law, the reason energy and momentum are conserved, and the Schrödinger equation. Someone who can carry them out, and is given the right functional, can rebuild many central equations of physics instead of memorizing them.

What to bring, and what to expectBring partial derivatives, the chain rule and integration by parts; for fields, add Gauss’s theorem, complex numbers and the idea of a wave function. Expect equations that a solution must satisfy. Solving them is further work, often linear algebra and computation, and a stationary solution still has to be examined (section 13).

2. Where It Came From

Euler–Lagrange, analytical mechanics and Noether’s theorems all grow from this one stem.

yearwhowhat was added
1696–1697Johann Bernoulli and othersIn the June 1696 Acta Eruditorum Johann Bernoulli asks for the curve of fastest descent, the brachistochrone. Solutions by him, Jakob Bernoulli, Leibniz, Newton and de l’Hôpital followed; the May 1697 issue printed several of them.
1744EulerMethodus inveniendi lineas curvas maximi minimive proprietate gaudentes turns a collection of clever problems into a general method.
1755–1762LagrangeIn a letter to Euler of 12 August 1755 the nineteen-year-old Lagrange proposes the δ method; it appears in print in volume 2 of the Miscellanea Taurinensia (1762). Euler takes it up, and his Elementa calculi variationum (printed 1766) carries the name of the subject.
1788LagrangeMéchanique analitique organizes mechanics around general coordinates and one scheme of equations.
1834–1835HamiltonTwo essays On a General Method in Dynamics; the stationary action of L = T − V is now called Hamilton’s principle.
1918NoetherInvariante Variationsprobleme: two theorems tying the symmetries of a variational problem to conservation laws and to identities.
1926SchrödingerThe first paper of Quantisierung als Eigenwertproblem reaches the wave equation of the hydrogen atom through a variational problem.
1951SchwingerThe Theory of Quantized Fields. I states a quantum action principle. Bader’s theory of atoms in molecules, which divides a molecule into regions of real space, later applies it to one such region.
1954–1957BellmanThe theory of dynamic programming (1954) and the book Dynamic Programming (1957): optimization over time, solved through the principle of optimality.
1956–1961Pontryagin and colleaguesBoltyanskii, Gamkrelidze and Pontryagin announce a theory of optimal processes (1956); with Mishchenko they set out the maximum principle in a book (1961; English translation 1962).
1983Crandall and LionsViscosity solutions of Hamilton-Jacobi equations gives a meaning to solutions that are not differentiable everywhere.
1988–1989Peirce, Dahleh, Rabitz; Kosloff, Rice and colleaguesOptimal control theory is applied to shaping the fields that drive quantum systems and chemical reactions.

3. The Move: Deriving the Euler–Lagrange Equation

Let a number J depend on a curve y(x) between two fixed end points.

A functionalJ[y]=∫x0x1F(x,y,y′)dx

Step 1: nudge the curve. Replace y by y + ϵη, where η is any smooth function that vanishes at both ends, and ϵ is a number. Now J is an ordinary function of ϵ.

Step 2: differentiate at ϵ = 0. The chain rule gives

First variationδJ=ϵ∫x0x1[∂F∂yη+∂F∂y′η′]dx

Step 3: move the derivative off η. By the product rule,

Integration by parts∂F∂y′η′=ddx(∂F∂y′η)−ηddx(∂F∂y′)
Bulk and boundaryδJ=ϵ∫x0x1[∂F∂y−ddx(∂F∂y′)]ηdx+ϵ[∂F∂y′η]x0x1

Step 4: read it. The boundary term vanishes because η does at the ends. The integral must vanish for every such η. If the bracket (continuous, say) were positive somewhere, an η that is a small positive bump there would give a nonzero integral; the same holds for negative values. So the bracket is zero everywhere.

Euler–Lagrange equationddx(∂F∂y′)−∂F∂y=0

If an end is left free, η need not vanish there and the boundary term itself must be zero: the condition ∂F/∂y′ = 0 comes out of the same line. The background page on the calculus of variations treats boundaries at length.

4. Two Classics: The Straight Line and the Brachistochrone

The Shortest Path in a Plane

Arc length has F = √(1 + y′²). It does not contain y, so the Euler–Lagrange equation says that ∂F/∂y′ is constant.

Shortest pathddx(y′1+y′2)=0

The fraction increases steadily with y′, so a constant fraction means a constant slope: a straight line.

A Shortcut When F Has No Explicit x

Differentiate F − y′ ∂F/∂y′ along the curve. The two terms containing y″ cancel, and what remains is

The identity behind the shortcutddx(F−y′∂F∂y′)=∂F∂x+y′[∂F∂y−ddx(∂F∂y′)]

On a solution the bracket is zero. If ∂F/∂x = 0 as well, we have a first integral, the Beltrami identity: one derivative fewer to deal with.

Beltrami identityF−y′∂F∂y′=C

The Brachistochrone

A bead starts at rest at the origin and slides without friction, with y measured downward. Energy gives its speed, √(2gy), so the time of descent is

Time of descentτ[y]=∫x0x11+y′22gydx

F has no explicit x. In the Beltrami identity the left side reduces to

First integral1+y′22gy−y′22gy(1+y′2)=12gy(1+y′2)=C

Square it. The combination y(1 + y′²) is a positive constant; call it 2R.

The curvey(1+y′2)=2Rx=R(θ−sin⁡θ),y=R(1−cos⁡θ)

The second line solves the first (exercise 1): it is a cycloid, the curve traced by a point on a rolling circle of radius R. The size R and the final angle are fixed by the end point. The figure takes the end point at θ = π. There the descent takes π√(R/g) on the cycloid and √(π² + 4)·√(R/g) on the straight chute, which is 1.185 times as long in time although it is shorter in length. The derivation shows that the cycloid is stationary; that it is the fastest curve takes a further argument, given in the books.

5. Mechanics from One Function

Rename x as time t and y as a coordinate q(t). Take F to be the Lagrangian L = T − V, kinetic energy minus potential energy, and require the action to be stationary with the end points fixed.

Action and equations of motionS[q]=∫t0t1L(q,q˙,t)dtddt(∂L∂q˙)−∂L∂q=0

For one particle on a line, L = ½mẋ² − V(x). Then ∂L/∂ẋ = mẋ and ∂L/∂x = −dV/dx, so

Newton’s second lawmx¨=−dVdx

The gain is that q may be any coordinate that describes the allowed motions. For a pendulum use the angle φ. The bob moves with speed lφ˙ and sits a height l cos φ below the pivot.

PendulumL=12ml2φ˙2+mglcos⁡φ
Its equation of motionml2φ¨+mglsin⁡φ=0⇒φ¨=−glsin⁡φ

The tension in the rod never had to be found. This works for forces that come from a potential and for constraints, such as a rigid rod, that do no work and that the coordinates already obey; friction needs more than this.

6. Noether: What a Symmetry Gives Back

Shift every path by a small amount, q → q + ϵη, where now η may depend on q, q̇ and t and need not vanish at the ends. Call this a symmetry if, for every path, whether or not it obeys the equations of motion, the Lagrangian changes only by a total time derivative:

Definition of the symmetry, to first orderδL=ϵdKdt

Step 1: compute the same change by the chain rule.

Chain ruleδL=ϵ[∂L∂qη+∂L∂q˙η˙]

Step 2: integrate by parts, in its differential form.

Bulk term and boundary termδL=ϵ[(∂L∂q−ddt(∂L∂q˙))η+ddt(∂L∂q˙η)]

Step 3: set the two expressions equal.

The identityddt(∂L∂q˙η−K)=(ddt(∂L∂q˙)−∂L∂q)η

Step 4: use the equations of motion. On a solution the right side vanishes. So the quantity below keeps its value (with several coordinates, sum over them).

Noether’s theorem, one parameterQ=∂L∂q˙η−K=constant

The two pieces are the boundary term of the variation and the boundary term the symmetry is allowed to leave behind. Three familiar laws follow.

7. Pontryagin: Steering Under Limits

Now suppose we do not choose the motion directly. A state x(t) obeys an equation of motion, and we choose a control u(t), a throttle or a field, from an allowed set. The task is to make a cost as small as possible, with x given at the start and a final time tf. Here x, u and p below may each stand for several numbers; sum over them.

The control problemx˙=f(x,u,t)J=Φ(x(tf))+∫0tfℓ(x,u,t)dt

Φ charges for where we end, and ℓ for what happens on the way.

Step 1: carry the equation of motion along. Introduce a second function p(t), the costate, and define a Hamiltonian H = p·f − ℓ. On any motion that obeys the equation, pẋ − H = ℓ, so the cost can be written

Cost with the constraint built inH=pf−ℓJ=Φ+∫0tf[px˙−H]dt

Step 2: vary x, u and p, and integrate p δẋ by parts. The start is fixed, so δx(0) = 0. Take first a smooth control with no limits.

First variationδJ=(∂Φ∂x+p)δx(tf)+∫0tf[δp(x˙−∂H∂p)−δx(p˙+∂H∂x)−δu∂H∂u]dt

Step 3: read it. The variations are arbitrary, so

Necessary conditionsx˙=∂H∂pp˙=−∂H∂x∂H∂u=0

Step 4: the ends. Where the final value of x is free, the boundary term gives the transversality condition p(tf) = −∂Φ/∂x. Where it is prescribed, δx vanishes there and p is not restricted. If the final time is also free, take Φ = 0 with a prescribed end point: ending δt later while still arriving at the same point changes J by (pẋ − H)δt from the longer integral and by −pẋ δt from the shifted path, in total −H δt. So H = 0 at the end. If f and ℓ do not depend on t, H keeps one value along a solution, and is then zero throughout.

These steps assume that the constraint can be carried by such a p in the form above. Special problems need an extra constant multiplying ℓ that can be zero; they are not treated here.

Euler–Lagrange Is Inside

Let the control be the velocity itself, q̇ = u, and let the running cost be a Lagrangian, ℓ = L(q, u, t). Then H = pu − L, and the conditions read

The control is the velocityp=∂L∂up˙=∂L∂qddt(∂L∂q˙)−∂L∂q=0

The costate is the momentum, H = pq̇ − L is the energy of section 6, and a free end with Φ = 0 gives p(tf) = ∂L/∂q̇ = 0, the free-end condition of section 3.

What Is New: The Maximum, and Limits

Pontryagin’s maximum principle says that along an optimal motion the control maximizes H, over the whole allowed set, at almost every time, while x and p obey the two equations above. The end conditions of step 4 go with it unchanged, including H = 0 for a free final time, and H still keeps one value when f and ℓ do not depend on t. All of this is stated here, not proved; the proof replaces the small variation of u by brief changes of any allowed size. It covers controls that sit at a limit, where ∂H/∂u need not vanish. For unlimited smooth controls it gives ∂H/∂u = 0 and also asks that this point be a maximum, which in the velocity case means ∂²L/∂q̇² ≥ 0. It is a necessary condition: it picks out candidates. (Some books write the same thing as a minimum, with the opposite sign of p.)

If H depends on u only through a term σu, and |u| ≤ 1, the maximum is at u = +1 when σ > 0 and u = −1 when σ < 0. If σ is zero only at isolated moments, the control jumps between its limits: bang-bang control. Where σ stays zero for a while, this condition does not fix u.

Worked by Hand: Stop a Cart in Least Time

A cart has position x and velocity v, and we choose its acceleration u with |u| ≤ 1. Bring it to rest at the origin as soon as possible. The cost is the time, so ℓ = 1.

Cartx˙=vv˙=uH=p1v+p2u−1

Step 1. Maximizing H gives u = sign p2.

Step 2. The costate equations are ṗ1 = 0 and ṗ2 = −p1. So p2 is a straight line in time: it changes sign at most once, and there is at most one switch. (It cannot vanish for a whole interval, since then p1 = 0 and H = −1, not 0.)

Step 3. With u = ±1 held fixed, d(v²/2)/dt = uv = u ẋ, so the motion follows parabolas x = ±v²/2 + constant. Only two arcs run into the origin. Together they form the switching curve x = −v|v|/2.

Step 4. Start at rest at x = 1. First u = −1: v = −t and x = 1 − t²/2. This meets x = v²/2 when t = 1, at x = ½, v = −1. Then u = +1: v = t − 2 and x = (t − 2)²/2, which reaches rest at the origin at tf = 2. The figure also shows, in teal, the mirror case that starts at rest at x = −1, with all signs reversed.

Step 5: the costate. The switch needs p2(1) = 0, so p2 = c(t − 1) with c > 0. At the start v = 0 and u = −1, so H = 0 reads c − 1 = 0. Hence p2 = t − 1 and p1 = −1.

Step 6: is it really the fastest? Here a direct argument settles it. The cart must travel a distance 1, starting and ending at rest with |u| ≤ 1, so its speed at time t is at most the smaller of t and tf − t. The area under that bound is tf²/4. It must be at least 1, so tf ≥ 2.

8. Bellman: Optimality One Step at a Time

Bellman’s starting point can be put this way: if a whole plan is the best one, then what remains of it at any later moment must be the best plan from the state reached by then. Otherwise one could keep the beginning, replace the remainder by a better one, and improve the whole.

Define the value function W(x, t) as the least cost still to be paid when the state is x at time t. At the final time W(x, tf) = Φ(x).

Step 1: split off a short first stretch. By the principle above, up to terms smaller than Δt,

One short stepW(x,t)=minu[ℓΔt+W(x+fΔt,t+Δt)]

Step 2: expand. Suppose W is differentiable here. Then the last term is W + (∂tW + ∂xW f)Δt. Step 3: cancel W, divide by Δt, and let Δt shrink. This is the Hamilton–Jacobi–Bellman equation.

Hamilton–Jacobi–Bellman∂tW+minu[ℓ+∂xWf]=0∂tW=maxuH(x,−∂xW,u,t)

The Costate Is the Slope of the Value

Assume now that W has continuous second derivatives and that the minimizing u is smooth and unrestricted near the optimal path (or stays at a fixed limit). Differentiate the first form with respect to x; the terms from the change of u cancel at the minimum:

Differentiate in x∂x∂tW+∂xℓ+(∂x2W)f+∂xW∂xf=0

The first and third terms are the rate of change of ∂xW along the path. So with p = −∂xW,

Pontryagin’s costate equation againp˙=∂xℓ−p∂xf=−∂xH

and at the end p = −∂Φ/∂x. The costate says how much the best remaining cost would fall per unit shift of the state. Where W is not smooth this reading needs care.

The Cart Again

Let W(x, v) be the least time to rest at the origin. It has no explicit time, so

Cart1+v∂xW−|∂vW|=0

Start above the switching curve, x > −v|v|/2, so that u = −1 comes first, for a time t1. The switch is where x + vt1 − t1²/2 = (v − t1)²/2. The root that lands on the lower branch, where v − t1 is negative, is t1 = v + s, with s = √(x + v²/2). The velocity there is −s, and the second arc takes a time s. We take this one-switch path to be the fastest from every start above the curve; section 7 shows that only for the start at x = 1, and the general proof is not given here.

Value function above the switching curveW=v+2ss=x+v22∂xW=1s∂vW=1+vs

Here ∂vW ≥ 0, and 1 + v/s − (1 + v/s) = 0: the equation holds. Below the curve, symmetry gives W = −v + 2√(v²/2 − x). On the first arc from x = 1, s stays equal to 1 and v = −t, so −∂xW = −1 = p1 and −∂vW = t − 1 = p2: the costate of section 7.

The smoothness condition matters. On the lower branch of the switching curve, x = v²/2 with v < 0, both formulas give W = −v, so W is continuous. Its slope in v tends to zero as the curve is approached from the side x > v²/2, but grows without bound from the other side. W has no gradient there, and the whole second arc of our path runs along that curve. Pontryagin’s p2 = t − 1 carries on smoothly; it just cannot be read there as a gradient of W. The theory of viscosity solutions (Crandall and Lions, 1983) gives a precise sense in which functions with kinks or steep edges solve such equations.

The Same Equation in Mechanics

Let S(q, t) be Hamilton’s action along the actual motion that leaves a fixed start and arrives at q at time t. Moving the arrival point, the boundary term of section 3 gives ∂S/∂q = ∂L/∂q̇ = p. Along one motion dS/dt = L = ∂tS + pq̇. Hence ∂tS = −H:

Hamilton–Jacobi equation∂tS+H(q,∂qS,t)=0

Here H is written with the velocity eliminated in favour of p. Bellman’s W looks the other way, from the present to the end: for the velocity problem, −W obeys this same equation. Hamilton’s essays led Jacobi to develop the theory of this equation.

The Price

W answers the question from every starting state at once, which gives a feedback rule: measure the state, then act. But tabulating it with N points along each of n state variables takes Nn points; 100 points and 6 variables already make 1012. Bellman called this the curse of dimensionality. Pontryagin’s equations involve only 2n ordinary differential equations, but they describe one path at a time, with conditions at both ends, and are only necessary.

9. Fields, the Surface Term and Open Atoms

Nothing new is needed for a field: there are more independent variables, and Gauss’s theorem does the integration by parts. Take one electron in a potential V, in atomic units (ħ and the electron mass set to 1), with the functional below over a region Ω. The wave function ψ is complex, so it and its conjugate ψ* can be varied independently; E is a constant, which turns out to be the energy.

A functional of a fieldS[ψ,ψ*]=∫Ω[12∇ψ*⋅∇ψ+(V−E)ψ*ψ]dV

Step 1: vary the field. Change ψ* by a small δψ* and keep the first order.

First variation with respect to the conjugate fieldδS=∫Ω[12∇δψ*⋅∇ψ+(V−E)δψ*ψ]dV

Step 2: integrate by parts. The product rule gives ∇δψ*·∇ψ = ∇·(δψ*∇ψ) − δψ*∇²ψ, and Gauss’s theorem turns the divergence into a surface integral.

Bulk term and surface termδS=∫Ωδψ*[−12∇2ψ+(V−E)ψ]dV+12∮∂Ωδψ*(𝐧⋅∇ψ)dS

Step 3: read both terms. Arbitrary variations inside Ω give the Schrödinger equation. The surface term remains. For a closed system it vanishes with the boundary conditions. For a piece of a molecule it does not. A region that can exchange electrons and momentum with the rest of a molecule is called an open system, and what becomes of this term is central to the theory of such atoms.

In Bader’s quantum theory of atoms in molecules (QTAIM) an atom is a region of space bounded by a surface that the gradient of the electron density ρ never crosses: n·∇ρ = 0 at every point of it, where n is the unit normal and, for our one electron, ρ = ψ*ψ. Such a surface is called a zero-flux surface.

A caution about step 3. Leaving δψ* free on a fixed boundary would force n·∇ψ = 0 there. Bader’s condition is different: it is placed on the density, with a surface that moves with the state. It is a condition on which regions are admitted as atoms. Further reading: Bader’s atoms from Schwinger’s action principle and Why does zero flux define an open atom?

10. Noether for Fields: Phase and Probability

To follow time, use a Lagrangian density ℒ, whose integral over space is the Lagrangian L. For the same electron,

Schrödinger Lagrangian densityℒ=i2(ψ*∂tψ−ψ∂tψ*)−12∇ψ*⋅∇ψ−Vψ*ψ

The field form of Euler–Lagrange, for the variation of ψ*, is

Euler–Lagrange equation for a field∂t∂ℒ∂(∂tψ*)+∇⋅∂ℒ∂(∇ψ*)−∂ℒ∂ψ*=0i∂tψ=(−12∇2+V)ψ

Noether’s steps carry over with one change: the boundary term has a component in time and components in space, and the conserved quantity becomes a density with a current. Multiply the whole field by the same phase, ψ → e−iϵψ and ψ* → eiϵψ*. The density ℒ does not change at all, so K = 0, and η is −iψ for ψ and iψ* for ψ*. Adding ∂ℒ/∂(∂tζ) times η over the two fields ζ = ψ, ψ* gives ρ = ψ*ψ; the same with ∇ζ gives the current.

Continuity from the global phase∂tρ+∇⋅𝐣=0𝐣=12i(ψ*∇ψ−ψ∇ψ*)

A word on gauge symmetry, going beyond what is derived here. If the phase is allowed to vary from point to point and from instant to instant, the electromagnetic potentials must change with it. A symmetry that contains arbitrary functions falls under Noether’s second theorem, which gives identities among the Euler–Lagrange expressions themselves, valid whether or not the equations hold. In electrodynamics one such identity is that the divergence of the field side of Maxwell’s equations with sources vanishes identically, so those equations can only have a conserved source. The continuity law above came from the first theorem and the constant phase.

11. Chemistry: A Field That Steers a Molecule

A molecule in a time-dependent electric field offers a control problem in which the state is the wave function. Here H is the energy operator in the Schrödinger equation i∂tψ = Hψ, no longer the control Hamiltonian of section 7. Take H(t) = H0 − μ𝓔(t): H0 is the energy operator of the molecule without the field, 𝓔(t) the field, and μ, the dipole operator, measures the displacement of charge along the field. We want ψ(tf) close to a chosen normalized state ψgoal without too strong a field. Write ⟨a|b⟩ for ∫a*b over the coordinates of ψ, and make the following as large as possible, with α > 0:

ObjectiveJ=|⟨ψgoal|ψ(tf)⟩|2−α∫0tf𝓔2dt

Step 1: add the Schrödinger equation as a constraint, with a costate that is now a second wave function χ(t):

Constraint term, added to J−2Re∫0tf⟨χ|(∂t+iH)ψ⟩dt

Step 2: vary ψ, keeping ψ(0) fixed, and integrate by parts in t. Energy and dipole operators are Hermitian, meaning ⟨a|Hb⟩ = ⟨Ha|b⟩. The terms inside the integral and at the final time must each vanish:

The costate wave functioni∂tχ=Hχχ(tf)=⟨ψgoal|ψ(tf)⟩ψgoal

Step 3: vary the field.

Variation in the fieldδJ=−2∫0tfδ𝓔[α𝓔+Im⟨χ|μ|ψ⟩]dt
Stationary field𝓔(t)=−1αIm⟨χ(t)|μ|ψ(t)⟩

ψ runs forward from its start, χ runs backward from the goal, and the field depends on both, so the three are usually solved together by repeated sweeps; a stationary field found this way need not be the best one. With a hard limit on the field and α = 0, the same variation says to push the field to its limit with the sign opposite to Im⟨χ|μ|ψ⟩ wherever that is not zero: bang-bang again. This is the textbook setting of quantum optimal control of molecules; the references give the original treatments. No result for a particular molecule is reported here.

12. What One Move Buys

make stationary or optimalby varyingand you geton this page
length of a curvethe curvethe straight linesection 4
time of descentthe curvethe cycloidsection 4
action ∫ (T − V) dtthe coordinates q(t)the equations of motionsection 5
(an action unchanged by a continuous symmetry)a one-parameter familya conserved quantitysection 6
a cost, with the equations of motion as a constraintstate, costate and controlHamilton-like equations and the maximum conditionsection 7
the best cost still to comethe first short stretch of the controlthe Hamilton–Jacobi–Bellman equationsection 8
the one-electron functionalψ*the stationary Schrödinger equation, and a surface termsection 9
the time-dependent Schrödinger actionψ*the time-dependent equation; its constant phase gives continuitysection 10
nearness to a target state, less the cost of the fieldwave function, costate wave function and fieldtwo Schrödinger equations and a formula for the fieldsection 11
the action of the electromagnetic field with a sourcethe potentialsthe two Maxwell equations that contain the sourcesnot derived here
the action of the relativistic electronits wave functionthe Dirac equationnot derived here
approximate many-electron energies of quantum chemistry (Hartree–Fock, multiconfigurational, Kohn–Sham)one-electron wave functions, and in some methods mixing coefficientsthe working equations of those methodsnot derived here
Schwinger’s action principle on a region of spacefields and regionthe equations of an atom in a molecule in Bader’s theorynot derived here

The chemical Lagrangian density, written ℒchem, collects the terms for electrons, nuclei and the electromagnetic field, from which the equations of motion used in chemistry follow; varying it, and using its symmetries, is how equations of motion and conserved currents are read from it. Having the equations is the start of a chemical calculation, and some choices, such as how to draw the boundary of an atom when electrons are treated relativistically, remain conventions. Further reading: From ℒBO to ℒchem.

13. After the Gradient Vanishes

Setting a first derivative or first variation to zero finds minima, maxima and saddle points alike. One more step tells them apart. Two examples, worked by hand, show why it is worth taking.

A Symmetric Point That Is Not a Minimum

Take a model energy that depends on one number θ and does not change when θ is replaced by −θ.

Model energy and its derivativesE(θ)=−θ22+θ44E′=−θ+θ3=θ(θ2−1)E″=−1+3θ2

Stationary points: E′ = 0 at θ = 0 and θ = ±1. Second derivative: E″(0) = −1, a maximum; E″(±1) = 2, two minima. Values: E(0) = 0 and E(±1) = −¼.

The symmetry alone forces a stationary point at θ = 0: differentiating E(−θ) = E(θ) gives −E′(−θ) = E′(θ), so E′(0) = 0. A search that moves downhill along −E′ and starts exactly at θ = 0 therefore never moves, and reports a vanishing gradient. Started at θ = 0.01 it slides to θ = 1; started at −0.01, to θ = −1. Each minimum lacks the symmetry, although the symmetry turns one into the other: they are broken-symmetry solutions, here lower in energy than the symmetric point, and θ measures how far the symmetry is broken.

A True Motion That Does Not Minimize the Action

Take an oscillator with unit mass and spring constant, with x = 0 at times 0 and tf.

Oscillator actionS[x]=∫0tfx˙2−x22dt

The motion x = 0 obeys ẍ = −x, so it is stationary. To see what kind of stationary point it is, put in a variation η that vanishes at both ends. The action is quadratic and S[0] = 0, so S[η] is exactly the second-order change. Try η = a sin(nπt/tf). Both sin² and cos² of this angle average to ½, so

Change of the actionS[η]=a2tf4[n2π2tf2−1]

If tf > π, the choice n = 1 makes this negative, while a large n makes it positive. The motion is stationary, yet neither a minimum nor a maximum of the action: nearby paths lie on both sides. For tf < π every one of these sine variations raises the action; showing that every variation does takes a further argument. This is why the principle is one of stationary action, not always least action.

Habit worth learning earlyAfter the gradient vanishes, ask three things: is it a minimum, does it have the symmetry it should, and does it still do so when you start somewhere else?

14. From Calc I to Dirac–Maxwell QTAIM

This section is a map for further study toward QTAIM, the quantum theory of atoms in molecules; nothing above depends on it. Here is a route for a reader who starts with a first calculus course and wants to end able to read an atom out of the Dirac–Maxwell Lagrangian, which describes relativistic electrons together with the electromagnetic field. Variations of fields sit at step 4, early enough to pay off in everything above them. Step 0 needs no page here; every later step builds only on the ones below it.

stepwhat to be able to dopublished herestill needed
0Calc I
derivatives, integrals, the fundamental theorem; then integration by parts, often taught next
——
1Fields in space
partial derivatives, gradient, divergence, Gauss, Green and Stokes
Green’s theorem on a punctured atoma first page on div, grad, curl and the integral theorems
2Linear algebra
matrices, eigenvalues, quadratic forms
Completing the squarea page on eigenvalue problems
3Many variables
integrating variables away to reach the electron density
Integrating out a variable; Units and reduced density matrices—
4Variations of fields
functionals, Euler–Lagrange, the action, boundary terms
The calculus of variations—
5The shape of ρ
critical points and the molecular graph
Critical points and the molecular graph—
6Open atoms
Schwinger’s principle on a region, zero flux, virial and interaction energies
Bader’s atoms from Schwinger; Why zero flux; The virial theorem; Interacting Quantum Atoms—
7Spacetime and fields
spacetime algebra, Maxwell’s equations from an action
The Dirac electron in spacetime algebraa geometric algebra primer; Maxwell from the action
8Dirac
the Dirac equation, spin, relativity in heavy atoms
The Dirac boundary problemthe Dirac equation from its Lagrangian
9Dirac–Maxwell QTAIM
atoms in the chemical Lagrangian, including what is still a convention
From ℒBO to ℒchem; What survives the passage—

Two honest limits. The published pages listed above were not written as a course, so a newcomer will meet jumps between them. And the last step is not finished physics: for a four-component Dirac electron the choice of atomic surface is still a convention.

15. Exercises

Exercise 1. Show that the cycloid of section 4 obeys y(1 + y′²) = 2R.

Answer. dy/dθ = R sin θ and dx/dθ = R(1 − cos θ), so y′ = sin θ/(1 − cos θ). Then 1 + y′² = 2/(1 − cos θ), using sin²θ + cos²θ = 1. Multiplying by y = R(1 − cos θ) gives 2R.

Exercise 2. A curve y(x) > 0 is turned about the x axis. Which curves make the area, 2π ∫ y √(1 + y′²) dx, stationary?

Answer. There is no explicit x, so the Beltrami identity applies: y/√(1 + y′²) = a. Hence y′² = y²/a² − 1, solved by the catenary y = a cosh((x − b)/a). Whether such a curve passes through two given end points depends on where they are.

Exercise 3. A particle moves in a plane in a potential V(r). Write L in polar coordinates and find the quantity conserved because φ is absent.

Answer. L = ½m(ṙ² + r²φ̇²) − V(r). The Euler–Lagrange equation for φ says d(mr²φ̇)/dt = 0: the angular momentum.

Exercise 4. For a free particle, L = ½mẋ², apply the change x → x + ϵt. Find K and the conserved quantity.

Answer. δL = ϵmẋ = ϵ d(mx)/dt, so K = mx and, with η = t, Q = mẋt − mx. It is constant because the motion is uniform: x(t) = x(0) + ẋt. Dropping K would give a quantity that is not conserved.

Exercise 5. Repeat step 2 of section 9 with ψ varied instead of ψ*. Then add the two surface terms and compare the result with ∮ n·∇ρ dS, where ρ = ψ*ψ, taking δψ = ψ δλ and δψ* = ψ* δλ for a real constant δλ.

Answer. The two surface terms are ½∮ δψ* n·∇ψ dS and ½∮ δψ n·∇ψ* dS. With the stated variations their sum is (δλ/2) ∮ n·(ψ*∇ψ + ψ∇ψ*) dS = (δλ/2) ∮ n·∇ρ dS. It vanishes when the flux of ∇ρ through the boundary does, which holds on every zero-flux surface.

Exercise 6. For the cart of section 7, with u unrestricted, go from rest at x = 1 to rest at the origin in a given time tf with the least ∫u²/2 dt. Find u(t).

Answer. H = p1v + p2u − u²/2, so u = p2, a straight line a + bt. Integrating twice, v = at + bt²/2 and x = 1 + at²/2 + bt³/6. Rest at the origin at tf gives a = −6/tf² and b = 12/tf³. The control is now smooth, with no jump. The path is a cubic in time.

Exercise 7. With ẋ = u and cost ∫(x² + u²)/2 dt from now to infinity, solve the Hamilton–Jacobi–Bellman equation and check the costate equation.

Answer. W does not depend on t, and 0 = minu[(x² + u²)/2 + W′u]. The minimum is at u = −W′, giving W′² = x². With W ≥ 0 and W(0) = 0, W = x²/2 and u = −x. Then p = −W′ = −x, and ṗ = −ẋ = x, which equals −∂H/∂x for H = pu − (x² + u²)/2.

Exercise 8. The cart is at the origin but moving with v = 1. What is the least time to bring it to rest there, and when is the switch?

Answer. The state is above the switching curve and s = √½, so W = v + 2s = 1 + √2. The first arc, u = −1, lasts v + s = 1 + √½; then u = +1 for a time √½.

References

Comments, questions or contributions? Please open an issue or a pull request on GitHub.