Hamiltonian Mechanics & Rigid Body Dynamics

In-Depth Discussions with Logical Reasoning and Practical Applications

1. Introduction to Hamiltonian Mechanics

Hamiltonian mechanics is a reformulation of classical mechanics introduced by William Rowan Hamilton in 1833. Where Lagrangian mechanics works in configuration space with generalized coordinates qi and their velocities, the Hamiltonian picture moves to phase space, whose coordinates are the qi together with their conjugate momenta pi.

The passage from the Lagrangian L(q, q̇, t) to the Hamiltonian H(q, p, t) is a Legendre transform in the velocity variables. The second-order Euler–Lagrange equations are thereby replaced by a first-order system — Hamilton’s canonical equations — that is symmetric in coordinates and momenta and is the natural setting for conservation laws, canonical transformations, and quantization.

This whitepaper develops the Hamiltonian formalism in full, then applies the same geometric ideas to the dynamics of rigid bodies: generalized coordinates, body versus space frames, the inertia tensor, principal axes, and Euler’s equations.

Key insight: Time evolution in Hamiltonian mechanics is a symplectic flow on phase space generated by H itself. Energy is the generator of time translations, just as momentum generates spatial translations and angular momentum generates rotations.

2. The Hamiltonian Function and Its Physical Significance

Given a Lagrangian L(q, q̇, t), the conjugate momentum is

pi = ∂L / ∂q̇i

Provided this relation can be inverted for the velocities, q̇i = q̇i(q, p, t), the Hamiltonian is the Legendre transform

H(q, p, t) = Σi pi q̇i − L(q, q̇, t)

with every velocity on the right-hand side expressed in terms of q and p.

2.1 When is H the total energy?

If the kinetic energy T is a homogeneous quadratic form in the velocities (the usual case for scleronomic, time-independent constraints) and the potential V depends only on the coordinates, then

H(q, p) = T(q, p) + V(q)

so H is the total mechanical energy. This identification fails when the constraints are rheonomic (explicitly time-dependent) or when the potential is velocity-dependent, as for a charged particle in an electromagnetic field:

H = (1 / 2m) |p − qA(r, t)|² + q φ(r, t)

2.2 Physical significance

Example: Simple harmonic oscillator

L = ½ m q̇² − ½ k q² ,    p = m q̇

H(q, p) = p² / (2m) + ½ k q²

H is the sum of kinetic and potential energy. Its elliptical level curves in the (q, p) plane are the orbits of the oscillator.

3. Hamilton’s Canonical Equations of Motion

Differentiating the Legendre transform and using the Euler–Lagrange equation yields the 2n first-order equations

q̇i = ∂H / ∂pi ,     ṗi = − ∂H / ∂qi

If a generalized force Qi not derived from a potential is present, it is added to the momentum equation: ṗi = −∂H/∂qi + Qi.

3.1 Derivation sketch

  1. From H = Σ p q̇ − L, take the differential dH.
  2. Substitute dL = Σ (∂L/∂q) dq + (∂L/∂q̇) dq̇ + (∂L/∂t) dt and p = ∂L/∂q̇.
  3. The dq̇ terms cancel. Euler–Lagrange gives ṗ = ∂L/∂q, hence dH = Σ (q̇ dp − ṗ dq) − (∂L/∂t) dt.
  4. Comparing with dH = Σ (∂H/∂q dq + ∂H/∂p dp) + (∂H/∂t) dt produces the canonical equations and ∂H/∂t = −∂L/∂t.

3.2 Phase-space flow

The vector field XH = (∂H/∂p, −∂H/∂q) is the Hamiltonian vector field. Trajectories never cross (uniqueness), preserve phase-space volume (Liouville), and stay on level sets of H whenever H is time-independent.

Phase space of a harmonic oscillator. Green ellipses are energy contours; the red state point travels on a single contour. Drag to rotate.

First-order versus second-order: Lagrange’s equations are n second-order ODEs. Hamilton’s equations are 2n first-order ODEs. The two descriptions are equivalent, but the first-order form is the one that admits a symplectic geometry and a Poisson-bracket algebra.

4. Advantages of Hamilton’s Formalism over the Lagrangian Formulation

The Lagrangian already improves on Newton for constrained systems. The Hamiltonian goes further whenever one needs geometry, transformations, or a path to quantum and statistical physics.

First-Order Phase-Space Form

Coordinates and momenta enter on an equal footing. Existence, uniqueness, and geometric constructions (symplectic maps, generating functions) become transparent.

Canonical Transformations

A large group of transformations preserves the form of Hamilton’s equations. This is far richer than the point transformations of the Lagrangian theory.

Poisson Structure

Conserved quantities, symmetry algebras, and the correspondence principle { , } → [ , ] / iℏ all live in the Poisson bracket.

Action–Angle Variables

For integrable systems a canonical transformation yields cyclic coordinates whose conjugate momenta are the actions. Perturbation theory (KAM, celestial mechanics) is built on this.

Liouville & Statistical Mechanics

Incompressibility of phase-space flow is immediate from div XH = 0, the starting point of equilibrium statistical mechanics.

Pathway to Quantum Theory

The Hamiltonian is the classical counterpart of the Schrödinger operator; path integrals still start from the action, but canonical quantization starts from H and the Poisson algebra.

Schematic emphasis of each formalism across typical theoretical tasks. Neither replaces the other; they are complementary.

5. Conservation of Energy

Along a solution of Hamilton’s equations,

dH/dt = ∂H/∂t + Σi (∂H/∂qi q̇i + ∂H/∂pi ṗi) = ∂H/∂t

The sum vanishes identically by the canonical equations. Therefore:

5.1 Energy surfaces

For an autonomous system the orbit lies on the hypersurface H(q, p) = E. In one degree of freedom this is a curve (an ellipse for the harmonic oscillator, a more complicated oval for the pendulum). In n degrees of freedom it is a (2n − 1)-dimensional manifold; integrability foliates it further into invariant tori.

Jacobi integral

Even when the potential is time-independent but the kinetic energy contains gyroscopic or rheonomic pieces, the conserved quantity may differ from the Newtonian energy. The Jacobi integral of celestial mechanics is the Hamiltonian in a rotating frame, and includes a centrifugal contribution.

Harmonic oscillator: T and V oscillate in antiphase; H = T + V is strictly constant.

6. Applications of Hamilton’s Equations to Simple Systems

The following textbook systems show how little algebra is required once H is written down.

6.1 Simple harmonic oscillator

H = p² / (2m) + ½ k q²

q̇ = p/m ,    ṗ = −k q

Differentiating the first and substituting the second recovers q̈ + ω² q = 0 with ω = √(k/m). The phase portrait is a nested family of ellipses.

6.2 Simple pendulum

Generalized coordinate θ (from the downward vertical), conjugate momentum pθ = m ℓ² θ̇:

H = pθ² / (2 m ℓ²) − m g ℓ cos θ

θ̇ = pθ / (m ℓ²) ,    ṗθ = − m g ℓ sin θ

Closed orbits (libration) exist for E < m g ℓ; circulating orbits (rotation over the top) exist for E > m g ℓ. The separatrix at E = m g ℓ is the infinite-period homoclinic trajectory through the inverted equilibrium.

Simple pendulum integrated with Hamilton’s equations. The trail traces the bob; energy is conserved to integrator accuracy.

6.3 Central-force problem

H = pr² / (2m) + pθ² / (2m r²) + V(r)

θ is cyclic, so pθ = ℓ is constant. The radial motion is one-dimensional with effective potential Veff(r) = V(r) + ℓ² / (2m r²).

6.4 Free particle

H = |p|² / (2m)  ⇒  q̇ = p/m ,   ṗ = 0

Uniform rectilinear motion: momentum is conserved because H is independent of q.

7. Poisson Brackets

For two phase-space functions f(q, p, t) and g(q, p, t) the Poisson bracket is

{f, g} = Σi ( ∂f/∂qi · ∂g/∂pi − ∂f/∂pi · ∂g/∂qi )

7.1 Algebraic properties

These make the smooth functions on phase space into a Lie algebra — the same abstract structure that the commutator gives to quantum observables.

7.2 Fundamental brackets and equations of motion

{qi, qj} = 0 ,    {pi, pj} = 0 ,    {qi, pj} = δij

Any observable evolves as

df/dt = {f, H} + ∂f/∂t

In particular Hamilton’s equations themselves are q̇i = {qi, H} and ṗi = {pi, H}. A quantity with no explicit time dependence is conserved if and only if it Poisson-commutes with the Hamiltonian: {f, H} = 0.

Angular-momentum algebra

{Li, Lj} = εijk Lk

The same structure constants appear in the quantum commutation relations of angular momentum. If H is rotationally invariant, then {Li, H} = 0 and each component of L is conserved.

Canonical invariance

A transformation (q, p) → (Q, P) is canonical if and only if it preserves Poisson brackets: {Qi, Pj}q,p = δij. Equivalently, its Jacobian is a symplectic matrix.

Quantization rule of thumb: Dirac’s correspondence {f, g} → (1 / iℏ) [f̂, ĝ] turns the Poisson algebra into the Heisenberg algebra. This is why the Hamiltonian — not the Lagrangian — is the starting point of canonical quantization.

8. Canonical Transformations

A coordinate change on phase space Q = Q(q, p, t), P = P(q, p, t) is canonical if it preserves the form of Hamilton’s equations: there exists a new Hamiltonian K(Q, P, t) such that

Q̇i = ∂K / ∂Pi ,    Ṗi = − ∂K / ∂Qi

8.1 Why they matter

Point transformations (changes of the q’s alone) are a small subgroup. Canonical transformations can mix coordinates and momenta, send a complicated H into a trivial K (as in the Hamilton–Jacobi method), or isolate action–angle variables for perturbation theory.

8.2 Characterizations

Exchange transformation

Q = p ,    P = −q

Coordinates and momenta trade roles (with a sign). This is canonical but is not a point transformation — a distinctly Hamiltonian phenomenon.

Infinitesimal canonical transformations

Every phase-space function G generates an infinitesimal canonical transformation via δq = ε {q, G}, δp = ε {p, G}. Taking G = H recovers time evolution: Hamiltonian flow is itself a continuous canonical transformation.

9. Generating Functions

A canonical transformation may be encoded in a single scalar, the generating function, of one of four classical types according to which mixed pair of old and new variables is used as the independent set.

Type 1 — F1(q, Q, t)

pi = ∂F1/∂qi

Pi = −∂F1/∂Qi

Useful when old and new coordinates are independent. The exchange map is generated by F1 = q Q.

Type 2 — F2(q, P, t)

pi = ∂F2/∂qi

Qi = ∂F2/∂Pi

The workhorse. The identity map is F2 = Σ qi Pi. Point transformations live here.

Type 3 — F3(p, Q, t)

qi = −∂F3/∂pi

Pi = −∂F3/∂Qi

The dual of Type 1, with old momenta and new coordinates as independents.

Type 4 — F4(p, P, t)

qi = −∂F4/∂pi

Qi = ∂F4/∂Pi

Used less often; natural when both old and new momenta are convenient labels.

In every case the new Hamiltonian is

K(Q, P, t) = H(q, p, t) + ∂F / ∂t

If the generating function does not depend explicitly on time, then K is just H rewritten in the new variables.

Worked example: identity and point transformations

F2 = Σ qi Pi gives p = P and Q = q — the identity. Replacing q by a function of new coordinates, F2 = Σ fi(q) Pi, generates an arbitrary point transformation together with the corresponding covariant transformation of the momenta.

Worked example: harmonic oscillator to polar (action–angle) form

The Type-1 generating function F1(q, Q) = (m ω q² / 2) cot Q sends the oscillator Hamiltonian to

K = ω P ,    P = E / ω

Q is then an ignorable angle advancing as Q̇ = ω, and P is the action. This is the prototype of action–angle coordinates.

Hamilton–Jacobi equation: Seeking a Type-2 generating function S(q, P, t) that trivializes K (e.g. K = 0) produces the Hamilton–Jacobi partial differential equation H(q, ∂S/∂q, t) + ∂S/∂t = 0. Complete integrals of this PDE generate the dynamics by quadrature.

10. Generalized Coordinates of a Rigid Body

A rigid body is a system of particles (or a continuum) whose mutual distances are constrained to be constant. After the holonomic rigidity constraints are imposed, a free rigid body in three-dimensional space has six degrees of freedom: three of translation of the centre of mass, and three of orientation.

10.1 Translational coordinates

The centre-of-mass coordinates (X, Y, Z) are the natural translational generalized coordinates. By König’s theorem the kinetic energy splits into centre-of-mass motion plus motion relative to the centre of mass, so the rotational problem decouples from a free translation (or from motion in a uniform gravitational field, up to the potential M g Z).

10.2 Rotational coordinates: Euler angles

Orientation is specified by a rotation taking a space-fixed frame into a body-fixed frame. A standard 3–1–3 Euler chart uses

R = Rz(φ) Rx(θ) Rz(ψ)

The chart is singular at θ = 0, π (gimbal lock). Alternative parameterizations — unit quaternions (four coordinates, one constraint) or rotation matrices (nine coordinates, six constraints) — avoid the coordinate singularity at the cost of redundancy.

Chasles’ theorem: the most general displacement of a rigid body is a translation of an arbitrary point together with a rotation about an axis through that point. The six generalized coordinates are the three translational components plus the three parameters of that rotation.

11. Body and Space Reference Systems

Two orthonormal frames are in play:

Space frame (inertial)

Axes (e1, e2, e3) fixed in an inertial laboratory. Newton’s and Euler’s laws in their Newtonian form refer to this frame. Angular momentum and energy are most simply conserved here when external torques vanish.

Body frame

Axes (ê1, ê2, ê3) painted on the body. The inertia tensor is constant in this frame, which is why Euler’s equations are written there. The body frame is non-inertial: it rotates with angular velocity ω.

A vector V has two sets of components related by the instantaneous rotation matrix R(t):

Vspace = R(t) Vbody

Time derivatives in the two frames differ by the transport theorem

(dV/dt)space = (dV/dt)body + ω × V

11.1 Angular velocity in Euler angles (3–1–3)

Adding the three sequential angular velocities and projecting onto body axes yields

ω1 = θ̇ cos ψ + φ̇ sin θ sin ψ

ω2 = −θ̇ sin ψ + φ̇ sin θ cos ψ

ω3 = ψ̇ + φ̇ cos θ

Space axes (muted, fixed) versus body axes (bright, glued to the cube). Drag to inspect the two triads.

12. Angular Momentum and the Moment of Inertia Tensor

Relative to a chosen origin (almost always the centre of mass for a free body, or a fixed point for a body with a pivot), the angular momentum of a rigid body is linear in the angular velocity:

L = I ω

The linear map I is the inertia tensor, with Cartesian components

Iij = ∫ (r² δij − xi xj) dm

Diagonal entries are moments of inertia; off-diagonal entries Ixy = −∫ x y dm (and cyclic) are products of inertia. I is symmetric and positive definite, hence orthogonally diagonalizable.

12.1 Simple bodies about their centre of mass

Solid sphere, mass M, radius R

Iij = (2/5) M R² δij

Every axis through the centre is a principal axis with the same moment (2/5) M R². A thin spherical shell gives (2/3) M R².

Solid cube, mass M, side a

Axes through the centre and parallel to the edges are principal, with

Ixx = Iyy = Izz = (1/6) M a²

(equivalently M a² / 6 from ∫(x² + y²) dm = M(a² + a²)/12). Products of inertia vanish by cubic symmetry, and the inertia tensor about the centre is isotropic: every axis through the centre is principal with the same moment.

Solid circular cylinder, mass M, radius R, height h

The symmetry axis z and any transverse CM axis are principal:

Izz = ½ M R²

Ixx = Iyy = ¼ M R² + (1/12) M h²

The second formula is the perpendicular-axis / parallel-axis combination of a disk and a line distribution along the generators.

Characteristic principal moments in units of M L², with L the natural length (R for sphere and cylinder, side a for the cube). Cylinder transverse uses h = 2R.

Parallel-axis theorem: Iz(parallel) = Iz(CM) + M d². Once the CM tensor is known, moments about any parallel axis follow at once — essential for compound pendulums and rolling bodies.

13. Principal Axes and Principal Moments of Inertia

Because I is a real symmetric 3 × 3 matrix it possesses three orthonormal eigenvectors — the principal axes — and three real eigenvalues I1, I2, I3 — the principal moments:

I n̂α = Iα n̂α ,    α = 1, 2, 3

In the principal frame the inertia tensor is diagonal and

L1 = I1 ω1 ,    L2 = I2 ω2 ,    L3 = I3 ω3

13.1 Geometric identification

13.2 Inertia ellipsoid

The quadratic form Trot = ½ ω · I ω defines the inertia ellipsoid I1 x² + I2 y² + I3 z² = 1 in body coordinates. Poinsot’s construction: in torque-free motion the inertia ellipsoid rolls without slipping on the invariable plane orthogonal to the conserved space-frame angular momentum.

Degeneracy and stability: if two principal moments coincide (symmetric top), every axis in that plane is principal. Rotation about the unique distinct axis is stable; the fully asymmetric case is governed by the tennis-racket (intermediate-axis) theorem of Section 15.

14. Kinetic Energy of a Rigid Body

König’s theorem decomposes the kinetic energy into translational and rotational pieces about the centre of mass:

T = ½ M |Vcm|² + ½ ω · Icm ω

In a principal frame the rotational term is purely quadratic and diagonal:

Trot = ½ I1 ω1² + ½ I2 ω2² + ½ I3 ω3²

Equivalently Trot = ½ ω · L. If the body is constrained to rotate about a fixed point O (physical pendulum, top with a pivot), one uses I about O rather than about the CM and drops the separate translational term.

14.1 Lagrangian of a free rigid body

With no potential, L = T. Written in Euler angles the Lagrangian is a quadratic form in (φ̇, θ̇, ψ̇) with configuration-dependent coefficients. The Hamiltonian is the Legendre transform of that quadratic form; in body-frame components it is simply

H = L1² / (2 I1) + L2² / (2 I2) + L3² / (2 I3)

which is the starting point of the Euler–Poinsot rigid-body dynamics on the angular-momentum sphere.

Symmetric top (I1 = I2 ≠ I3)

φ and ψ are cyclic, so pφ (space-vertical angular momentum) and pψ (spin) are conserved. The nutation angle θ obeys an effective one-dimensional potential, recovering uniform precession, nutation, and the sleeping-top equilibrium.

15. Euler Equations of Motion of a Rigid Body

In the body principal frame the transport theorem applied to L = I ω, together with (dL/dt)space = N (external torque), yields Euler’s equations

I1 ω̇1 − (I2 − I3) ω2 ω3 = N1

I2 ω̇2 − (I3 − I1) ω3 ω1 = N2

I3 ω̇3 − (I1 − I2) ω1 ω2 = N3

These are first-order in ω but must be supplemented by kinematic equations (Euler-angle rates, or a quaternion ODE) to reconstruct the orientation.

15.1 Torque-free motion

For N = 0 two quantities are conserved: the rotational energy T and the magnitude of angular momentum |L|. Their intersection in ω-space (or on the L-sphere) is a polhode curve. In space, L is a fixed vector (the invariable axis) and the energy ellipsoid rolls on the invariable plane (Poinsot).

15.2 Stability of principal-axis rotation — tennis-racket theorem

Order the principal moments I1 < I2 < I3. Steady rotation about a principal axis is a solution of the torque-free Euler equations. Linearization shows:

A tennis racket (or a book, or the T-handle of the Dzhanibekov effect) flipped about its intermediate axis will reverse orientation in a spectacular π-flip — visible in the simulation below.

Asymmetric brick (I1 < I2 < I3) started near the intermediate principal axis. Cyan: conserved space-frame L. Yellow: body-frame ω. The π-flip is the tennis-racket / Dzhanibekov instability. Drag to rotate.

Symmetric Euler top (N = 0, I1 = I2)

ω3 = const ,    ω1 + i ω2 ∝ ei Ω t

with Ω = (I3 − I1) ω3 / I1. The angular-velocity vector precesses uniformly about the body symmetry axis, while the body symmetry axis precesses uniformly about the fixed L in space.

Hamiltonian structure: on the sphere of constant |L|, Euler’s torque-free equations are Hamilton’s equations for H = Σ Lα² / (2 Iα) with the rigid-body Poisson bracket {Li, Lj} = −εijk Lk (body frame). The same geometry underlies the free rigid body as a Lie–Poisson system on so(3)*.

16. Conclusion

Hamiltonian mechanics recasts the content of the Lagrangian theory in the symplectic geometry of phase space. The payoff is a first-order calculus in which energy generates time evolution, symmetries are Poisson-commuting conserved quantities, and a flexible group of canonical transformations — encoded in generating functions — can simplify, integrate, or quantize a system.

The development proceeded in two movements.

Taken together, the Hamiltonian and rigid-body formalisms are the working language of celestial mechanics, rigid-body attitude control, molecular spectroscopy, and the canonical route into quantum theory. Mastery of both is a practical tool and a conceptual gateway.