Worked examples — Hamilton's equations of motion
Before the examples, one reminder of notation so nothing is used unearned:
The scenario matrix
Every worked example below is tagged with the cell it covers. The matrix names the kinds of situation Hamilton's machine must survive.
| Cell | Scenario class | What could go wrong / what's special |
|---|---|---|
| C1 | Simple positive potential, | Baseline: does Newton re-emerge? |
| C2 | Sign of the force flips (unstable / repulsive) | Does get the sign right in every region? |
| C3 | Degenerate: free particle, | Zero force — is constant, is motion straight? |
| C4 | Angular coordinate (pendulum), nonlinear | is an angle; has odd units |
| C5 | Velocity-dependent (charge in a field) | — the "just use " trap |
| C6 | Time-dependent / rotating frame | even though is conserved |
| C7 | Limiting behaviour (, large energy) | Do formulas degrade gracefully in the limits? |
| C8 | Real-world word problem | Translate words → → → motion |
| C9 | Exam twist: given , reverse-engineer | Can you run the Legendre transform backwards? |
Example 1 — Baseline: falling mass under gravity [C1] [C8]
- Momentum. . Why this step? is the variable that will replace ; we also need it to invert .
- Hamiltonian. . Why this step? Substituting purges every ; what remains is a function of only. Here (gravity's stored energy) and it reads as .
- Canonical equations. , and . Why this step? These are the machine's two rules; the second says the "push" decreases at a steady rate.
- Recover acceleration. . Why this step? Differentiating and inserting turns two first-order equations back into one Newton equation.
Example 2 — Sign flip: the repulsive (inverted) spring [C2]
- Read off the equations. , . Why this step? We must apply the minus rule literally — two minus signs (one from the rule, one from ) make a plus.
- Case . : momentum grows more positive, pushing the bead further right. Why this step? We check the sign region-by-region because a sign error would only reveal itself in one region.
- Case . : momentum grows more negative, pushing the bead further left. Why this step? Both regions push outward — the origin is unstable, exactly what an inverted potential should do.
- Case , . Both and : a fixed point, but an unstable one (any nudge grows). Why this step? The degenerate equilibrium must be classified; here gives exponential growth , not oscillation.
The figure below draws this potential as a hilltop. Look at the amber arrows: they sit on the curve at four sample points and always point away from the centre — leftward when , rightward when . That is the geometric meaning of having the same sign as . The amber dot at the top marks the unstable fixed point: perfectly balanced, but the tiniest slip sends the bead sliding down either side.

Example 3 — Degenerate case: the free particle [C3]
- Hamiltonian. , so (pure kinetic, since means no stored energy anywhere). Why this step? Setting is the cleanest test that the machine handles the "nothing happens" case.
- Equations. , . Why this step? has no in it, so — momentum is exactly conserved.
- Solve. , hence constant, hence . Why this step? Constant velocity, straight line — this is Newton's first law falling out of the formalism.
- Phase-space picture. The point moves along a horizontal line , drifting right at speed . Why this step? We picture the trajectory to see the degenerate limit of the closed SHO ellipse: as the restoring force the ellipse opens into a flat line (we return to this exact limit in Example 7).
Example 4 — Angular coordinate: the pendulum [C4]
- Angular momentum. . Why this step? The conjugate of an angle is not linear momentum — it is angular momentum (units ). Invert: .
- Hamiltonian. . Why this step? The potential energy is (lowest at ). Substituting leaves in only.
- Equations. , . Why this step? The second, combined with the first, gives , the exact nonlinear pendulum.
- Small-angle reduction. For , , so — SHO with . Why this step? We check the nonlinear pendulum degrades to the harmonic oscillator we already trust, tying this back to the parent's Example B. (True limiting behaviour of the SHO itself — and large energy — is dissected separately in Example 7.)
Example 5 — The trap: charge in a magnetic field, [C5]
- Momentum — the surprise. . Why this step? The velocity term contributes . So ; the "canonical" momentum differs from the "kinetic" momentum by .
- Invert correctly. . Why this step? We must solve for the actual , not reuse . This is the whole point of the cell.
- Hamiltonian. . Simplify: . Why this step? Substituting the correct and expanding, the linear pieces cancel, leaving the kinetic energy written with the shifted momentum — exactly the structure of in electromagnetism.
- Equations. ✓ (matches step 2), and (no in ). Why this step? is conserved, but note is what actually moves — the physical velocity, not the canonical momentum, is what you'd measure.
Example 6 — conserved but : bead on a rotating wire [C6]
- Momentum. . Why this step? Only appears in the velocity part, so is the ordinary radial momentum; invert .
- Hamiltonian. . Why this step? Notice the minus on the term — the Legendre transform flipped its sign. This is why is not the sum you might expect.
- Is conserved? has no explicit (the motor speed is constant), so . Conserved. Why this step? Conservation depends only on absence of explicit time, which holds here.
- Is ? The true kinetic energy is (both radial and rotational parts), and there is no potential so . But , so : they differ by . Why this step? We must directly compare the two quantities. They differ by the full rotational term . So is a conserved quantity that is not the energy — the flagship of cell C6. Whenever the difference is nonzero; only at the axis do they momentarily agree.
Example 7 — Limiting behaviour of the SHO orbit [C7]
- Ellipse equation. Here genuinely holds (quadratic kinetic energy, time-independent — contrast Example 6). Set : . Why this step? is conserved (parent §3), so the orbit lies on a level curve of ; and since here, that curve is a curve of constant physical energy — an ellipse.
- Semi-axes. In : set . In : set . Why this step? The axis intercepts are found by asking "where does the ellipse cross each axis?" — on the -axis the momentum is momentarily zero (turning point, all energy is potential), on the -axis the position is zero (all energy is kinetic). Those two crossing points are the semi-axis lengths.
- Enclosed area. Area of ellipse . Why this step? This confirms the parent's — the action, a hint of quantization.
- Limit (weak spring). while stays fixed; the area . The ellipse stretches horizontally until it becomes the free-particle line of Example 3. Why this step? Removing the restoring force must recover the free particle; checking this ties C7 back to C3 and confirms the formula degrades sensibly.
- Limit (large energy). Both semi-axes grow as , so the ellipse keeps the same shape (aspect ratio is energy-independent) but blows up in size; area grows linearly, . Why this step? Large-energy behaviour must be bounded/self-similar for the model to make sense — no shape distortion appears, so the SHO is well-behaved at all energies.
- Limit (collapse). Both axes ; the ellipse shrinks to the fixed point at the origin — the bead permanently at rest. Why this step? Checking the vanishing limit confirms the degenerate rest state, closing the loop with the unstable/stable fixed-point discussion of Example 2.

Example 8 — Real-world word problem: rocket sled on a spring bumper [C1] [C8]
- Translate words to . Kinetic , elastic potential , so . Why this step? The word problem must first become a Lagrangian; that is the only entry point to the machine.
- Momentum & Hamiltonian. ; . Why this step? Building in lets us read the equations directly; here (Example 1-type, scleronomic).
- Equations & frequency. , , so , i.e. , giving . Why this step? Eliminating recovers Newton and identifies the angular frequency.
Example 9 — Exam twist: reverse the Legendre transform [C9]
- Get from . . Why this step? The inverse Legendre transform uses the same pairing ; we solve it for in terms of .
- Apply . . Why this step? The Legendre transform is its own inverse (up to sign convention): with re-expressed via .
- Simplify. . Why this step? We recover exactly the Lagrangian we'd expect — kinetic minus potential , i.e. — confirming the round trip.
Recall Coverage check — did we hit every cell?
C1 → Ex 1, 8 · C2 → Ex 2 · C3 → Ex 3 · C4 → Ex 4 · C5 → Ex 5 · C6 → Ex 6 · C7 → Ex 7 · C8 → Ex 1, 8 · C9 → Ex 9. Every cell of the matrix is covered by at least one standalone worked example.
Active-Recall
What is the Lagrangian defined as?
Why did in Example 5?
In the rotating-wire bead (Ex 6), why is ?
What is the phase-space area of an SHO orbit of energy ?
What happens to the SHO ellipse as ?
What happens to the SHO ellipse as ?
For the inverted potential , is the origin stable?
Oscillation frequency of a mass on a spring (Ex 8)?
How do you reverse-engineer from ?
Related: Legendre Transform · Phase Space and Liouville's Theorem · Lagrangian Mechanics · Poisson Brackets · Canonical Transformations