8.2 Hamilton’s Equations and Variational Principles
The true motion makes the action $\int L\,dt$ stationary; trading velocities for momenta turns Lagrange's $n$ second-order equations into Hamilton's $2n$ first-order ones, $\dot q=\partial H/\partial p$, $\dot p=-\partial H/\partial q$, whose geometry — Poisson brackets, conserved phase area, least action — organises all of mechanics.
In §8.1 Lagrange's equations were obtained from Newton's laws through D'Alembert's principle. In this section we turn the logic around and start from a single statement: of all the conceivable ways in which a system can get from one configuration at time $t_1$ to another at time $t_2$, the actual motion is the one that makes the action $S=\int_{t_1}^{t_2}L\,dt$ stationary. This is Hamilton's principle (1834). Because $S$ is a functional, the calculus of variations of §6.1 applies at once: its Euler–Lagrange equations are Lagrange's equations. The principle is coordinate-free, it extends verbatim to fields, optics and relativity, and its "stationary, not minimal" fine print is a precise statement about conjugate points (§6.2).
Hamilton's second contribution was to replace the generalised velocities $\dot q_j$ by the generalised momenta $p_j=\partial L/\partial\dot q_j$ through a Legendre transform. The $n$ second-order Lagrange equations become $2n$ first-order canonical equations for the Hamiltonian $H(q,p,t)$, which in most problems is simply the energy expressed in coordinates and momenta. In the $2n$-dimensional phase space the motion is a flow with remarkable structure: it preserves areas (Liouville), its constants of motion are detected by Poisson brackets, and the changes of variables that respect it — canonical transformations — are characterised by one bracket. We end with the older principle of least action of Maupertuis, Euler and Jacobi, which describes the shape of trajectories of given energy as geodesics, and with Routh's procedure for cyclic coordinates. CSIR NET asks for Hamiltonians of given Lagrangians (and conversely), for Poisson brackets and constants of motion, for whether a transformation is canonical, and for the conditions under which $H$ is conserved or equals $T+V$.
Hamilton's Principle
Throughout, the system is holonomic with $n$ degrees of freedom and Lagrangian $L(q,\dot q,t)$ of class $C^2$ (for example $L=T-V$, or with a velocity-dependent potential). A path is a $C^2$ map $q:[t_1,t_2]\to\mathbb R^n$ (a curve in configuration space parametrised by time).
Proof. Differentiation under the integral sign (legitimate: the integrand is $C^1$ in $\varepsilon$ on a compact interval) and the chain rule give $$\delta S=\int_{t_1}^{t_2}\sum_{j=1}^n\Big(\frac{\partial L}{\partial q_j}\eta_j+\frac{\partial L}{\partial\dot q_j}\dot\eta_j\Big)dt .$$ Integrate the second term by parts; $\partial L/\partial\dot q_j$ evaluated along $q$ is $C^1$ in $t$ because $L$ and $q$ are $C^2$: $$\delta S=\Big[\sum_j\frac{\partial L}{\partial\dot q_j}\eta_j\Big]_{t_1}^{t_2}-\int_{t_1}^{t_2}\sum_{j=1}^n\Big(\frac{d}{dt}\frac{\partial L}{\partial\dot q_j}-\frac{\partial L}{\partial q_j}\Big)\eta_j\,dt .$$ The boundary term vanishes because $\eta(t_1)=\eta(t_2)=0$. If Lagrange's equations hold, the integrand vanishes and $\delta S=0$. Conversely suppose $\delta S=0$ for every admissible $\eta$. Fix $j$ and take $\eta$ with only its $j$-th component non-zero, $\eta_j=\phi$ an arbitrary $C^2$ function vanishing at the ends. Then $\int_{t_1}^{t_2}\mathcal E_j(t)\phi(t)\,dt=0$ for all such $\phi$, where $\mathcal E_j$ is the (continuous) Lagrange expression along $q$. By the fundamental lemma of the calculus of variations (§6.1), $\mathcal E_j\equiv0$. ∎
Three consequences are immediate. First, Hamilton's principle does not mention coordinates, so Lagrange's equations have the same form in every coordinate system (the invariance under change of coordinates proved in §8.1, now with a one-line proof). Second, adding $dF(q,t)/dt$ to $L$ changes $S$ by the constant $F(B,t_2)-F(A,t_1)$, which has no effect on stationarity (the freedom $L\to cL+dF/dt$ of §8.1 again). Third, for a system with several degrees of freedom the principle is exactly the Euler–Lagrange problem for several unknown functions treated in §6.1.
Is the action always a minimum? The harmonic oscillator shows that it is not, and shows exactly when it stops being one.
Proof. Expand $L(x_0+\eta,\dot x_0+\dot\eta)$: the zeroth-order part integrates to $S[x_0]$, the first-order part to $\delta S=0$ (Theorem 8.12), and the second-order part is exactly $\tfrac m2(\dot\eta^2-\omega^2\eta^2)$; there are no higher terms because $L$ is quadratic. For the sign we use Wirtinger's inequality: if $\eta$ is $C^1$ on $[0,T]$ with $\eta(0)=\eta(T)=0$, then $$\int_0^T\dot\eta^2\,dt\ \ge\ \frac{\pi^2}{T^2}\int_0^T\eta^2\,dt,$$ with equality only for $\eta=c\sin(\pi t/T)$. To prove it, expand $\eta$ in its Fourier sine series $\eta=\sum_{k\ge1}b_k\sin(k\pi t/T)$ on $[0,T]$ (§4.2); then $\dot\eta$ has the cosine series $\sum_kb_k\frac{k\pi}{T}\cos(k\pi t/T)$ (integrate the cosine coefficients of $\dot\eta$ by parts, using $\eta(0)=\eta(T)=0$), and Parseval's identity gives $$\int_0^T\dot\eta^2=\frac T2\sum_kb_k^2\frac{k^2\pi^2}{T^2}\ \ge\ \frac{\pi^2}{T^2}\cdot\frac T2\sum_kb_k^2=\frac{\pi^2}{T^2}\int_0^T\eta^2,$$ with equality iff $b_k=0$ for all $k\ge2$. Hence, if $\omega T\lt\pi$, $$\int_0^T(\dot\eta^2-\omega^2\eta^2)\ge\Big(\frac{\pi^2}{T^2}-\omega^2\Big)\int_0^T\eta^2\gt0\qquad(\eta\not\equiv0).$$ For $\eta_k=\sin(k\pi t/T)$ a direct computation gives $\int_0^T(\dot\eta_k^2-\omega^2\eta_k^2)=\frac T2\Big(\frac{k^2\pi^2}{T^2}-\omega^2\Big)$, negative for $k=1$ when $\omega T\gt\pi$ and positive for $k=2$ when $\omega T\lt2\pi$. ∎
The critical time $T=\pi/\omega$ is the first instant at which the solutions $x=c\sin\omega t$ leaving $x(0)=0$ return to $0$ all together: $t=\pi/\omega$ is the first conjugate point of $t=0$, and Theorem 8.13 is the oscillator case of Jacobi's condition (§6.2). In general the true path minimises the action over sufficiently short time intervals and merely makes it stationary over long ones; "the principle of least action" is a historical name for a principle of stationary action.
Generalised Momenta, the Legendre Transform and Hamilton's Equations
Lagrange's equations are $n$ second-order equations in the $n$ unknowns $q_j$. Hamilton's reformulation treats the generalised momenta $p_j=\partial L/\partial\dot q_j$ (introduced with cyclic coordinates in §8.1) as independent variables on an equal footing with the $q_j$. The tool that exchanges $\dot q$ for $p$ is the Legendre transform.
Proof. The Hessian of $f$ is the Jacobian of $v\mapsto\nabla f(v)$; it is invertible, so by the inverse function theorem $p\mapsto v(p)$ is $C^1$ with Jacobian the inverse Hessian. (a) and (d): by the chain rule, for each component, $$\frac{\partial g}{\partial p_k}=v_k+\sum_jp_j\frac{\partial v_j}{\partial p_k}-\sum_j\frac{\partial f}{\partial v_j}\frac{\partial v_j}{\partial p_k}=v_k,$$ because $\partial f/\partial v_j=p_j$; the same cancellation gives $\partial g/\partial x=-\partial f/\partial x$. Then the Hessian of $g$ is the Jacobian of $p\mapsto v(p)$, the inverse of a positive definite matrix, hence positive definite. (b) Since $\nabla g(p)=v$, the transform of $g$ is $v\cdot p(v)-g(p(v))=v\cdot p-(p\cdot v-f(v))=f(v)$. (c) For fixed $p$ the function $\phi(v)=p\cdot v-f(v)$ is strictly concave on the convex set $\Omega$, and its only critical point is $v(p)$; a critical point of a concave function is a global maximum, so $\max\phi=\phi(v(p))=g(p)$. ∎
Note that $H$ is Jacobi's energy function $h$ of §8.1 re-expressed in terms of momenta — the same number, a different function. The distinction matters: $h$ must be differentiated with $\dot q$ held fixed, $H$ with $p$ held fixed.
Proof. Theorem 8.14(a),(d) with $v=\dot q$, $f=L$ and the parameters $x=(q,t)$ give $$\frac{\partial H}{\partial p_j}=\dot q_j(q,p,t),\qquad \frac{\partial H}{\partial q_j}=-\frac{\partial L}{\partial q_j},\qquad \frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t}$$ (here the Hessian need only be non-singular, not positive definite, for (a) and (d)). The first set of identities is the first canonical equation; it simply restates the definition of $p$. Given that, Lagrange's equation $\frac{d}{dt}p_j=\partial L/\partial q_j$ is equivalent to $\dot p_j=-\partial H/\partial q_j$. Finally, along a solution, $$\frac{dH}{dt}=\sum_j\Big(\frac{\partial H}{\partial q_j}\dot q_j+\frac{\partial H}{\partial p_j}\dot p_j\Big)+\frac{\partial H}{\partial t}=\sum_j\Big(\frac{\partial H}{\partial q_j}\frac{\partial H}{\partial p_j}-\frac{\partial H}{\partial p_j}\frac{\partial H}{\partial q_j}\Big)+\frac{\partial H}{\partial t}=\frac{\partial H}{\partial t}.$$ ∎
Proof. $\partial L/\partial\dot q=A\dot q+b$, so $\dot q=A^{-1}(p-b)$. Then $$p^{\mathsf T}\dot q-L=(A\dot q+b)^{\mathsf T}\dot q-\tfrac12\dot q^{\mathsf T}A\dot q-b^{\mathsf T}\dot q-T_0+V$$ $$=\tfrac12\dot q^{\mathsf T}A\dot q-T_0+V$$, and $\tfrac12\dot q^{\mathsf T}A\dot q=\tfrac12(p-b)^{\mathsf T}A^{-1}(p-b)$ because $A^{-1}$ is symmetric. ∎
For a charge in a magnetic field, $L=\tfrac12m|\dot{\mathbf r}|^2+e\dot{\mathbf r}\cdot\mathbf A-e\phi$ gives $\mathbf p=m\dot{\mathbf r}+e\mathbf A$ and $H=\dfrac{|\mathbf p-e\mathbf A|^2}{2m}+e\phi$: the canonical momentum $\mathbf p$ differs from the mechanical momentum $m\dot{\mathbf r}$, and the magnetic field disappears from the value of $H$ (it does no work) while still shaping the motion.
Proof. (a) is the last statement of Theorem 8.15 together with $\partial H/\partial t=-\partial L/\partial t$. (b) is Theorem 8.16 with $b=0$, $T_0=0$. The examples: for the rotating hoop, Theorem 8.16 gives $H=\dfrac{p_\theta^2}{2ma^2}-\tfrac12ma^2\omega^2\sin^2\theta-mga\cos\theta$, while $T+V$ has $+\tfrac12ma^2\omega^2\sin^2\theta$; for the spring, $\partial H/\partial t=\tfrac12\dot k(t)q^2$. ∎
Whether $H$ equals the energy depends on the coordinates, not only on the system: a free particle in the plane has $H=T$ in inertial coordinates, but in coordinates rotating at rate $\omega$ (Exercise I.6) $H=\dfrac{|\mathbf p|^2}{2m}-\omega(Xp_Y-Yp_X)$, which is conserved but is not the kinetic energy.
Proof. Vary $q\to q+\varepsilon\xi$ (with $\xi=0$ at the ends) and $p\to p+\varepsilon\pi$ ($\pi$ arbitrary). Then $$\delta\mathcal S=\int_{t_1}^{t_2}\sum_j\Big(\pi_j\dot q_j+p_j\dot\xi_j-\frac{\partial H}{\partial q_j}\xi_j-\frac{\partial H}{\partial p_j}\pi_j\Big)dt=\int_{t_1}^{t_2}\sum_j\Big[\Big(\dot q_j-\frac{\partial H}{\partial p_j}\Big)\pi_j-\Big(\dot p_j+\frac{\partial H}{\partial q_j}\Big)\xi_j\Big]dt,$$ after integrating $p_j\dot\xi_j$ by parts (the boundary term vanishes because $\xi=0$ at the ends; this needs $p\in C^1$). Since $\pi$ and $\xi$ are independent and arbitrary, the fundamental lemma gives both canonical equations, and conversely. ∎
Along a curve where $p=\partial L/\partial\dot q$, the integrand $p\cdot\dot q-H$ equals $L$, so this is Hamilton's principle with the velocities freed from the coordinates. The term $\int p\,dq$ is the abbreviated action that reappears in the principle of least action below.
Proof. Write the canonical equations as $\dot z=X(z,t)$ with $z=(q,p)$ and $X=\big(\partial H/\partial p,\,-\partial H/\partial q\big)$. Its divergence is $$\nabla\cdot X=\sum_j\Big(\frac{\partial^2H}{\partial q_j\,\partial p_j}-\frac{\partial^2H}{\partial p_j\,\partial q_j}\Big)=0 .$$ The Jacobian matrix $Y(t)=D\Phi_t(z_0)$ satisfies the variational equation $\dot Y=DX\big(\Phi_t(z_0),t\big)\,Y$, $Y(0)=I$, a linear system whose coefficient matrix has trace $\nabla\cdot X=0$. By Liouville's formula for linear systems (§1.3), $\det Y(t)=\exp\int_0^t\mathrm{tr}\,DX\,ds=1$. The change-of-variables formula then gives $\mathrm{vol}\,\Phi_t(D)=\int_D|\det D\Phi_t|=\mathrm{vol}\,D$. ∎
A damped oscillator $\dot q=p$, $\dot p=-q-\gamma p$ is not Hamiltonian: its divergence is $-\gamma$, and phase areas shrink like $e^{-\gamma t}$ (Exercise IV.2). Liouville's theorem is also why Hamiltonian systems can have no asymptotically stable equilibria — a small disc around such an equilibrium would have to shrink.
Poisson Brackets, Constants of Motion and Canonical Transformations
- antisymmetry $[f,g]=-[g,f]$, so $[f,f]=0$; bilinearity $[af+bg,h]=a[f,h]+b[g,h]$;
- Leibniz rule $[f,gh]=[f,g]\,h+g\,[f,h]$;
- Jacobi identity $[f,[g,h]]+[g,[h,f]]+[h,[f,g]]=0$;
- fundamental brackets $[q_j,q_k]=0$, $[p_j,p_k]=0$, $[q_j,p_k]=\delta_{jk}$; and $[q_j,f]=\dfrac{\partial f}{\partial p_j}$, $[p_j,f]=-\dfrac{\partial f}{\partial q_j}$.
Proof. (1), (2) and (4) follow directly from the definition and the product rule for partial derivatives. For (3), define for each $f$ the first-order differential operator $D_f=[f,\cdot\,]=\sum_j\big(\frac{\partial f}{\partial q_j}\frac{\partial}{\partial p_j}-\frac{\partial f}{\partial p_j}\frac{\partial}{\partial q_j}\big)$. Every term of the Jacobi sum is a product of one second derivative and two first derivatives. Collect the terms that contain second derivatives of $h$: they occur only in $[f,[g,h]]+[g,[h,f]]=D_fD_gh-D_gD_fh$. The commutator $D_fD_g-D_gD_f$ of two first-order differential operators is again a first-order operator — when it is expanded, the terms with second derivatives of $h$ appear twice with opposite signs, because mixed partial derivatives of $h$ commute. So the Jacobi sum contains no second derivatives of $h$; by the cyclic symmetry of the sum, it contains no second derivatives of $f$ or $g$ either. Since each of its terms contains exactly one second derivative, the sum is zero. ∎
Proof. (a) Chain rule and Hamilton's equations: $\dfrac{df}{dt}=\sum_j\big(\frac{\partial f}{\partial q_j}\frac{\partial H}{\partial p_j}-\frac{\partial f}{\partial p_j}\frac{\partial H}{\partial q_j}\big)+\frac{\partial f}{\partial t}$. "If and only if" uses that through every point of phase space passes a solution. (b) By (a) and the Jacobi identity, rewritten as $[[f,g],H]=[f,[g,H]]+[[f,H],g]$, $$\frac{d}{dt}[f,g]=[[f,g],H]+\Big[\frac{\partial f}{\partial t},g\Big]+\Big[f,\frac{\partial g}{\partial t}\Big]=\Big[f,[g,H]+\frac{\partial g}{\partial t}\Big]+\Big[[f,H]+\frac{\partial f}{\partial t},g\Big]=[f,\dot g]+[\dot f,g]=0 .$$ (We used $\frac{\partial}{\partial t}[f,g]=[\partial_tf,g]+[f,\partial_tg]$ and that $\dot f=\dot g=0$ as functions on phase space, since they vanish along every solution.) ∎
A change of phase-space variables $(q,p)\mapsto(Q,P)$ is useful when it keeps Hamilton's equations in Hamiltonian form. For one degree of freedom this property is detected by a single bracket.
Proof. Along a motion, $\dot Q=[Q,H]$ by Theorem 8.21(a). Write $H$ as $K(Q,P,t)$ and use the chain rule $\frac{\partial H}{\partial q}=K_Q\frac{\partial Q}{\partial q}+K_P\frac{\partial P}{\partial q}$, $\frac{\partial H}{\partial p}=K_Q\frac{\partial Q}{\partial p}+K_P\frac{\partial P}{\partial p}$: $$[Q,H]=\frac{\partial Q}{\partial q}\Big(K_Q\frac{\partial Q}{\partial p}+K_P\frac{\partial P}{\partial p}\Big)-\frac{\partial Q}{\partial p}\Big(K_Q\frac{\partial Q}{\partial q}+K_P\frac{\partial P}{\partial q}\Big)=K_P\,[Q,P].$$ In the same way $\dot P=[P,H]=K_Q[P,Q]=-K_Q[Q,P]$. Hence the transformed equations are Hamiltonian with Hamiltonian $K$ for every $H$ if and only if $[Q,P]=1$ (take $K=P$, for example, to see necessity). Finally $[Q,P]=Q_qP_p-Q_pP_q$ is the Jacobian determinant. ∎
The Principle of Least Action and the Routhian
Hamilton's principle fixes the end times and lets the energy be whatever it must be. The older principle of Maupertuis (1744), made precise by Euler and Lagrange and given its geometric form by Jacobi (1837), fixes the energy and lets the time of transit be free; it describes the shape of the trajectory rather than its timing.
Proof. Parametrise $\gamma$ by any parameter $\lambda$ and write $q'=dq/d\lambda$, $|q'|_a=\sqrt{\sum a_{jk}q_j'q_k'}$. Then $J=\int G\,d\lambda$ with $G=\sqrt{2(E-V)}\,|q'|_a$. Because $G$ is positively homogeneous of degree $1$ in $q'$, $J$ does not depend on the parametrisation, and the Euler–Lagrange equations of $G$ in any regular parameter describe the same curves (they are reparametrisations of each other). So we may compute them in a particular parameter: choose $\lambda=t$ such that $|\dot q|_a^2=2(E-V)$ along the curve (possible because $E-V\gt0$; this fixes the speed). With this choice $$\frac{\partial G}{\partial\dot q_j}=\sqrt{2(E-V)}\,\frac{\sum_ka_{jk}\dot q_k}{|\dot q|_a}=\sum_ka_{jk}\dot q_k,\qquad \frac{\partial G}{\partial q_j}=-\frac{|\dot q|_a}{\sqrt{2(E-V)}}\frac{\partial V}{\partial q_j}+\sqrt{2(E-V)}\,\frac{\sum_{k,l}\partial_ja_{kl}\,\dot q_k\dot q_l}{2|\dot q|_a},$$ that is, $\dfrac{\partial G}{\partial q_j}=-\dfrac{\partial V}{\partial q_j}+\tfrac12\sum_{k,l}\partial_ja_{kl}\,\dot q_k\dot q_l$. The Euler–Lagrange equation $\frac{d}{dt}\frac{\partial G}{\partial\dot q_j}=\frac{\partial G}{\partial q_j}$ is therefore $$\frac{d}{dt}\sum_ka_{jk}\dot q_k-\tfrac12\sum_{k,l}\partial_ja_{kl}\,\dot q_k\dot q_l+\frac{\partial V}{\partial q_j}=0,$$ which is exactly Lagrange's equation for $L$. Conversely, a motion of energy $E$ satisfies $\tfrac12|\dot q|_a^2=T=E-V$, i.e. it is parametrised in the special way, and satisfies Lagrange's equations, hence the Euler–Lagrange equations of $G$. Finally, along such a motion $\sqrt{2(E-V)}\,ds=\sqrt{2T}\cdot\sqrt{2T}\,dt=2T\,dt$. ∎
When some coordinates are cyclic, their momenta are constants and one would like to discard them. Doing so naively in $L$ gives wrong equations; the correct procedure, due to Routh (1877), performs a Legendre transform in the cyclic velocities only.
Proof. Compute the differential of $R$, regarding $\dot q_c$ as functions of $(q_a,\dot q_a,\beta,t)$: $$dR=\sum_a\Big(\frac{\partial L}{\partial q_a}dq_a+\frac{\partial L}{\partial\dot q_a}d\dot q_a\Big)+\sum_c\frac{\partial L}{\partial\dot q_c}d\dot q_c+\frac{\partial L}{\partial t}dt-\sum_c\beta_c\,d\dot q_c-\sum_c\dot q_c\,d\beta_c .$$ Since $\partial L/\partial\dot q_c=\beta_c$, the two sums containing $d\dot q_c$ cancel — this is the point of the Legendre transform. Reading off coefficients: $\partial R/\partial q_a=\partial L/\partial q_a$, $\partial R/\partial\dot q_a=\partial L/\partial\dot q_a$ and $\partial R/\partial\beta_c=-\dot q_c$ (cyclic coordinates do not appear because they do not appear in $L$). Lagrange's equations for $q_a$ in terms of $L$ therefore become the stated equations for $R$. ∎
For a central force, $L=\tfrac12m(\dot r^2+r^2\dot\theta^2)-V(r)$, $\beta=p_\theta=mr^2\dot\theta$, $\dot\theta=\beta/(mr^2)$, and $$R=\tfrac12m\dot r^2+\frac{\beta^2}{2mr^2}-V(r)-\frac{\beta^2}{mr^2}=\tfrac12m\dot r^2-\Big(V(r)+\frac{\beta^2}{2mr^2}\Big),$$ a one-dimensional Lagrangian with exactly the effective potential of §8.1. Substituting $\dot\theta=\beta/(mr^2)$ directly into $L$ would instead give $\tfrac12m\dot r^2+\frac{\beta^2}{2mr^2}-V$, whose equation has the centrifugal force with the wrong sign.
- Stationary, not least. For the oscillator with $\omega T\gt\pi$ the true path is a saddle point of the action (Theorem 8.13); at $\omega T=\pi$ with $x(0)=x(T)=0$ there are infinitely many true paths, all with $S=0$, and with $x(0)=0\ne x(T)$ there is none.
- $H$ conserved $\not\Rightarrow$ $H=T+V$, and conversely. The four cases of Theorem 8.17: rotating hoop (conserved, not energy), spring with $k(t)$ (energy, not conserved).
- $H$ depends on the coordinates. The same free particle has $H=T$ in inertial coordinates and $H=T-\omega J_z$ in rotating ones.
- Canonical momentum is not mechanical momentum. In a magnetic field $\mathbf p=m\dot{\mathbf r}+e\mathbf A$, and $\dot{\mathbf r}=(\mathbf p-e\mathbf A)/m\ne\mathbf p/m$.
- Not every Hamiltonian has a Lagrangian. $H=qp$ (and any $H$ affine in $p$) is singular: $\partial^2H/\partial p^2=0$ and the Legendre transform fails, although Hamilton's equations are fine.
- Sign conventions for brackets. With $[f,g]=f_qg_p-f_pg_q$ we have $[q,p]=1$ and $\dot f=[f,H]$; with the opposite convention both signs flip. Check before computing.
- Poisson's theorem needs both functions conserved. For $H=\tfrac12(p_x^2+p_y^2)+\tfrac12(x^2+4y^2)$, $f=x^2+p_x^2$ is conserved but $J_z$ is not, and $[f,J_z]=-2(xy+p_xp_y)$ is not conserved.
- Swapping $q$ and $p$ is not canonical. $Q=p$, $P=q$ has $[Q,P]=-1$; $Q=p$, $P=-q$ is canonical. $Q=q+p$, $P=q-p$ has bracket $-2$.
- Liouville is about volume, not shape. A phase-space blob may be stretched into a long filament (near a separatrix) while its area stays exactly constant; friction breaks it.
- Do not substitute conserved momenta into $L$. Use the Routhian $R=L-\sum\beta_c\dot q_c$; naive substitution reverses the sign of the centrifugal term.
- Maupertuis fixes energy, Hamilton fixes time. In Jacobi's principle the varied paths all have energy $E$ and take whatever time they need; in Hamilton's principle all paths take the same time and the energy is not fixed.
Exercises
- 1 Find $H$ and Hamilton's equations for a particle in plane polar coordinates in the potential $V(r)$, and for a spherical pendulum $L=\tfrac12m\ell^2(\dot\theta^2+\sin^2\theta\,\dot\varphi^2)+mg\ell\cos\theta$.
- 2 Find $H$ for $L=\tfrac12\dot q^2+q\dot q-\tfrac12q^2$, and verify that Hamilton's equations give $\ddot q+q=0$.
- 3 Find the Lagrangian corresponding to $H=\dfrac{p^2}{2m}+apq+\tfrac12kq^2$ ($a,k$ constants) and the equation of motion for $q$.
- 4 For a charge in a static magnetic field, $H=\dfrac{|\mathbf p-e\mathbf A(\mathbf r)|^2}{2m}$. Show that $m\dot{\mathbf r}=\mathbf p-e\mathbf A$ and that $H$ is the kinetic energy.
- 5 A pendulum hangs from a support that moves vertically as $y_s=A\cos\Omega t$ (§8.1, Exercise II.2). Find $H$ and decide whether it is conserved.
- 6 A free particle in the plane is described in coordinates $(X,Y)$ rotating with constant angular velocity $\omega$ (§8.1, Exercise I.5). Show that $H=\dfrac{p_X^2+p_Y^2}{2m}-\omega(Xp_Y-Yp_X)$.
- 7 Solve Hamilton's equations for $H=\dfrac{p^2}{2m}+\tfrac12m\omega^2q^2$ and describe the orbits in the phase plane. What is the area enclosed by the orbit of energy $E$?
- 8 Solve Hamilton's equations for $H=qp$ and sketch the phase portrait. Is the origin stable?
- 9 For $L=\tfrac12m\dot x^2-\tfrac12k(t)x^2$, find $H$ and $dH/dt$.
- 1 For a free particle, $L=\tfrac12m\dot x^2$, show that the straight-line motion between $x(0)=0$ and $x(T)=X$ minimises the action among all admissible paths, and compute the minimum value.
- 2 For $L=\tfrac12(\dot x^2-x^2)$, $x(0)=x(T)=0$, $T=3\pi/2$: compute $\Delta S=S[\varepsilon\eta]-S[0]$ for $\eta=\sin(\pi t/T)$ and for $\eta=\sin(2\pi t/T)$. What kind of stationary point is $x\equiv0$?
- 3 For the same Lagrangian with $x(0)=0$, $x(T)=1$ and $T\ne k\pi$, find the true path and show that its action is $S_0=\tfrac12\cot T$. What happens as $T\to\pi$?
- 4 Derive Lagrange's equations for the spherical pendulum directly from Hamilton's principle and the Euler–Lagrange equations for two unknown functions (§6.1).
- 5 Derive Hamilton's equations for $H=\dfrac{p^2}{2m}+V(q)$ by making $\int(p\dot q-H)\,dt$ stationary (Theorem 8.18).
- 6 Compute the abbreviated action $\oint p\,dq$ over one period of the oscillator of energy $E$ and frequency $\omega$, and check that it equals $\int_0^{2\pi/\omega}2T\,dt$.
- 7 A particle crosses a plane interface from a region where $V=0$ to one where $V=V_0\lt E$, with speeds $v_1$ and $v_2$ and angles $\alpha_1$, $\alpha_2$ to the normal. Use Maupertuis' principle to show $v_1\sin\alpha_1=v_2\sin\alpha_2$, and compare with Snell's law for light.
- 8 Use Jacobi's principle to show that a particle moving freely ($V=0$) on a smooth circular cylinder travels along helices (or circles, or generators).
- 1 Compute $[q^2,p^2]$, $[q,f(p)]$ and $[p,g(q)]$.
- 2 Compute $[J_z,y]$, $[J_z,p_y]$ and $[J_z,x^2+y^2]$.
- 3 Verify $[J_y,J_z]=J_x$ directly from the definition.
- 4 Show that $[\mathbf a\cdot\mathbf J,\ |\mathbf p|^2]=0$ for every constant vector $\mathbf a$.
- 5 For $H=\tfrac12(p_x^2+p_y^2)+\tfrac12\omega^2(x^2+y^2)$ show that $J_z$, $p_x^2+\omega^2x^2$ and $p_xp_y+\omega^2xy$ are constants of motion. Is their bracket $[J_z,p_x^2+\omega^2x^2]$ a constant of motion too?
- 6 Which are canonical? (a) $Q=p$, $P=-q$; (b) $Q=q^2$, $P=p/(2q)$; (c) $Q=\sqrt{2q}\cos p$, $P=\sqrt{2q}\sin p$; (d) $Q=q+p$, $P=q-p$.
- 7 For which constants $\alpha,\beta$ is $Q=q^\alpha\cosh(\beta p)$, $P=q^\alpha\sinh(\beta p)$ ($q\gt0$) canonical?
- 8 Show that $Q=q$, $P=p+\phi'(q)$ is canonical for every $C^2$ function $\phi$, and relate it to adding a total derivative to the Lagrangian.
- 1 Prove that $H(q,p)=\tfrac12p^{\mathsf T}A(q)^{-1}p+V(q)$ is a strictly convex function of $p$ for each fixed $q$ when $A(q)$ is positive definite.
- 2 For the damped oscillator $\dot q=p$, $\dot p=-q-\gamma p$, prove that phase areas are multiplied by $e^{-\gamma t}$ in time $t$, and deduce that the system has no Hamiltonian $H(q,p)$ for $\gamma\ne0$.
- 3 Use the Routhian to eliminate $\varphi$ from the spherical pendulum, and find the condition for a conical motion at constant $\theta=\theta_0$.
- 4 Show that the Legendre transform of $f(v)=|v|^a/a$ on $\mathbb R$ ($a\gt1$) is $g(p)=|p|^b/b$ with $\frac1a+\frac1b=1$, and deduce Young's inequality $pv\le\frac{|v|^a}{a}+\frac{|p|^b}{b}$.
- 5 Prove that $[Q,P]_{q,p}\,[q,p]_{Q,P}=1$ for an invertible $C^1$ map with non-vanishing Jacobian, and deduce that the inverse of a canonical map is canonical.
- 6 Show that a Hamiltonian system $\dot q=\partial H/\partial p$, $\dot p=-\partial H/\partial q$ ($n=1$, $H\in C^2$) cannot have an asymptotically stable equilibrium.
E1. CSIR Part B GATE MA The Hamiltonian corresponding to the Lagrangian $L=\tfrac12m(\dot x^2+\dot y^2)+\alpha(x\dot y-y\dot x)-V(x,y)$ is (A) $\dfrac{(p_x-\alpha y)^2+(p_y+\alpha x)^2}{2m}+V$; (B) $\dfrac{(p_x+\alpha y)^2+(p_y-\alpha x)^2}{2m}+V$; (C) $\dfrac{p_x^2+p_y^2}{2m}+\alpha(xp_y-yp_x)+V$; (D) $\dfrac{(p_x+\alpha y)^2+(p_y-\alpha x)^2}{2m}-V$.
E2. CSIR Part B With $[f,g]=\sum(f_{q}g_{p}-f_{p}g_{q})$ and $J_z=xp_y-yp_x$, the Poisson bracket $[J_z,\ xp_x]$ equals (A) $0$; (B) $xp_y-yp_x$; (C) $xp_y+yp_x$; (D) $xp_x-yp_y$.
E3. CSIR Part B The transformation $Q=\tfrac12(q^2+p^2)$, $P=\lambda\tan^{-1}(q/p)$ (on $p\gt0$) is canonical for (A) $\lambda=1$; (B) $\lambda=-1$; (C) $\lambda=2$; (D) $\lambda=\tfrac12$.
E4. CSIR Part C Let $L=\tfrac12(\dot x^2-x^2)$ and consider $C^2$ paths on $[0,T]$ with $x(0)=0$, $x(T)=b$. Which of the following are true? (A) If $T=2$, the solution of Lagrange's equation is a strict minimum of the action. (B) If $T=4$, the solution of Lagrange's equation is a minimum of the action. (C) If $T=\pi$ and $b\ne0$, no path satisfies Lagrange's equation and the boundary conditions. (D) If $T=\pi$ and $b=0$, infinitely many paths satisfy them, all with the same action.
E5. CSIR Part C In which of the following systems is the Hamiltonian a constant of the motion but not equal to the total mechanical energy $T+V$? (A) A bead on a smooth circular hoop rotating with constant angular velocity about a vertical diameter, with the angle on the hoop as coordinate. (B) A simple pendulum whose string is being shortened at a constant rate. (C) A particle in a central field, in plane polar coordinates. (D) A bead on a smooth straight horizontal wire rotating uniformly about a vertical axis through a point of the wire.
E6. CSIR Part C For $H=\tfrac12(p_x^2+p_y^2)+\tfrac12(x^2+4y^2)$, which of the following are constants of the motion? (A) $p_x^2+x^2$; (B) $xp_y-yp_x$; (C) $p_y^2+4y^2$; (D) $xy+p_xp_y$.
Suggested plan — 3 lectures × 60 min.
- Hamilton's principle. Recall the Euler–Lagrange equation of §6.1 and prove Theorem 8.12 in ten minutes. Example 1 on the board, then Theorem 8.13 with Wirtinger's inequality. Project Interactive 1: let the class predict what happens to the parabola for $k=1$ as $T$ crosses $\pi$, and why $k=2$ behaves differently.
- Hamilton's equations. Legendre transform (Theorem 8.14, with the picture of the tangent line of slope $p$), Definition 8.9, Theorems 8.15–8.17, the four-case table. Examples 2–4. Liouville (Theorem 8.19) with Interactive 2 — switch on friction at the end.
- Brackets and principles. Poisson brackets, the Jacobi identity proof via commutators, Poisson's theorem, Example 5; canonical transformations and Example 6. Jacobi's principle with Example 7 (projectile as "optics"), Routhian with the central-force warning. Exam corner E1, E3, E5 live.
Discussion questions. (1) Hamilton's principle "knows" the end point in advance. Is the principle teleological? How does the proof of Theorem 8.12 dispel the paradox? (2) Why does a bead on a rotating hoop have a conserved $H$ that is not its energy, and which external agent is responsible for the difference? (3) Liouville's theorem says phase areas are conserved, yet a pendulum blob near the separatrix becomes a long thin filament. Is information lost?
Misconceptions to watch for. "The action is always minimised"; "$H$ is always $T+V$"; computing $\partial H/\partial q$ with $\dot q$ (instead of $p$) held fixed; confusing canonical and mechanical momentum; using the opposite Poisson-bracket sign halfway through a problem; substituting $p_\theta=\beta$ into $L$ instead of forming the Routhian; believing that "canonical" means "area-preserving up to sign".
Suggested homework. I(1, 2, 3, 6, 8), II(1, 2, 3, 7), III(1, 2, 5, 6, 7), IV(2, 3, 4); Exam corner E2, E4, E6.
Research question. When we simulate a Hamiltonian system for a very long time, does a "more accurate" method (classical RK4) keep the energy better than a "cruder" one that respects the Hamiltonian structure (the leapfrog or Störmer–Verlet method)?
Why it matters. Long-time simulations of the solar system (used by observatories and space agencies to compute planetary ephemerides and to study the stability of orbits over billions of years), molecular-dynamics simulations of proteins in drug design, and particle tracking in accelerators such as those at CERN all integrate Hamiltonian systems over millions of steps. Methods that preserve phase-space area — symplectic integrators — are now standard there for a reason this project uncovers.
What to do.
- Take the pendulum $H=\tfrac12p^2-\cos q$ with $q(0)=1$, $p(0)=0$, step $h=0.1$. Implement explicit Euler ($q\mathrel{+}=hp$, $p\mathrel{-}=h\sin q$ with the old values), symplectic Euler (update $p$ first, then $q$ with the new $p$), leapfrog (half-step in $p$, full step in $q$, half-step in $p$) and classical RK4 (§5.5).
- Run each to $t=1000$ and plot the energy error $H(q_n,p_n)-H(q_0,p_0)$ against time. Repeat RK4 and leapfrog to $t=10\,000$.
- Check numerically that one step of symplectic Euler and of leapfrog is an area-preserving map (compute its Jacobian determinant), while explicit Euler and RK4 are not.
- Formulate a conjecture about the long-time behaviour of the energy error for each method and test it by halving $h$.
Tools: Python with NumPy and Matplotlib, or a spreadsheet for the short runs; Interactive 2 for intuition about area preservation.
Hand in: The energy-error plots, the Jacobian determinants, and a half-page explanation of which method you would use for a billion-year orbit simulation and why.
Going further. Read about backward error analysis: a symplectic method exactly solves a slightly modified Hamiltonian system, which is why its energy error stays bounded. Look up the Wisdom–Holman integrator used in planetary dynamics.
🧪 Self-check quiz
Q1. Hamilton's canonical equations are
Q2. With $[f,g]=\sum(f_qg_p-f_pg_q)$, the bracket $[q^2,p]$ equals
Q3. The Hamiltonian of a system equals $T+V$ provided
Q4. Hamilton's principle asserts that, among paths with the same end configurations at the same times, the actual motion
Q5. For $L=\tfrac12m(\dot r^2+r^2\dot\theta^2)-V(r)$ with $p_\theta=\beta$, the Routhian $R=L-\beta\dot\theta$ is