The calculus of variations: from a stationary integral to the Euler–Lagrange and Hamilton equations
A functional J[y] = ∫ f(y, ẏ, s) ds is stationary under every small change of the path with fixed end points exactly when ∂f/∂y_i − d/ds(∂f/∂ẏ_i) = 0. With s = t and f = L this is Hamilton's principle giving the Euler–Lagrange equations; with f the arc length on a sphere it gives great circles as the shortest paths; and varying q and p independently in ∫(p q̇ − H) dt gives Hamilton's equations. D'Alembert's principle is the differential form of the dynamics, Hamilton's principle the integrated one.
The calculus of variations looks for functions yi(s), i=1,…,n, between two values s1 and s2 of a parameter, that make a functional (a number that depends on whole functions) stationary:
capital J ( y initial ) equals the integral from s one to s two of d s f ( y one (s), and so on, y sub n (s), y one dot (s), and so on, y sub n dot (s), s )
In this general discussion only, the dot means d/ds, not d/dt. Compare the path yi(s) with a neighbouring one, yi′(s)=yi(s)+ηi(s), where the change δyi=ηivanishes at both ends, ηi(s1)=ηi(s2)=0: the end points stay fixed and only the path between them moves. To first order the change in J is
First-order variation
0=δJ=∫s1s2dsi∑[δyi∂yi∂f+δy˙i∂y˙i∂f]
In words
0 equals delta capital J equals the integral from s one to s two of d s the sum over i of the quantity delta y initial partial f over partial y initial plus delta y sub i dot partial f over partial y sub i dot
Since δy˙i is the derivative of δyi, integrating the second term by parts moves the derivative onto ∂f/∂y˙i. The boundary term contains δyi at s1 and s2, which is zero. What is left is ∫ds∑i[∂yi∂f−dsd∂y˙i∂f]δyi(s), and if the δyi are independent (for instance once holonomic constraints have been used to remove the dependent coordinates) and arbitrary, this vanishes only if every bracket does:
Euler–Lagrange equation for a functional
∂yi∂f−dsd(∂y˙i∂f)=0
In words
partial f over partial y initial minus d over d s ( partial f over partial y sub i dot ) equals 0
A geometric example (notes pp. 22–23): the shortest path between two points on a sphere of radius a is an arc of a great circle. The length of a path is J=∫s1s2ds, and on the sphere (dr=0, spherical angles θ and ϕ)
Arc length on a sphere
ds=(dx)2+(dy)2+(dz)2=a2(dθ)2+a2sin2θ(dϕ)2
In words
d s equals the square root of (d x) squared plus (d y) squared plus (d z) squared, end of root, equals the square root of a squared (d theta ) squared plus a squared sine squared theta (d phi ) squared, end of root
so f=1+sin2θϕ˙2 (dropping the constant a, with ϕ˙=dϕ/dθ). f does not contain ϕ, so the Euler–Lagrange equation says ∂f/∂ϕ˙ is constant along the path. Some algebra then gives the solutions
Great circles
sin(ϕ−α)=βcotθ
In words
sine of the quantity phi minus alpha, equals beta cot theta
with constants α and β. (Multiplying by asinθ turns this into a linear relation among x, y and z, the equation of a plane through the centre of the sphere, which cuts it in a great circle.)
Worked example
Flying between two cities at 60° N
Two cities lie on the parallel of latitude 60° N, 90° apart in longitude. Compare the length of the route along the parallel with the great-circle route, on a sphere of radius a=6371 km, and find how far north the great circle goes.
Along the parallel
Latitude 60° is colatitude θ=30∘. Along the parallel dθ=0, so eq. (1.79) gives ds=asinθdϕ and the length is asin30∘×π/2=0.785a=5004 km. This path does not satisfy the great-circle equation: a parallel other than the equator is not a great circle.
The great circle
Put the two cities at ϕ=0 and ϕ=90∘, both at θ=30∘, into sin(ϕ−α)=βcotθ: −sinα=β3 and cosα=β3. So α=−45∘ and β=cos45∘/3=0.408. The angle c between the two cities seen from the centre follows from the cosine rule of spherical trigonometry (or from the dot product of the two position vectors): cosc=cos230∘+sin230∘cos90∘=0.75, so c=0.723 rad and the route is 0.723a=4605 km, about 400 km shorter.
How far north
The path is closest to the pole where sin(ϕ−α)=1, at ϕ=45∘. There cotθ=1/β, so θ=arctan0.408=22.2∘: latitude 67.8° N, nearly 8° north of the two cities.
Loading graph…
The great-circle route between two places at 60° N, 90° apart in longitude, computed from sin(ϕ−α)=βcotθ with α=−45∘ and β=0.408 (θ is the colatitude). Plotted on a flat latitude-longitude grid, the shortest route bulges towards the pole.
Hamilton's equations from a variational principle#
Hamilton's principle can also be set up in phase space (notes p. 23). Treat the 2N functions q1,…,qN,p1,…,pN as independent and require
Hamilton's principle in phase space
δJ[q,p]=δ∫t1t2dt[piq˙i−H(q,p,t)]=0
In words
delta capital J ( q, p ) equals delta the integral from t one to t two of d t the quantity p sub i q sub i dot minus H(q, p, t), equals 0
with all variations zero at the ends: δqi(t1)=δqi(t2)=0 and δpi(t1)=δpi(t2)=0. With f=piq˙i−H, the Euler–Lagrange equations for the two kinds of variable are
d over d t ( partial f over partial q sub i dot ) minus partial f over partial q sub i equals 0 which gives p sub i dot equals minus partial H over partial q sub i, d over d t ( partial f over partial p sub i dot ) minus partial f over partial p sub i equals 0 which gives q sub i dot equals partial H over partial p sub i
which are Hamilton's equations. Because f does not contain p˙i, the boundary term from the p variations is zero anyway, so the conditions δpi=0 at the ends seem unnecessary. The notes insist that they are needed all the same: they put qi and pi on the same footing, which is exploited later in the course for canonical transformations.
delta capital J equals the integral from t one to t two of d t the quantity partial L over partial q sub j minus d over d t ( partial L over partial q sub j dot ), delta q sub j equals 0
A constant of the great-circle solution sin(φ − α) = β cot θ, setting how far the circle is tilted from the pole. Say it: “beta” (sounds like “bay-ta or bee-ta”).
The Hamiltonian H(q, p, t) = q̇_i p_i − L; equal to the energy T + V when T is quadratic in the velocities and V depends on the coordinates only. Unit: J.Say it: “H”.
The mathematics of finding the whole function or curve, rather than a single point, that makes some quantity smallest or largest. Explained in Geodesics and the calculus of variations.
A method for finding the largest or smallest value of a function when its variables must satisfy a constraint. Explained in A ring on a string, and Newton's method.
The straightest possible path in a curved space or spacetime: locally the shortest (or, for clocks, the longest-time) route between two points. Explained in Geodesics and the calculus of variations.
Of a relation or equation: using only first powers of the unknowns, so doubling the cause doubles the effect and effects simply add. Explained in Solving and rearranging formulas.
A way of multiplying two vectors that gives a number: multiply matching components and add, or lengths times the cosine of the angle between them. Explained in Vectors and the dot product.
As an adjective: to do with derivatives or with small changes at each point, as in a differential equation. Explained in A rope with mass: differential analysis.
True or correctly applicable under the stated conditions.
Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).