MechanicsHamiltonian Mechanics and Chaos1 of 5
Hamiltonian Mechanics and Chaos · 1

Hamilton's Equations

To step a system forward in time using position x\Where{x} and conjugate momentum p=∂L∂v\Mom{p} = \Mom{\frac{\partial L}{\partial v}} on equal footing, we need to trade the Lagrangian L(x,v,t)L(\Where{x}, \Vel{v}, t) for a function of x\Where{x}, p\Mom{p}, and tt. Simply solving p=∂L∂v\Mom{p} = \Mom{\frac{\partial L}{\partial v}} for v\Vel{v} and plugging it straight into LL fails whenever position and velocity are multiplied together in the kinetic energy.

Why You Cannot Just Plug Velocity of Momentum into the Lagrangian
mm
r\htmlClass{lc-blue}{r}
θ\htmlClass{lc-blue}{\theta}
rθ˙\htmlClass{lc-blue}{r}\htmlClass{lc-pink}{\dot\theta}
Tθ=12mr2θ˙2\Kin{T_\theta} = \tfrac{1}{2}m\Where{r}^2\Vel{\dot\theta}^2
(∂Tθ∂r)θ˙=?(∂Tθ∂r)pθ=?\displaystyle \left(\frac{\partial \Kin{T_\theta}}{\partial \Where{r}}\right)_{\Vel{\dot\theta}} = {?} \qquad \left(\frac{\partial \Kin{T_\theta}}{\partial \Where{r}}\right)_{\Mom{p_\theta}} = {?}

For a planet of mass mm orbiting in polar coordinates (r,θ)(\Where{r}, \Where{\theta}), the angular kinetic energy is Tθ=12mr2θ˙2\Kin{T_\theta} = \frac{1}{2}m\Where{r}^2\Vel{\dot{\theta}}^2 and the angular momentum is pθ=∂L∂θ˙=mr2θ˙\Mom{p_\theta} = \Mom{\frac{\partial L}{\partial \dot{\theta}}} = m\Where{r}^2\Vel{\dot{\theta}}. Differentiating Tθ\Kin{T_\theta} with respect to r\Where{r} while holding θ˙\Vel{\dot{\theta}} fixed gives the outward centrifugal term:

(∂Tθ∂r)θ˙=∂∂r(12mr2θ˙2)=+mrθ˙2\displaystyle \begin{aligned}\left(\frac{\partial \Kin{T_\theta}}{\partial \Where{r}}\right)_{\Vel{\dot{\theta}}} &= \frac{\partial}{\partial \Where{r}}\left(\frac{1}{2}m\Where{r}^2\Vel{\dot{\theta}}^2\right) \\ &= +m\Where{r}\Vel{\dot{\theta}}^2\end{aligned}

If we instead substitute θ˙=pθmr2\Vel{\dot{\theta}} = \frac{\Mom{p_\theta}}{m\Where{r}^2} directly into Tθ\Kin{T_\theta} and differentiate with respect to r\Where{r} while holding pθ\Mom{p_\theta} fixed, r2\Where{r}^2 moves into the denominator and the derivative flips sign:

Tθ(r,pθ)=12mr2(pθmr2)2=pθ22mr2(∂Tθ∂r)pθ=∂∂r(pθ22mr2)=−pθ2mr3=−mrθ˙2\displaystyle \begin{aligned}\Kin{T_\theta}(\Where{r}, \Mom{p_\theta}) &= \frac{1}{2}m\Where{r}^2\left(\frac{\Mom{p_\theta}}{m\Where{r}^2}\right)^2 = \frac{\Mom{p_\theta}^2}{2m\Where{r}^2} \\ \left(\frac{\partial \Kin{T_\theta}}{\partial \Where{r}}\right)_{\Mom{p_\theta}} &= \frac{\partial}{\partial \Where{r}}\left(\frac{\Mom{p_\theta}^2}{2m\Where{r}^2}\right) \\ &= -\frac{\Mom{p_\theta}^2}{m\Where{r}^3} = -m\Where{r}\Vel{\dot{\theta}}^2\end{aligned}

As r\Where{r} increases, holding θ˙\Vel{\dot{\theta}} fixed makes Tθ\Kin{T_\theta} climb with slope +mrθ˙2+m\Where{r}\Vel{\dot{\theta}}^2. Holding pθ=mr2θ˙\Mom{p_\theta} = m\Where{r}^2\Vel{\dot{\theta}} fixed instead forces θ˙\Vel{\dot{\theta}} to drop as 1r2\tfrac{1}{\Where{r}^2}, so Tθ\Kin{T_\theta} falls with the opposite slope, −mrθ˙2-m\Where{r}\Vel{\dot{\theta}}^2.

Holding angular velocity fixed makes angular kinetic energy grow with radius, while holding angular momentum fixed slows the spin down so fast that angular kinetic energy falls at the exact opposite slope.
1

Building the Hamiltonian and Hamilton's Equations

We want a function H(x,p,t)H(\Where{x}, \Mom{p}, t) whose small change dHdH depends only on dx\Nudge{dx}, dp\Mom{dp}, and dtdt, with any accompanying change dv\Vel{dv} canceling out automatically.

Building the Hamiltonian and Hamilton's Equations
L(x,v,t)  ⟶  H(x,p,t)=?x˙=?p˙=?\displaystyle \begin{aligned} L(\Where{x}, \Vel{v}, t) \;\longrightarrow\; H(\Where{x}, \Mom{p}, t) &= {?} \\[2pt] \Vel{\dot x} &= {?} \\[2pt] \Mom{\dot p} &= {?} \end{aligned}

Using p=∂L∂v\Mom{p} = \Mom{\frac{\partial L}{\partial v}} and the Euler-Lagrange equation p˙=∂L∂x\Mom{\dot{p}} = \Force{\frac{\partial L}{\partial x}}, a small nudge to L(x,v,t)L(\Where{x}, \Vel{v}, t) is dLdL == p˙ dx+p dv+∂L∂tdt\Mom{\dot{p}}\,\Nudge{dx} + \Mom{p}\,\Vel{dv} + \frac{\partial L}{\partial t}dt. Because the product rule gives d(pv)d(\Mom{p}\Vel{v}) == v dp+p dv\Vel{v}\,\Mom{dp} + \Mom{p}\,\Vel{dv} with the exact same +p dv+\Mom{p}\,\Vel{dv} term, subtracting LL from pv\Mom{p}\Vel{v} cancels out dv\Vel{dv}:

H(x,p,t)=pv−L(x,v,t)⏟HamiltoniandH=d(pv)−dL=(v dp+p dv)−(p˙ dx+p dv+∂L∂tdt)=x˙ dp−p˙ dx−∂L∂tdt\displaystyle \begin{aligned}H(\Where{x}, \Mom{p}, t) &= \underbrace{\Mom{p}\Vel{v} - L(\Where{x}, \Vel{v}, t)}_{\text{Hamiltonian}} \\ dH &= d(\Mom{p}\Vel{v}) - dL \\ &= (\Vel{v}\,\Mom{dp} + \Mom{p}\,\Vel{dv}) \\ &\quad - \left(\Mom{\dot{p}}\,\Nudge{dx} + \Mom{p}\,\Vel{dv} + \frac{\partial L}{\partial t}dt\right) \\ &= \Vel{\dot{x}}\,\Mom{dp} - \Mom{\dot{p}}\,\Nudge{dx} - \frac{\partial L}{\partial t}dt\end{aligned}

Matching the coefficients of dp\Mom{dp}, dx\Nudge{dx}, and dtdt against dHdH == ∂H∂pdp+∂H∂xdx+∂H∂tdt\Vel{\frac{\partial H}{\partial p}}\Mom{dp} + \Force{\frac{\partial H}{\partial x}}\Nudge{dx} + \frac{\partial H}{\partial t}dt gives Hamilton's equations:

x˙=∂H∂p,p˙=−∂H∂x,∂H∂t=−∂L∂t\displaystyle \begin{aligned}\Vel{\dot{x}} &= \Vel{\frac{\partial H}{\partial p}}, &\qquad \Mom{\dot{p}} &= -\Force{\frac{\partial H}{\partial x}}, \\ \frac{\partial H}{\partial t} &= -\frac{\partial L}{\partial t}\end{aligned}

As the system moves along its physical trajectory, the changes in HH from x\Where{x} and p\Mom{p} always cancel each other out:

dHdt=∂H∂xx˙+∂H∂pp˙+∂H∂t=(−p˙)x˙+x˙p˙+∂H∂t=∂H∂t=−∂L∂t\displaystyle \begin{aligned}\frac{dH}{dt} &= \Force{\frac{\partial H}{\partial x}}\Vel{\dot{x}} + \Vel{\frac{\partial H}{\partial p}}\Mom{\dot{p}} + \frac{\partial H}{\partial t} \\ &= (-\Mom{\dot{p}})\Vel{\dot{x}} + \Vel{\dot{x}}\Mom{\dot{p}} + \frac{\partial H}{\partial t} \\ &= \frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t}\end{aligned}

For a particle with LL == T−V\Kin{T} - \Pot{V} == 12mv2−V(x)\frac{1}{2}m\Vel{v}^2 - \Pot{V(x)} and p=mv\Mom{p} = m\Vel{v}, the product pv=mv2=2T\Mom{p}\Vel{v} = m\Vel{v}^2 = 2\Kin{T} turns HH into the total mechanical energy written in terms of x\Where{x} and p\Mom{p}:

H=pv−L=2T−(T−V)=T+V=p22m+V(x)\displaystyle \begin{aligned}H &= \Mom{p}\Vel{v} - L = 2\Kin{T} - (\Kin{T} - \Pot{V}) \\ &= \Kin{T} + \Pot{V} = \frac{\Mom{p}^2}{2m} + \Pot{V(x)}\end{aligned}

On the upward-curving graph of LL versus v\Vel{v} at fixed x\Where{x} and tt, each velocity v\Vel{v} has its own tangent slope p=∂L∂v\Mom{p} = \Mom{\frac{\partial L}{\partial v}}. Tracing that tangent line back to v=0\Vel{v} = 0 drops the height by pv\Mom{p}\Vel{v} from LL, crossing the vertical axis at a depth H=pv−LH = \Mom{p}\Vel{v} - L below zero.

At a fixed position and time, every velocity on the curve has its own tangent slope, and extending that tangent back to the vertical axis marks the depth below the origin.
2

The Four-Step Method in Polar Coordinates

For a system with several coordinates qi\Where{q_i}, every coordinate gets its own piq˙i\Mom{p_i}\Vel{\dot{q}_i} term in H=∑ipiq˙i−LH = \sum_i \Mom{p_i}\Vel{\dot{q}_i} - L. Let's build HH and write Hamilton's equations for a planet of mass mm orbiting a star in 2D polar coordinates (r,θ)(\Where{r}, \Where{\theta}) under a central potential V(r)\Pot{V(r)}.

The Four-Step Method in Polar Coordinates
mm
r\htmlClass{lc-blue}{r}
θ\htmlClass{lc-blue}{\theta}
V(r)\htmlClass{lc-blue}{V(r)}
L=12m(r˙2+r2θ˙2)−V(r)H(r,θ,pr,pθ)=?\begin{aligned} L &= \tfrac{1}{2}m(\Vel{\dot r}^2 + \Where{r}^2\Vel{\dot\theta}^2) - \Pot{V(r)} \\[4pt] H(\Where{r}, \Where{\theta}, \Mom{p_r}, \Mom{p_\theta}) &= {?} \end{aligned}
Text solution
Step 1: Write the Lagrangian in terms of the coordinates and velocitiesCombine the radial and angular kinetic energy pieces with the central potential V(r)\Pot{V(r)}.
L(r,θ,r˙,θ˙)\displaystyle L(\Where{r}, \Where{\theta}, \Vel{\dot{r}}, \Vel{\dot{\theta}}) =12m(r˙2+r2θ˙2)−V(r)\displaystyle = \frac{1}{2}m\left(\Vel{\dot{r}}^2 + \Where{r}^2\Vel{\dot{\theta}}^2\right) - \Pot{V(r)}
Step 2: Differentiate LL with respect to each velocity to find the conjugate momentaTake the partial derivative of LL with respect to r˙\Vel{\dot{r}} and θ˙\Vel{\dot{\theta}}.
pr\displaystyle \Mom{p_r} =∂L∂r˙\displaystyle = \Mom{\frac{\partial L}{\partial \dot{r}}} =mr˙,pθ\displaystyle = m\Vel{\dot{r}}, \qquad \Mom{p_\theta} =∂L∂θ˙\displaystyle = \Mom{\frac{\partial L}{\partial \dot{\theta}}} =mr2θ˙\displaystyle = m\Where{r}^2\Vel{\dot{\theta}}
Step 3: Invert the momentum equations to solve for the velocitiesIsolate r˙\Vel{\dot{r}} and θ˙\Vel{\dot{\theta}} in terms of pr\Mom{p_r}, pθ\Mom{p_\theta}, and r\Where{r}.
r˙\displaystyle \Vel{\dot{r}} =prm,θ˙\displaystyle = \frac{\Mom{p_r}}{m}, \qquad \Vel{\dot{\theta}} =pθmr2\displaystyle = \frac{\Mom{p_\theta}}{m\Where{r}^2}
Step 4: Build H=∑ipiq˙i−LH = \sum_i \Mom{p_i}\Vel{\dot{q}_i} - L and eliminate all velocitiesSubstitute r˙=prm\Vel{\dot{r}} = \frac{\Mom{p_r}}{m} and θ˙=pθmr2\Vel{\dot{\theta}} = \frac{\Mom{p_\theta}}{m\Where{r}^2} into prr˙+pθθ˙−L\Mom{p_r}\Vel{\dot{r}} + \Mom{p_\theta}\Vel{\dot{\theta}} - L so that HH depends only on coordinates and momenta.
H(r,θ,pr,pθ)=pr(prm)+pθ(pθmr2)−[12m(prm)2+12mr2(pθmr2)2−V(r)]=pr22m+pθ22mr2+V(r)\displaystyle \begin{aligned}&H(\Where{r}, \Where{\theta}, \Mom{p_r}, \Mom{p_\theta}) \\ &= \Mom{p_r}\left(\frac{\Mom{p_r}}{m}\right) + \Mom{p_\theta}\left(\frac{\Mom{p_\theta}}{m\Where{r}^2}\right) \\ &\quad - \Biggl[\frac{1}{2}m\left(\frac{\Mom{p_r}}{m}\right)^2 \\ &\qquad + \frac{1}{2}m\Where{r}^2\left(\frac{\Mom{p_\theta}}{m\Where{r}^2}\right)^2 - \Pot{V(r)}\Biggr] \\ &= \frac{\Mom{p_r}^2}{2m} + \frac{\Mom{p_\theta}^2}{2m\Where{r}^2} + \Pot{V(r)}\end{aligned}
Step 5: Differentiate HH to write Hamilton's four first-order equationsTake partial derivatives with respect to the momenta for r˙\Vel{\dot{r}} and θ˙\Vel{\dot{\theta}}, and negative partial derivatives with respect to the coordinates for p˙θ\Mom{\dot{p}_\theta} and p˙r\Mom{\dot{p}_r}.
r˙=∂H∂pr=prm,θ˙=∂H∂pθ=pθmr2p˙θ=−∂H∂θ=0,p˙r=−∂H∂r=pθ2mr3−∂V∂r\displaystyle \begin{aligned}\Vel{\dot{r}} &= \Vel{\frac{\partial H}{\partial p_r}} = \frac{\Mom{p_r}}{m}, \\ \Vel{\dot{\theta}} &= \Vel{\frac{\partial H}{\partial p_\theta}} = \frac{\Mom{p_\theta}}{m\Where{r}^2} \\ \Mom{\dot{p}_\theta} &= -\Force{\frac{\partial H}{\partial \theta}} = 0, \\ \Mom{\dot{p}_r} &= -\Force{\frac{\partial H}{\partial r}} = \frac{\Mom{p_\theta}^2}{m\Where{r}^3} - \Force{\frac{\partial V}{\partial r}}\end{aligned}

Because θ\Where{\theta} is absent from HH, angular momentum pθ\Mom{p_\theta} is constant, and substituting p˙r=mr¨\Mom{\dot{p}_r} = m\Acc{\ddot{r}} and pθ=mr2θ˙\Mom{p_\theta} = m\Where{r}^2\Vel{\dot{\theta}} into the p˙r\Mom{\dot{p}_r} equation recovers the second-order radial equation mr¨m\Acc{\ddot{r}} == mrθ˙2−∂V∂rm\Where{r}\Vel{\dot{\theta}}^2 - \Force{\frac{\partial V}{\partial r}} with the positive outward centrifugal term.

3

Coupled Coordinates and the Quadratic Kinetic Energy Shortcut

When coordinates are coupled by a velocity cross-term like x˙θ˙\Vel{\dot{x}}\Vel{\dot{\theta}}, each conjugate momentum is a mix of both velocities, so Step 3 requires inverting a 2×22 \times 2 linear system.

MM
x\htmlClass{lc-blue}{x}
mm
ℓ\ell
θ\htmlClass{lc-blue}{\theta}
x˙\htmlClass{lc-pink}{\dot{x}}
ℓθ˙\ell\htmlClass{lc-pink}{\dot{\theta}}
Coupled Coordinates and the Quadratic Kinetic Energy Shortcut
L=12(M+m)x˙2+mℓcos⁡θ x˙θ˙+12mℓ2θ˙2+mgℓcos⁡θH(x,θ,px,pθ)=?\displaystyle \small\begin{aligned} L = {} & \tfrac{1}{2}(M + m)\Vel{\dot x}^2 \\ & + m\ell\cos\Where{\theta}\,\Vel{\dot x}\Vel{\dot\theta} \\ & + \tfrac{1}{2}m\ell^2\Vel{\dot\theta}^2 \\ & + \Pot{mg\ell\cos\theta} \\[6pt] H(\Where{x}, \Where{\theta}, \Mom{p_x}, \Mom{p_\theta}) = {} & {?} \end{aligned}
Text solution
Step 1: Write the Lagrangian with the velocity cross-termAdding the cart's horizontal velocity x˙\Vel{\dot{x}} and the pendulum bob's swinging velocity ℓθ˙\ell\Vel{\dot{\theta}} produces an x˙θ˙\Vel{\dot{x}}\Vel{\dot{\theta}} cross-term in T\Kin{T}.
L(x,θ,x˙,θ˙)=12(M+m)x˙2+mℓcos⁡θ x˙θ˙+12mℓ2θ˙2+mgℓcos⁡θ\displaystyle \begin{aligned}L(\Where{x}, \Where{\theta}, \Vel{\dot{x}}, \Vel{\dot{\theta}}) &= \frac{1}{2}(M + m)\Vel{\dot{x}}^2 \\ &\quad + m\ell\cos\Where{\theta}\,\Vel{\dot{x}}\Vel{\dot{\theta}} \\ &\quad + \frac{1}{2}m\ell^2\Vel{\dot{\theta}}^2 \\ &\quad + \Pot{mg\ell\cos\theta}\end{aligned}
Step 2: Find the conjugate momenta and write the 2×22 \times 2 matrix systemDifferentiating LL with respect to x˙\Vel{\dot{x}} and θ˙\Vel{\dot{\theta}} couples both velocities in each momentum equation.
[pxpθ]=[∂L∂x˙∂L∂θ˙]=[M+mmℓcos⁡θmℓcos⁡θmℓ2][x˙θ˙]\displaystyle \begin{bmatrix} \Mom{p_x} \\ \Mom{p_\theta} \end{bmatrix} = \begin{bmatrix} \Mom{\dfrac{\partial L}{\partial \dot{x}}} \\[6pt] \Mom{\dfrac{\partial L}{\partial \dot{\theta}}} \end{bmatrix} = \begin{bmatrix} M + m & m\ell\cos\Where{\theta} \\ m\ell\cos\Where{\theta} & m\ell^2 \end{bmatrix}\begin{bmatrix} \Vel{\dot{x}} \\ \Vel{\dot{\theta}} \end{bmatrix}
Step 3: Invert the 2×22 \times 2 matrix to solve for x˙\Vel{\dot{x}} and θ˙\Vel{\dot{\theta}}Swap the diagonal entries, negate the off-diagonal entries, and divide by the determinant DD == (M+m)mℓ2−m2ℓ2cos⁡2θ(M + m)m\ell^2 - m^2\ell^2\cos^2\Where{\theta} == mℓ2(M+msin⁡2θ)m\ell^2(M + m\sin^2\Where{\theta}).
x˙=mℓ2px−mℓcos⁡θ pθmℓ2(M+msin⁡2θ),θ˙=−mℓcos⁡θ px+(M+m)pθmℓ2(M+msin⁡2θ)\displaystyle \begin{aligned}\Vel{\dot{x}} &= \frac{m\ell^2 \Mom{p_x} - m\ell\cos\Where{\theta}\,\Mom{p_\theta}}{m\ell^2(M + m\sin^2\Where{\theta})}, \\ \Vel{\dot{\theta}} &= \frac{-m\ell\cos\Where{\theta}\,\Mom{p_x} + (M + m)\Mom{p_\theta}}{m\ell^2(M + m\sin^2\Where{\theta})}\end{aligned}
Step 4: Use the quadratic kinetic energy shortcut HH == 12(pxx˙+pθθ˙)+V(θ)\frac{1}{2}(\Mom{p_x}\Vel{\dot{x}} + \Mom{p_\theta}\Vel{\dot{\theta}}) + \Pot{V(\theta)}Because T\Kin{T} contains only quadratic velocity terms (x˙2\Vel{\dot{x}}^2, x˙θ˙\Vel{\dot{x}}\Vel{\dot{\theta}}, and θ˙2\Vel{\dot{\theta}}^2), pxx˙+pθθ˙\Mom{p_x}\Vel{\dot{x}} + \Mom{p_\theta}\Vel{\dot{\theta}} == 2T2\Kin{T}, so we multiply the velocity fractions by 12px\frac{1}{2}\Mom{p_x} and 12pθ\frac{1}{2}\Mom{p_\theta} and add them over their common denominator without squaring them.
H(x,θ,px,pθ)=12(pxx˙+pθθ˙)+V(θ)=mℓ2px2−2mℓcos⁡θ pxpθ+(M+m)pθ22mℓ2(M+msin⁡2θ)−mgℓcos⁡θ\displaystyle \begin{aligned}&H(\Where{x}, \Where{\theta}, \Mom{p_x}, \Mom{p_\theta}) \\ &= \frac{1}{2}\left(\Mom{p_x}\Vel{\dot{x}} + \Mom{p_\theta}\Vel{\dot{\theta}}\right) + \Pot{V(\theta)} \\ &= \frac{\begin{aligned}&m\ell^2 \Mom{p_x}^2 - 2m\ell\cos\Where{\theta}\,\Mom{p_x} \Mom{p_\theta} \\ &+ (M + m)\Mom{p_\theta}^2\end{aligned}}{2m\ell^2(M + m\sin^2\Where{\theta})} \\ &\quad - \Pot{mg\ell\cos\theta}\end{aligned}

Because the cart's position x\Where{x} does not appear in HH, p˙x=−∂H∂x=0\Mom{\dot{p}_x} = -\Force{\frac{\partial H}{\partial x}} = 0, so the horizontal conjugate momentum px\Mom{p_x} is conserved.

4

Moving Coordinates, Total Energy, and Conservation of the Hamiltonian

The relation H=T+VH = \Kin{T} + \Pot{V} fails whenever a moving constraint puts linear velocity terms (T1\Kin{T_1}) or velocity-independent terms (T0\Kin{T_0}) into the kinetic energy. Let's find the Hamiltonian for a mass mm on a spring of stiffness kk attached to a cart pulled to the right at constant speed u\Frame{u} by a motor, using the extension x\Where{x} measured relative to the cart.

u\htmlClass{lc-blue}{u}
kk
mm
ut\htmlClass{lc-blue}{ut}
x\htmlClass{lc-blue}{x}
X=x+ut\htmlClass{lc-blue}{X} = \htmlClass{lc-blue}{x} + \htmlClass{lc-blue}{ut}
Moving Coordinates, Total Energy, and Conservation of the Hamiltonian
T=12m(x˙+u)2H=?T+VdHdt=?\displaystyle \begin{aligned} \Kin{T} &= \tfrac{1}{2}m\left(\Vel{\dot x} + \Frame{u}\right)^2 \\ H &\overset{?}{=} \Kin{T} + \Pot{V} \\ \frac{dH}{dt} &= {?} \end{aligned}
Text solution
Step 1: Expand the Lagrangian in the moving coordinate x\Where{x} into T2\Kin{T_2}, T1\Kin{T_1}, and T0\Kin{T_0} piecesSince the mass has room position X=x+ut\Where{X} = \Where{x} + \Where{ut} and room velocity X˙=x˙+u\Vel{\dot{X}} = \Vel{\dot{x}} + \Frame{u}, expanding T=12m(x˙+u)2\Kin{T} = \frac{1}{2}m(\Vel{\dot{x}} + \Frame{u})^2 produces a quadratic term T2\Kin{T_2}, a linear term T1\Kin{T_1}, and a velocity-independent term T0\Kin{T_0}.
L(x,x˙)=12m(x˙+u)2−12kx2=12mx˙2⏟T2+mux˙⏟T1+12mu2⏟T0−12kx2\displaystyle \begin{aligned}L(\Where{x}, \Vel{\dot{x}}) &= \frac{1}{2}m(\Vel{\dot{x}} + \Frame{u})^2 - \Pot{\frac{1}{2}kx^2} \\ &= \underbrace{\frac{1}{2}m\Vel{\dot{x}}^2}_{\Kin{T_2}} + \underbrace{m\Frame{u}\Vel{\dot{x}}}_{\Kin{T_1}} \\ &\quad + \underbrace{\frac{1}{2}m\Frame{u}^2}_{\Kin{T_0}} - \Pot{\frac{1}{2}kx^2}\end{aligned}
Step 2: Find the conjugate momentum p\Mom{p} and solve for x˙\Vel{\dot{x}}Differentiating LL with respect to x˙\Vel{\dot{x}} picks up the constant shift mum\Frame{u} from the linear term T1\Kin{T_1}.
p\displaystyle \Mom{p} =∂L∂x˙\displaystyle = \Mom{\frac{\partial L}{\partial \dot{x}}} =mx˙+mu  ⟹  x˙\displaystyle = m\Vel{\dot{x}} + m\Frame{u} \implies \Vel{\dot{x}} =p−mum\displaystyle = \frac{\Mom{p} - m\Frame{u}}{m}
Step 3: Compute H=px˙−LH = \Mom{p}\Vel{\dot{x}} - L and substitute x˙=p−mum\Vel{\dot{x}} = \frac{\Mom{p} - m\Frame{u}}{m}In px˙−L\Mom{p}\Vel{\dot{x}} - L, the quadratic piece becomes +T2+\Kin{T_2}, the linear piece mux˙m\Frame{u}\Vel{\dot{x}} cancels out completely, and the velocity-independent piece flips sign to −T0-\Kin{T_0}.
H(x,p)=(mx˙+mu)x˙−(12mx˙2+mux˙+12mu2−12kx2)=12mx˙2−12mu2+12kx2=(p−mu)22m−12mu2+12kx2\displaystyle \begin{aligned}H(\Where{x}, \Mom{p}) &= (m\Vel{\dot{x}} + m\Frame{u})\Vel{\dot{x}} \\ &\quad - \Bigl(\frac{1}{2}m\Vel{\dot{x}}^2 + m\Frame{u}\Vel{\dot{x}} \\ &\qquad + \frac{1}{2}m\Frame{u}^2 - \Pot{\frac{1}{2}kx^2}\Bigr) \\ &= \frac{1}{2}m\Vel{\dot{x}}^2 - \frac{1}{2}m\Frame{u}^2 + \Pot{\frac{1}{2}kx^2} \\ &= \frac{(\Mom{p} - m\Frame{u})^2}{2m} \\ &\quad - \frac{1}{2}m\Frame{u}^2 + \Pot{\frac{1}{2}kx^2}\end{aligned}
Step 4: Compare H(x,p)H(\Where{x}, \Mom{p}) with the room-coordinate Hamiltonian H(X,P,t)H(\Where{X}, \Mom{P}, t)In the room coordinate X\Where{X}, the kinetic energy is purely quadratic (T=12mX˙2\Kin{T} = \frac{1}{2}m\Vel{\dot{X}}^2) and the spring potential is 12k(X−ut)2\Pot{\frac{1}{2}k(X - ut)^2}, so H(X,P,t)H(\Where{X}, \Mom{P}, t) equals the total room energy T+V\Kin{T} + \Pot{V} but contains tt explicitly.
H(X,P,t)=P22m+12k(X−ut)2=T+V,dH(X,P,t)dt=∂H∂t≠0\displaystyle \begin{aligned}H(\Where{X}, \Mom{P}, t) &= \frac{\Mom{P}^2}{2m} \\ &\quad + \Pot{\frac{1}{2}k(X - ut)^2} \\ &= \Kin{T} + \Pot{V}, \\ \frac{dH(\Where{X}, \Mom{P}, t)}{dt} &= \frac{\partial H}{\partial t} \neq 0\end{aligned}

In the moving coordinate x\Where{x}, H(x,p)H(\Where{x}, \Mom{p}) does not equal the total room energy EE == T+V\Kin{T} + \Pot{V} == p22m+12kx2\frac{\Mom{p}^2}{2m} + \Pot{\frac{1}{2}kx^2} because T\Kin{T} has the T1\Kin{T_1} and T0\Kin{T_0} pieces, and EE is not conserved because the motor does work on the spring, yet H(x,p)H(\Where{x}, \Mom{p}) is strictly conserved (∂H∂t=0\frac{\partial H}{\partial t} = 0) because u\Frame{u} is constant and tt does not appear explicitly in HH.

5

Phase Space and Flow Along Constant-HH Contours

On a 1D position line x\Where{x}, a single dot does not tell us the particle's velocity, so paths moving at different velocities cross over each other. Plotting position x\Where{x} and momentum p\Mom{p} as the axes of a 2D plane called phase space gives every state (x,p)(\Where{x}, \Mom{p}) a unique velocity vector (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}).

Phase Space and Flow Along Constant-H Contours
x\htmlClass{lc-blue}{x}
p\htmlClass{lc-green}{p}
−3\htmlClass{lc-mute}{-3}
−2\htmlClass{lc-mute}{-2}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
(x˙,p˙)=?(\Vel{\dot x}, \Mom{\dot p}) = {?}

Comparing the uphill gradient vector ∇H\nabla H on the H(x,p)H(\Where{x}, \Mom{p}) surface with the phase-space velocity vector (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) from Hamilton's equations shows that their components are swapped with one sign flipped:

∇H=(∂H∂x,∂H∂p),(x˙,p˙)=(∂H∂p,−∂H∂x)\displaystyle \begin{aligned}\nabla H &= \left(\Force{\frac{\partial H}{\partial x}}, \Vel{\frac{\partial H}{\partial p}}\right), \\ (\Vel{\dot{x}}, \Mom{\dot{p}}) &= \left(\Vel{\frac{\partial H}{\partial p}}, -\Force{\frac{\partial H}{\partial x}}\right)\end{aligned}

At every point (x,p)(\Where{x}, \Mom{p}), this makes the phase-space velocity (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) a 90∘90^\circ rotation of the uphill gradient ∇H\nabla H. When H(x,p)H(\Where{x}, \Mom{p}) does not depend on time, the trajectory stays tangent to a single constant-HH contour, and two phase-space paths never cross.

Turning the uphill direction by 90 degrees keeps the velocity tangent to the contour at every point, so the motion never climbs or drops across contours and two paths never cross.

Key concepts

To go from a Lagrangian L(q,q˙,t)L(\Where{q}, \Vel{\dot{q}}, t) to Hamilton's equations, find each conjugate momentum pi=∂L∂q˙i\Mom{p_i} = \Mom{\frac{\partial L}{\partial \dot{q}_i}}, invert to get the velocities q˙i(q,p,t)\Vel{\dot{q}_i}(\Where{q}, \Mom{p}, t), and eliminate all velocities inside the Hamiltonian:

H(q,p,t)=∑ipiq˙i−L(q,q˙,t),q˙i=∂H∂pi,p˙i=−∂H∂qi,dHdt=∂H∂t=−∂L∂t\displaystyle \begin{aligned}H(\Where{q}, \Mom{p}, t) &= \sum_i \Mom{p_i}\Vel{\dot{q}_i} - L(\Where{q}, \Vel{\dot{q}}, t), \\ \Vel{\dot{q}_i} &= \Vel{\frac{\partial H}{\partial p_i}}, \qquad \Mom{\dot{p}_i} = -\Force{\frac{\partial H}{\partial q_i}}, \\ \frac{dH}{dt} &= \frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t}\end{aligned}

Never plug q˙i(q,p)\Vel{\dot{q}_i}(\Where{q}, \Mom{p}) directly into LL without forming ∑ipiq˙i−L\sum_i \Mom{p_i}\Vel{\dot{q}_i} - L first, because differentiating with pi\Mom{p_i} held fixed flips the sign of coordinate-dependent kinetic terms like 12mr2θ˙2→pθ22mr2\frac{1}{2}m\Where{r}^2\Vel{\dot{\theta}}^2 \to \frac{\Mom{p_\theta}^2}{2m\Where{r}^2}. How you simplify HH depends on how the velocities appear in T\Kin{T}:

Key concept

When T\Kin{T} has uncoupled quadratic velocities (such as T\Kin{T} == 12mr˙2+12mr2θ˙2\frac{1}{2}m\Vel{\dot{r}}^2 + \frac{1}{2}m\Where{r}^2\Vel{\dot{\theta}}^2), each momentum isolates a single velocity (pθ=mr2θ˙\Mom{p_\theta} = m\Where{r}^2\Vel{\dot{\theta}}), so you don't need a matrix inversion and can write HH == T+V\Kin{T} + \Pot{V} == pr22m+pθ22mr2+V(r)\frac{\Mom{p_r}^2}{2m} + \frac{\Mom{p_\theta}^2}{2m\Where{r}^2} + \Pot{V(r)} directly.

Key concept

When T\Kin{T} has coupled quadratic velocities (such as a cross-term mℓcos⁡θ x˙θ˙m\ell\cos\Where{\theta}\,\Vel{\dot{x}}\Vel{\dot{\theta}}), invert the 2×22 \times 2 momentum matrix for x˙\Vel{\dot{x}} and θ˙\Vel{\dot{\theta}} and use the quadratic shortcut HH == 12(pxx˙+pθθ˙)+V\frac{1}{2}(\Mom{p_x}\Vel{\dot{x}} + \Mom{p_\theta}\Vel{\dot{\theta}}) + \Pot{V} so you don't have to square the velocity fractions.

Key concept

When moving or rotating constraints introduce linear (T1\Kin{T_1}) or velocity-independent (T0\Kin{T_0}) terms in T\Kin{T} (such as T\Kin{T} == 12m(x˙+u)2\frac{1}{2}m(\Vel{\dot{x}} + \Frame{u})^2 == 12mx˙2+mux˙+12mu2\frac{1}{2}m\Vel{\dot{x}}^2 + m\Frame{u}\Vel{\dot{x}} + \frac{1}{2}m\Frame{u}^2), do not use H=T+VH = \Kin{T} + \Pot{V} or the 12∑ipiq˙i\frac{1}{2}\sum_i \Mom{p_i}\Vel{\dot{q}_i} shortcut; write out H=∑ipiq˙i−LH = \sum_i \Mom{p_i}\Vel{\dot{q}_i} - L in full, where T1\Kin{T_1} cancels out and +T0+\Kin{T_0} flips to −T0-\Kin{T_0}. Even when H≠T+VH \neq \Kin{T} + \Pot{V}, HH is conserved whenever tt is absent from HH, and any coordinate qi\Where{q_i} missing from HH gives a conserved momentum pi\Mom{p_i}.

6

Practice

1

A bead of mass mm slides without friction along a curved wire with V(q)=0\Pot{V(q)} = 0 and kinetic energy T=12m(1+αq2)q˙2\Kin{T} = \frac{1}{2}m(1 + \alpha \Where{q}^2)\Vel{\dot{q}}^2, where α\alpha is a positive constant. (a) Find the conjugate momentum p\Mom{p}, solve for q˙\Vel{\dot{q}} in terms of q\Where{q} and p\Mom{p}, and compute both (∂T∂q)q˙\left(\frac{\partial \Kin{T}}{\partial \Where{q}}\right)_{\Vel{\dot{q}}} (holding q˙\Vel{\dot{q}} fixed) and (∂T∂q)p\left(\frac{\partial \Kin{T}}{\partial \Where{q}}\right)_{\Mom{p}} (after eliminating q˙\Vel{\dot{q}} in favor of p\Mom{p} and holding p\Mom{p} fixed). Explain physically why the two partial derivatives have opposite signs. (b) Construct H(q,p)=pq˙−LH(\Where{q}, \Mom{p}) = \Mom{p}\Vel{\dot{q}} - L and show how Hamilton's equation p˙=−∂H∂q\Mom{\dot{p}} = -\Force{\frac{\partial H}{\partial q}} restores the correct sign to match the Euler-Lagrange equation p˙=(∂L∂q)q˙\Mom{\dot{p}} = \left(\Force{\frac{\partial L}{\partial q}}\right)_{\Vel{\dot{q}}}.

In part (a), when you plug q˙=pm(1+αq2)\Vel{\dot{q}} = \frac{\Mom{p}}{m(1 + \alpha \Where{q}^2)} into T=12m(1+αq2)q˙2\Kin{T} = \frac{1}{2}m(1 + \alpha \Where{q}^2)\Vel{\dot{q}}^2, notice how many powers of (1+αq2)(1 + \alpha \Where{q}^2) cancel and where the remaining factor sits.

(a) Since V(q)=0\Pot{V(q)} = 0, LL == T\Kin{T} == 12m(1+αq2)q˙2\frac{1}{2}m(1 + \alpha \Where{q}^2)\Vel{\dot{q}}^2. Differentiating with respect to q\Where{q} while holding q˙\Vel{\dot{q}} fixed gives:
(∂T∂q)q˙=∂∂q[12m(1+αq2)q˙2]=+mαqq˙2\displaystyle \begin{aligned}\left(\frac{\partial \Kin{T}}{\partial \Where{q}}\right)_{\Vel{\dot{q}}} &= \frac{\partial}{\partial \Where{q}}\left[\frac{1}{2}m(1 + \alpha \Where{q}^2)\Vel{\dot{q}}^2\right] \\ &= +m\alpha \Where{q}\Vel{\dot{q}}^2\end{aligned}
The conjugate momentum is:
p\displaystyle \Mom{p} =∂L∂q˙\displaystyle = \Mom{\frac{\partial L}{\partial \dot{q}}} =m(1+αq2)q˙  ⟹  q˙\displaystyle = m(1 + \alpha \Where{q}^2)\Vel{\dot{q}} \implies \Vel{\dot{q}} =pm(1+αq2)\displaystyle = \frac{\Mom{p}}{m(1 + \alpha \Where{q}^2)}
Substituting q˙(q,p)\Vel{\dot{q}}(\Where{q}, \Mom{p}) into T\Kin{T} puts one factor of (1+αq2)(1 + \alpha \Where{q}^2) into the denominator:
T(q,p)=12m(1+αq2)[pm(1+αq2)]2=p22m(1+αq2)\displaystyle \begin{aligned}&\Kin{T}(\Where{q}, \Mom{p}) \\ &= \frac{1}{2}m(1 + \alpha \Where{q}^2)\left[\frac{\Mom{p}}{m(1 + \alpha \Where{q}^2)}\right]^2 \\ &= \frac{\Mom{p}^2}{2m(1 + \alpha \Where{q}^2)}\end{aligned}
(Warning: Do not forget to square (1+αq2)(1 + \alpha \Where{q}^2) when squaring q˙\Vel{\dot{q}}, which would cancel (1+αq2)(1 + \alpha \Where{q}^2) completely and give p22m\frac{\Mom{p}^2}{2m} with a derivative of 00; and when differentiating (1+αq2)−1(1 + \alpha \Where{q}^2)^{-1}, remember the negative power rule factor −1-1, or you will get +mαqq˙2+m\alpha \Where{q}\Vel{\dot{q}}^2 here and the wrong sign in part (b).)
Differentiating T(q,p)\Kin{T}(\Where{q}, \Mom{p}) with respect to q\Where{q} while holding p\Mom{p} fixed gives:
(∂T∂q)p=∂∂q[p22m(1+αq2)−1]=−αqp2m(1+αq2)2=−mαqq˙2\displaystyle \begin{aligned}\left(\frac{\partial \Kin{T}}{\partial \Where{q}}\right)_{\Mom{p}} &= \frac{\partial}{\partial \Where{q}}\left[\frac{\Mom{p}^2}{2m}(1 + \alpha \Where{q}^2)^{-1}\right] \\ &= -\frac{\alpha \Where{q} \Mom{p}^2}{m(1 + \alpha \Where{q}^2)^2} = -m\alpha \Where{q}\Vel{\dot{q}}^2\end{aligned}
The two partial derivatives have opposite signs because increasing q\Where{q} at fixed velocity q˙\Vel{\dot{q}} increases the effective inertia factor m(1+αq2)m(1 + \alpha \Where{q}^2) and raises T\Kin{T}, whereas increasing q\Where{q} at fixed momentum p\Mom{p} forces q˙=pm(1+αq2)\Vel{\dot{q}} = \frac{\Mom{p}}{m(1 + \alpha \Where{q}^2)} to decrease so rapidly that T\Kin{T} drops.
(b) Building H(q,p)=pq˙−LH(\Where{q}, \Mom{p}) = \Mom{p}\Vel{\dot{q}} - L gives:
H(q,p)=p[pm(1+αq2)]−p22m(1+αq2)=p22m(1+αq2)\displaystyle \begin{aligned}H(\Where{q}, \Mom{p}) &= \Mom{p}\left[\frac{\Mom{p}}{m(1 + \alpha \Where{q}^2)}\right] \\ &\quad - \frac{\Mom{p}^2}{2m(1 + \alpha \Where{q}^2)} \\ &= \frac{\Mom{p}^2}{2m(1 + \alpha \Where{q}^2)}\end{aligned}
Applying Hamilton's equation p˙=−∂H∂q\Mom{\dot{p}} = -\Force{\frac{\partial H}{\partial q}} introduces a minus sign that flips −αqp2m(1+αq2)2-\frac{\alpha \Where{q} \Mom{p}^2}{m(1 + \alpha \Where{q}^2)^2} back to positive, matching p˙=(∂L∂q)q˙\Mom{\dot{p}} = \left(\Force{\frac{\partial L}{\partial q}}\right)_{\Vel{\dot{q}}}:
p˙=−∂H∂q=−[−αqp2m(1+αq2)2]=+αqp2m(1+αq2)2=+mαqq˙2\displaystyle \begin{aligned}\Mom{\dot{p}} &= -\Force{\frac{\partial H}{\partial q}} = -\left[-\frac{\alpha \Where{q} \Mom{p}^2}{m(1 + \alpha \Where{q}^2)^2}\right] \\ &= +\frac{\alpha \Where{q} \Mom{p}^2}{m(1 + \alpha \Where{q}^2)^2} = +m\alpha \Where{q}\Vel{\dot{q}}^2\end{aligned}
2

At a fixed position x0\Where{x_0} and time t0t_0, a particle's Lagrangian L(x0,v,t0)L(\Where{x_0}, \Vel{v}, t_0) is plotted as a function of velocity v\Vel{v}. At v=4.0 m/s\Vel{v} = 4.0\text{ m/s}, the height of the curve is L=10 JL = 10\text{ J} and the tangent line to the curve has slope 12 kg⋅m/s12\text{ kg}\cdot\text{m/s}. (a) What are the conjugate momentum p\Mom{p} and the Hamiltonian HH at this state, and where does the tangent line intersect the vertical axis at v=0\Vel{v} = 0? (b) If a small nudge changes the momentum by dp=0.50 kg⋅m/s\Mom{dp} = 0.50\text{ kg}\cdot\text{m/s} while x0\Where{x_0} and t0t_0 are held fixed, by how much does HH change, and why does the accompanying change dv\Vel{dv} not contribute to dHdH?

For part (a), how much does a line of slope p\Mom{p} drop as you trace it back from v=4.0 m/s\Vel{v} = 4.0\text{ m/s} to v=0\Vel{v} = 0? For part (b), use Hamilton's equation for ∂H∂p\Vel{\frac{\partial H}{\partial p}}.

(a) The conjugate momentum is the velocity slope of LL, so:
p\displaystyle \Mom{p} =∂L∂v\displaystyle = \Mom{\frac{\partial L}{\partial v}} =12 kg⋅m/s\displaystyle = 12\text{ kg}\cdot\text{m/s}
The Hamiltonian is:
H=pv−L=(12 kg⋅m/s)(4.0 m/s)−10 J=48 J−10 J=38 J\displaystyle \begin{aligned}H &= \Mom{p}\Vel{v} - L \\ &= (12\text{ kg}\cdot\text{m/s})(4.0\text{ m/s}) - 10\text{ J} \\ &= 48\text{ J} - 10\text{ J} = 38\text{ J}\end{aligned}
(Warning: Do not swap the subtraction to L−pv=10 J−48 J=−38 JL - \Mom{p}\Vel{v} = 10\text{ J} - 48\text{ J} = -38\text{ J} when finding HH; −38 J-38\text{ J} is the signed coordinate of the vertical intercept on the LL-axis, whereas H=pv−L=+38 JH = \Mom{p}\Vel{v} - L = +38\text{ J} is the depth below zero.)
Tracing the tangent line back from v=4.0 m/s\Vel{v} = 4.0\text{ m/s} to v=0\Vel{v} = 0 drops its height by pv=48 J\Mom{p}\Vel{v} = 48\text{ J} from L=10 JL = 10\text{ J}, so it intersects the vertical axis at 10 J−48 J=−38 J10\text{ J} - 48\text{ J} = -38\text{ J} (a depth of H=38 JH = 38\text{ J} below zero).
(b) With dx=0\Nudge{dx} = 0 and dt=0dt = 0, Hamilton's equation ∂H∂p=x˙=v\Vel{\frac{\partial H}{\partial p}} = \Vel{\dot{x}} = \Vel{v} gives:
dH=∂H∂pdp=v dp=(4.0 m/s)(0.50 kg⋅m/s)=2.0 J\displaystyle \begin{aligned}dH &= \Vel{\frac{\partial H}{\partial p}}\Mom{dp} = \Vel{v}\,\Mom{dp} \\ &= (4.0\text{ m/s})(0.50\text{ kg}\cdot\text{m/s}) \\ &= 2.0\text{ J}\end{aligned}
(Warning: Do not multiply p dp\Mom{p}\,\Mom{dp} == (12)(0.50)(12)(0.50) == 6.0 kg2⋅m2/s26.0\text{ kg}^2\cdot\text{m}^2/\text{s}^2; the slope of HH with respect to p\Mom{p} is v=4.0 m/s\Vel{v} = 4.0\text{ m/s}, not p\Mom{p}.)
The accompanying velocity change dv\Vel{dv} does not contribute to dHdH because d(pv)d(\Mom{p}\Vel{v}) == v dp+p dv\Vel{v}\,\Mom{dp} + \Mom{p}\,\Vel{dv} and dL=p dvdL = \Mom{p}\,\Vel{dv} (at fixed x0\Where{x_0} and t0t_0) contain the exact same +p dv+\Mom{p}\,\Vel{dv} term, which cancels out in dHdH == d(pv)−dLd(\Mom{p}\Vel{v}) - dL == v dp\Vel{v}\,\Mom{dp}.
3

A spherical pendulum consists of a bob of mass mm on a rigid massless rod of length ℓ\ell swinging in uniform gravity gg. Using the polar angle θ\Where{\theta} from the downward vertical and the azimuthal angle ϕ\Where{\phi} around the vertical axis, its Lagrangian is L(θ,ϕ,θ˙,ϕ˙)L(\Where{\theta}, \Where{\phi}, \Vel{\dot{\theta}}, \Vel{\dot{\phi}}) == 12mℓ2(θ˙2+sin⁡2θ ϕ˙2)+mgℓcos⁡θ\frac{1}{2}m\ell^2(\Vel{\dot{\theta}}^2 + \sin^2\Where{\theta}\,\Vel{\dot{\phi}}^2) + \Pot{mg\ell\cos\theta}. (a) Find the conjugate momenta pθ\Mom{p_\theta} and pϕ\Mom{p_\phi} and construct the Hamiltonian H(θ,ϕ,pθ,pϕ)H(\Where{\theta}, \Where{\phi}, \Mom{p_\theta}, \Mom{p_\phi}). (b) Write all four of Hamilton's equations, identify the conserved momentum, and combine the first-order equations to recover the second-order differential equation for θ¨\Acc{\ddot{\theta}}.

In L=T−VL = \Kin{T} - \Pot{V}, check the sign of V(θ)=−mgℓcos⁡θ\Pot{V(\theta)} = -\Pot{mg\ell\cos\theta} when building HH. In part (b), write 1sin⁡2θ\frac{1}{\sin^2\Where{\theta}} as (sin⁡θ)−2(\sin\Where{\theta})^{-2} before differentiating with respect to θ\Where{\theta}.

(a) Step 1: The Lagrangian is LL == 12mℓ2(θ˙2+sin⁡2θ ϕ˙2)+mgℓcos⁡θ\frac{1}{2}m\ell^2(\Vel{\dot{\theta}}^2 + \sin^2\Where{\theta}\,\Vel{\dot{\phi}}^2) + \Pot{mg\ell\cos\theta}. Step 2: Differentiating LL with respect to θ˙\Vel{\dot{\theta}} and ϕ˙\Vel{\dot{\phi}} gives the conjugate momenta:
pθ\displaystyle \Mom{p_\theta} =∂L∂θ˙\displaystyle = \Mom{\frac{\partial L}{\partial \dot{\theta}}} =mℓ2θ˙,pϕ\displaystyle = m\ell^2\Vel{\dot{\theta}}, \qquad \Mom{p_\phi} =∂L∂ϕ˙\displaystyle = \Mom{\frac{\partial L}{\partial \dot{\phi}}} =mℓ2sin⁡2θ ϕ˙\displaystyle = m\ell^2\sin^2\Where{\theta}\,\Vel{\dot{\phi}}
Step 3Inverting for the angular velocities gives:
θ˙\displaystyle \Vel{\dot{\theta}} =pθmℓ2,ϕ˙\displaystyle = \frac{\Mom{p_\theta}}{m\ell^2}, \qquad \Vel{\dot{\phi}} =pϕmℓ2sin⁡2θ\displaystyle = \frac{\Mom{p_\phi}}{m\ell^2\sin^2\Where{\theta}}
Step 4Substituting θ˙\Vel{\dot{\theta}} and ϕ˙\Vel{\dot{\phi}} into H=pθθ˙+pϕϕ˙−LH = \Mom{p_\theta}\Vel{\dot{\theta}} + \Mom{p_\phi}\Vel{\dot{\phi}} - L gives:
H(θ,ϕ,pθ,pϕ)\displaystyle H(\Where{\theta}, \Where{\phi}, \Mom{p_\theta}, \Mom{p_\phi}) =pθ22mℓ2+pϕ22mℓ2sin⁡2θ−mgℓcos⁡θ\displaystyle = \frac{\Mom{p_\theta}^2}{2m\ell^2} + \frac{\Mom{p_\phi}^2}{2m\ell^2\sin^2\Where{\theta}} - \Pot{mg\ell\cos\theta}
(Warning: Do not keep +mgℓcos⁡θ+\Pot{mg\ell\cos\theta} with a plus sign in HH; since L=T−VL = \Kin{T} - \Pot{V} has V(θ)=−mgℓcos⁡θ\Pot{V(\theta)} = -\Pot{mg\ell\cos\theta}, subtracting LL flips the potential term to −mgℓcos⁡θ-\Pot{mg\ell\cos\theta} in H=T+VH = \Kin{T} + \Pot{V}.)
(b) Differentiating HH gives Hamilton's four equations:
θ˙=∂H∂pθ=pθmℓ2,ϕ˙=∂H∂pϕ=pϕmℓ2sin⁡2θp˙ϕ=−∂H∂ϕ=0,p˙θ=−∂H∂θ=pϕ2cos⁡θmℓ2sin⁡3θ−mgℓsin⁡θ\displaystyle \begin{aligned}\Vel{\dot{\theta}} &= \Vel{\frac{\partial H}{\partial p_\theta}} = \frac{\Mom{p_\theta}}{m\ell^2}, \\ \Vel{\dot{\phi}} &= \Vel{\frac{\partial H}{\partial p_\phi}} = \frac{\Mom{p_\phi}}{m\ell^2\sin^2\Where{\theta}} \\ \Mom{\dot{p}_\phi} &= -\Force{\frac{\partial H}{\partial \phi}} = 0, \\ \Mom{\dot{p}_\theta} &= -\Force{\frac{\partial H}{\partial \theta}} \\ &= \frac{\Mom{p_\phi}^2\cos\Where{\theta}}{m\ell^2\sin^3\Where{\theta}} - mg\ell\sin\Where{\theta}\end{aligned}
(Warning: When computing p˙θ=−∂H∂θ\Mom{\dot{p}_\theta} = -\Force{\frac{\partial H}{\partial \theta}}, remember that ∂∂θ(sin⁡−2θ)\frac{\partial}{\partial \Where{\theta}}(\sin^{-2}\Where{\theta}) == −2sin⁡−3θcos⁡θ-2\sin^{-3}\Where{\theta}\cos\Where{\theta} already carries a minus sign, which combines with the minus sign in −∂H∂θ-\Force{\frac{\partial H}{\partial \theta}} to make the centrifugal term +pϕ2cos⁡θmℓ2sin⁡3θ+\frac{\Mom{p_\phi}^2\cos\Where{\theta}}{m\ell^2\sin^3\Where{\theta}}, not negative.)
Because ϕ\Where{\phi} is absent from HH, pϕ\Mom{p_\phi} is conserved. Differentiating pθ=mℓ2θ˙\Mom{p_\theta} = m\ell^2\Vel{\dot{\theta}} gives p˙θ=mℓ2θ¨\Mom{\dot{p}_\theta} = m\ell^2\Acc{\ddot{\theta}}, and substituting pϕ=mℓ2sin⁡2θ ϕ˙\Mom{p_\phi} = m\ell^2\sin^2\Where{\theta}\,\Vel{\dot{\phi}} into the p˙θ\Mom{\dot{p}_\theta} equation yields:
mℓ2θ¨=(mℓ2sin⁡2θ ϕ˙)2cos⁡θmℓ2sin⁡3θ−mgℓsin⁡θ=mℓ2sin⁡θcos⁡θ ϕ˙2−mgℓsin⁡θθ¨=sin⁡θcos⁡θ ϕ˙2−gℓsin⁡θ\displaystyle \begin{aligned}m\ell^2\Acc{\ddot{\theta}} &= \frac{(m\ell^2\sin^2\Where{\theta}\,\Vel{\dot{\phi}})^2\cos\Where{\theta}}{m\ell^2\sin^3\Where{\theta}} \\ &\quad - mg\ell\sin\Where{\theta} \\ &= m\ell^2\sin\Where{\theta}\cos\Where{\theta}\,\Vel{\dot{\phi}}^2 - mg\ell\sin\Where{\theta} \\ \Acc{\ddot{\theta}} &= \sin\Where{\theta}\cos\Where{\theta}\,\Vel{\dot{\phi}}^2 - \frac{g}{\ell}\sin\Where{\theta}\end{aligned}
4

A wedge of mass MM and incline angle α\alpha slides without friction along a horizontal table at position x\Where{x}, while a block of mass mm slides a distance s\Where{s} down the wedge's incline relative to the wedge. The Lagrangian is L(x,s,x˙,s˙)L(\Where{x}, \Where{s}, \Vel{\dot{x}}, \Vel{\dot{s}}) == 12(M+m)x˙2+mcos⁡α x˙s˙+12ms˙2+mgssin⁡α\frac{1}{2}(M + m)\Vel{\dot{x}}^2 + m\cos\alpha\,\Vel{\dot{x}}\Vel{\dot{s}} + \frac{1}{2}m\Vel{\dot{s}}^2 + \Pot{mgs\sin\alpha}. (a) Find the conjugate momenta px\Mom{p_x} and ps\Mom{p_s}, write them as a 2×22 \times 2 matrix equation, and invert the matrix to solve for x˙\Vel{\dot{x}} and s˙\Vel{\dot{s}} in terms of px\Mom{p_x} and ps\Mom{p_s}. (b) Use the quadratic kinetic energy shortcut HH == 12(pxx˙+pss˙)+V(s)\frac{1}{2}(\Mom{p_x}\Vel{\dot{x}} + \Mom{p_s}\Vel{\dot{s}}) + \Pot{V(s)} to write H(x,s,px,ps)H(\Where{x}, \Where{s}, \Mom{p_x}, \Mom{p_s}), and identify which conjugate momentum is conserved.

In part (a), use 1−cos⁡2α=sin⁡2α1 - \cos^2\alpha = \sin^2\alpha to simplify the determinant DD of the 2×22 \times 2 matrix before writing x˙\Vel{\dot{x}} and s˙\Vel{\dot{s}}.

(a) Differentiating LL with respect to x˙\Vel{\dot{x}} and s˙\Vel{\dot{s}} gives the conjugate momenta:
px=∂L∂x˙=(M+m)x˙+mcos⁡α s˙,ps=∂L∂s˙=mcos⁡α x˙+ms˙\displaystyle \begin{aligned}\Mom{p_x} &= \Mom{\frac{\partial L}{\partial \dot{x}}} = (M + m)\Vel{\dot{x}} + m\cos\alpha\,\Vel{\dot{s}}, \\ \Mom{p_s} &= \Mom{\frac{\partial L}{\partial \dot{s}}} = m\cos\alpha\,\Vel{\dot{x}} + m\Vel{\dot{s}}\end{aligned}
In matrix form:
[pxps]=[M+mmcos⁡αmcos⁡αm][x˙s˙]\displaystyle \begin{bmatrix} \Mom{p_x} \\ \Mom{p_s} \end{bmatrix} = \begin{bmatrix} M + m & m\cos\alpha \\ m\cos\alpha & m \end{bmatrix}\begin{bmatrix} \Vel{\dot{x}} \\ \Vel{\dot{s}} \end{bmatrix}
The determinant of the 2×22 \times 2 matrix is:
D\displaystyle D =(M+m)m−m2cos⁡2α\displaystyle = (M + m)m - m^2\cos^2\alpha =m(M+msin⁡2α)\displaystyle = m(M + m\sin^2\alpha)
(Warning: When inverting the 2×22 \times 2 matrix, be sure to swap the diagonal entries M+mM + m and mm as well as negating the off-diagonal mcos⁡αm\cos\alpha entries; leaving M+mM + m in the top-left position gives the wrong numerator (M+m)px−mcos⁡α ps(M + m)\Mom{p_x} - m\cos\alpha\,\Mom{p_s} for x˙\Vel{\dot{x}} and swaps the coefficients of px2\Mom{p_x}^2 and ps2\Mom{p_s}^2 in HH.)
Swapping the diagonal entries, negating the off-diagonal entries, and dividing by DD gives:
x˙=mpx−mcos⁡α psm(M+msin⁡2α)=px−cos⁡α psM+msin⁡2α,s˙=−mcos⁡α px+(M+m)psm(M+msin⁡2α)\displaystyle \begin{aligned}\Vel{\dot{x}} &= \frac{m\Mom{p_x} - m\cos\alpha\,\Mom{p_s}}{m(M + m\sin^2\alpha)} \\ &= \frac{\Mom{p_x} - \cos\alpha\,\Mom{p_s}}{M + m\sin^2\alpha}, \\ \Vel{\dot{s}} &= \frac{-m\cos\alpha\,\Mom{p_x} + (M + m)\Mom{p_s}}{m(M + m\sin^2\alpha)}\end{aligned}
(b) Since T\Kin{T} is purely quadratic in the velocities and V(s)=−mgssin⁡α\Pot{V(s)} = -\Pot{mgs\sin\alpha}, the quadratic kinetic energy shortcut gives:
H(x,s,px,ps)=12(pxx˙+pss˙)+V(s)=mpx2−2mcos⁡α pxps+(M+m)ps22m(M+msin⁡2α)−mgssin⁡α\displaystyle \begin{aligned}&H(\Where{x}, \Where{s}, \Mom{p_x}, \Mom{p_s}) \\ &= \frac{1}{2}\left(\Mom{p_x}\Vel{\dot{x}} + \Mom{p_s}\Vel{\dot{s}}\right) + \Pot{V(s)} \\ &= \frac{\begin{aligned}&m\Mom{p_x}^2 - 2m\cos\alpha\,\Mom{p_x} \Mom{p_s} \\ &+ (M + m)\Mom{p_s}^2\end{aligned}}{2m(M + m\sin^2\alpha)} \\ &\quad - \Pot{mgs\sin\alpha}\end{aligned}
Because x\Where{x} does not appear in HH, p˙x=−∂H∂x=0\Mom{\dot{p}_x} = -\Force{\frac{\partial H}{\partial x}} = 0, so px\Mom{p_x} is conserved.
5

A bead of mass mm slides without friction on a vertical circular hoop of radius RR that a motor spins about its vertical diameter at a constant angular speed ω\omega. Using the bead's angle θ\Where{\theta} from the bottom of the hoop, the kinetic energy is T\Kin{T} == 12mR2θ˙2+12mR2ω2sin⁡2θ\frac{1}{2}mR^2\Vel{\dot{\theta}}^2 + \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta} and the gravitational potential energy is V(θ)=−mgRcos⁡θ\Pot{V(\theta)} = -\Pot{mgR\cos\theta}. (a) Find H(θ,pθ)H(\Where{\theta}, \Mom{p_\theta}) and compare it to the total mechanical energy E=T+VE = \Kin{T} + \Pot{V}. Explain why H≠T+VH \neq \Kin{T} + \Pot{V} and why HH is conserved even though EE is not. (b) If the motor instead ramps up the spin rate so that ω(t)=αt\omega(t) = \alpha t (with α\alpha constant), find dHdt\frac{dH}{dt} and state whether HH is conserved.

Separate T\Kin{T} into its quadratic piece T2=12mR2θ˙2\Kin{T_2} = \frac{1}{2}mR^2\Vel{\dot{\theta}}^2 and its velocity-independent piece T0=12mR2ω2sin⁡2θ\Kin{T_0} = \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta}, and watch what happens to T0\Kin{T_0} in H=pθθ˙−LH = \Mom{p_\theta}\Vel{\dot{\theta}} - L.

(a) Step 1: The Lagrangian is L(θ,θ˙)L(\Where{\theta}, \Vel{\dot{\theta}}) == T−V\Kin{T} - \Pot{V} == 12mR2θ˙2+12mR2ω2sin⁡2θ+mgRcos⁡θ\frac{1}{2}mR^2\Vel{\dot{\theta}}^2 + \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta} + \Pot{mgR\cos\theta}. Step 2: The conjugate momentum is pθ=∂L∂θ˙=mR2θ˙\Mom{p_\theta} = \Mom{\frac{\partial L}{\partial \dot{\theta}}} = mR^2\Vel{\dot{\theta}}. Step 3: Solving for θ˙\Vel{\dot{\theta}} gives θ˙=pθmR2\Vel{\dot{\theta}} = \frac{\Mom{p_\theta}}{mR^2}. Step 4: Computing H=pθθ˙−LH = \Mom{p_\theta}\Vel{\dot{\theta}} - L gives:
H(θ,pθ)\displaystyle H(\Where{\theta}, \Mom{p_\theta}) =pθ22mR2−12mR2ω2sin⁡2θ−mgRcos⁡θ\displaystyle = \frac{\Mom{p_\theta}^2}{2mR^2} - \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta} - \Pot{mgR\cos\theta}
(Warning: Do not use the shortcut H=T+VH = \Kin{T} + \Pot{V} here, which would give +12mR2ω2sin⁡2θ+\frac{1}{2}mR^2\omega^2\sin^2\Where{\theta}; the rotating hoop constraint puts a velocity-independent piece T0=12mR2ω2sin⁡2θ\Kin{T_0} = \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta} into T\Kin{T}, and subtracting LL flips +T0+\Kin{T_0} to −T0-\Kin{T_0}.)
In contrast, the total mechanical energy is:
E\displaystyle E =T+V\displaystyle = \Kin{T} + \Pot{V} =pθ22mR2+12mR2ω2sin⁡2θ−mgRcos⁡θ\displaystyle = \frac{\Mom{p_\theta}^2}{2mR^2} + \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta} - \Pot{mgR\cos\theta}
First check (H=T+VH = \Kin{T} + \Pot{V}?): H≠T+VH \neq \Kin{T} + \Pot{V} because the moving constraint of the spinning hoop introduces the velocity-independent term T0=12mR2ω2sin⁡2θ\Kin{T_0} = \frac{1}{2}mR^2\omega^2\sin^2\Where{\theta} into T\Kin{T}, which becomes −T0-\Kin{T_0} in H=pθθ˙−LH = \Mom{p_\theta}\Vel{\dot{\theta}} - L. Second check (Is HH conserved?): Since ω\omega is constant, time tt does not appear explicitly in HH (∂H∂t=0\frac{\partial H}{\partial t} = 0), so HH is conserved; E=T+VE = \Kin{T} + \Pot{V} is not conserved because the motor must do work on the hoop to keep ω\omega constant as the bead slides.
(b) When ω(t)=αt\omega(t) = \alpha t, the Hamiltonian becomes explicitly time-dependent:
H(θ,pθ,t)\displaystyle H(\Where{\theta}, \Mom{p_\theta}, t) =pθ22mR2−12mR2α2t2sin⁡2θ−mgRcos⁡θ\displaystyle = \frac{\Mom{p_\theta}^2}{2mR^2} - \frac{1}{2}mR^2\alpha^2 t^2\sin^2\Where{\theta} - \Pot{mgR\cos\theta}
Its rate of change along the motion is:
dHdt\displaystyle \frac{dH}{dt} =∂H∂t\displaystyle = \frac{\partial H}{\partial t} =−mR2α2tsin⁡2θ≠0\displaystyle = -mR^2\alpha^2 t\sin^2\Where{\theta} \neq 0
Because ∂H∂t≠0\frac{\partial H}{\partial t} \neq 0, HH is no longer conserved.
6

A 1D harmonic oscillator of mass mm and spring stiffness kk has Hamiltonian H(x,p)H(\Where{x}, \Mom{p}) == p22m+12kx2\frac{\Mom{p}^2}{2m} + \Pot{\frac{1}{2}kx^2}. (a) Find the uphill gradient vector ∇H=(∂H∂x,∂H∂p)\nabla H = \left(\Force{\frac{\partial H}{\partial x}}, \Vel{\frac{\partial H}{\partial p}}\right) and the phase-space velocity vector (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) at any point (x,p)(\Where{x}, \Mom{p}), verify that their dot product is zero, and explain what this means for how the oscillator moves on the contour map of H(x,p)H(\Where{x}, \Mom{p}). (b) At a given instant, two identical oscillators both pass through x=0\Where{x} = 0 with the same energy EE, one with momentum +p0+\Mom{p_0} and the other with momentum −p0-\Mom{p_0}. Explain why their paths cross on the 1D position line x\Where{x} but never cross in the 2D (x,p)(\Where{x}, \Mom{p}) phase space.

In part (a), check which derivative goes in each slot of ∇H=(∂H∂x,∂H∂p)\nabla H = \left(\Force{\frac{\partial H}{\partial x}}, \Vel{\frac{\partial H}{\partial p}}\right) versus (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) == (∂H∂p,−∂H∂x)\left(\Vel{\frac{\partial H}{\partial p}}, -\Force{\frac{\partial H}{\partial x}}\right).

(a) Differentiating H(x,p)H(\Where{x}, \Mom{p}) == p22m+12kx2\frac{\Mom{p}^2}{2m} + \Pot{\frac{1}{2}kx^2} gives the uphill gradient vector and the phase-space velocity vector:
∇H=(∂H∂x,∂H∂p)=(kx,pm),(x˙,p˙)=(∂H∂p,−∂H∂x)=(pm,−kx)\displaystyle \begin{aligned}\nabla H &= \left(\Force{\frac{\partial H}{\partial x}}, \Vel{\frac{\partial H}{\partial p}}\right) = \left(\Force{kx}, \frac{\Mom{p}}{m}\right), \\ (\Vel{\dot{x}}, \Mom{\dot{p}}) &= \left(\Vel{\frac{\partial H}{\partial p}}, -\Force{\frac{\partial H}{\partial x}}\right) = \left(\frac{\Mom{p}}{m}, -\Force{kx}\right)\end{aligned}
(Warning: Do not forget the minus sign in p˙=−∂H∂x=−kx\Mom{\dot{p}} = -\Force{\frac{\partial H}{\partial x}} = -\Force{kx}; writing +kx+\Force{kx} gives (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) == (pm,kx)\left(\frac{\Mom{p}}{m}, \Force{kx}\right) and a nonzero dot product 2kxpm\frac{2kxp}{m}, which would make the oscillator climb across energy contours instead of conserving energy.)
Taking their dot product gives:
∇H⋅(x˙,p˙)\displaystyle \nabla H \cdot (\Vel{\dot{x}}, \Mom{\dot{p}}) =(kx)(pm)+(pm)(−kx)\displaystyle = (\Force{kx})\left(\frac{\Mom{p}}{m}\right) + \left(\frac{\Mom{p}}{m}\right)(-\Force{kx}) =0\displaystyle = 0
Because (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) is everywhere perpendicular to the uphill gradient ∇H\nabla H, the oscillator has zero velocity component uphill or downhill on the H(x,p)H(\Where{x}, \Mom{p}) surface and flows tangent to the elliptical contour of constant HH.
(b) On the 1D position line x\Where{x}, both oscillators pass through the exact same coordinate x=0\Where{x} = 0 while moving in opposite directions because position alone does not record momentum. In the 2D (x,p)(\Where{x}, \Mom{p}) phase space, (0,+p0)(0, +\Mom{p_0}) and (0,−p0)(0, -\Mom{p_0}) are two distinct points on the same constant-HH ellipse, and because Hamilton's equations assign one unique velocity vector (x˙,p˙)(\Vel{\dot{x}}, \Mom{\dot{p}}) == (pm,−kx)\left(\frac{\Mom{p}}{m}, -\Force{kx}\right) to every point (x,p)(\Where{x}, \Mom{p}), phase-space trajectories never cross: both states go clockwise around that ellipse half a period apart, always at opposite points (x,p)(\Where{x}, \Mom{p}) and (−x,−p)(-\Where{x}, -\Mom{p}), so they are never at the same phase-space point at the same time.