Topic

Lagrangian and Hamiltonian Formalism

Classical Mechanics Foundations Lagrangian Mechanics

Motivation: Why Go Beyond Newton?

Newton’s \mathbf{F} = m\mathbf{a} works well for simple systems, but becomes unwieldy for constrained systems, curvilinear coordinates, or many degrees of freedom. More importantly, the Newtonian formulation does not generalize naturally to field theory or quantum mechanics.

The Lagrangian formulation replaces forces with a single scalar function and derives the equations of motion from a variational principle. The Hamiltonian formulation then reframes the problem in phase space, providing the direct bridge to quantum mechanics via canonical quantization.

For a detailed introduction to the Lagrangian itself, see What is a Lagrangian?.


Generalized Coordinates

A system with n degrees of freedom is described by generalized coordinates q = (q_1, \ldots, q_n), which parametrize the configuration space Q. These need not be Cartesian — they can be angles, distances, or any coordinates adapted to the system’s constraints.

Example: A pendulum of length \ell has one degree of freedom, the angle \theta. The configuration space is Q = S^1.

Example: A double pendulum has two angles (\theta_1, \theta_2). The configuration space is Q = S^1 \times S^1 = T^2 (the 2-torus).

The generalized velocities \dot{q} = (\dot{q}_1, \ldots, \dot{q}_n) live in the tangent bundle TQ.


The Lagrangian

The Lagrangian is a function L: TQ \times \mathbb{R} \to \mathbb{R}:

L(q, \dot{q}, t) = T(q, \dot{q}) - V(q)

where T is the kinetic energy and V is the potential energy.


The Principle of Least Action

The Action Functional

The action is a functional on the space of paths q: [t_1, t_2] \to Q:

S[q] = \int_{t_1}^{t_2} L(q(t), \dot{q}(t), t) \, dt

Variational Principle

The physical trajectory is a stationary point of the action: for all variations \delta q(t) with \delta q(t_1) = \delta q(t_2) = 0,

\delta S = 0

Derivation of the Euler-Lagrange Equations

Consider a variation q(t) \to q(t) + \varepsilon \eta(t) where \eta(t_1) = \eta(t_2) = 0. Then:

\frac{d}{d\varepsilon}\bigg|{\varepsilon=0} S[q + \varepsilon\eta] = \int{t_1}^{t_2} \left(\frac{\partial L}{\partial q}\eta + \frac{\partial L}{\partial \dot{q}}\dot{\eta}\right) dt

Integrating the second term by parts (boundary terms vanish since \eta vanishes at the endpoints):

= \int_{t_1}^{t_2} \left(\frac{\partial L}{\partial q} - \frac{d}{dt}\frac{\partial L}{\partial \dot{q}}\right)\eta \, dt = 0

Since this must hold for all \eta, the fundamental lemma of the calculus of variations gives the Euler-Lagrange equations:

\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i} - \frac{\partial L}{\partial q_i} = 0, \quad i = 1, \ldots, n

Example: Free Particle

L = \frac{1}{2}m\dot{x}^2

Euler-Lagrange: \frac{d}{dt}(m\dot{x}) = 0, so m\ddot{x} = 0 — Newton’s first law.

Example: Particle in a Potential

L = \frac{1}{2}m\dot{x}^2 - V(x)

Euler-Lagrange: m\ddot{x} = -V’(x) — Newton’s second law.

Example: Pendulum

With q = \theta, the kinetic energy is T = \frac{1}{2}m\ell^2\dot{\theta}^2 and the potential is V = -mg\ell\cos\theta, so:

L = \frac{1}{2}m\ell^2\dot{\theta}^2 + mg\ell\cos\theta

Euler-Lagrange gives:

m\ell^2\ddot{\theta} = -mg\ell\sin\theta \quad \Longrightarrow \quad \ddot{\theta} + \frac{g}{\ell}\sin\theta = 0

No need to decompose forces into components — the constraint is handled automatically.


The Legendre Transformation

The passage from Lagrangian to Hamiltonian mechanics is a Legendre transformation — a standard construction from convex analysis.

Conjugate Momenta

Define the conjugate momentum to q_i:

p_i = \frac{\partial L}{\partial \dot{q}_i}

This defines a map from the tangent bundle TQ (positions and velocities) to the cotangent bundle T^*Q (positions and momenta). The cotangent bundle is the phase space.

The Hamiltonian

The Hamiltonian is the Legendre transform of L with respect to the velocities:

H(q, p, t) = \sum_{i=1}^{n} p_i \dot{q}_i - L(q, \dot{q}, t)

where \dot{q}_i is expressed in terms of (q, p) by inverting p_i = \frac{\partial L}{\partial \dot{q}_i}.

For a standard Lagrangian L = T - V with T = \frac{1}{2}\sum_{ij} g_{ij}(q)\dot{q}_i\dot{q}_j:

H = T + V = \text{total energy}


Hamilton’s Equations

The Euler-Lagrange equations become a system of first-order ODEs in phase space:

\dot{q}_i = \frac{\partial H}{\partial p_i}, \qquad \dot{p}_i = -\frac{\partial H}{\partial q_i}

These are Hamilton’s equations. They have a beautiful geometric structure: the flow preserves the symplectic form

\omega = \sum_{i=1}^{n} dp_i \wedge dq_i

on phase space. This is Liouville’s theorem: Hamiltonian flows preserve phase space volume.

Example: Harmonic Oscillator

H = \frac{p^2}{2m} + \frac{1}{2}m\omega^2 q^2

Hamilton’s equations:

\dot{q} = \frac{p}{m}, \qquad \dot{p} = -m\omega^2 q

The phase space trajectories are ellipses — the system orbits forever with constant energy.


Poisson Brackets

For any two functions f, g on phase space, the Poisson bracket is:

{f, g} = \sum_{i=1}^{n} \left(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\right)

The fundamental brackets are:

{q_i, q_j} = 0, \qquad {p_i, p_j} = 0, \qquad {q_i, p_j} = \delta_{ij}

Hamilton’s equations take the compact form:

\dot{f} = {f, H}

for any observable f(q, p). A quantity is conserved if and only if {f, H} = 0.

The Poisson bracket gives the space of observables the structure of a Lie algebra. This structure survives quantization: the canonical quantization prescription replaces

{f, g} \longrightarrow \frac{1}{i\hbar}[\hat{f}, \hat{g}]

This is why the Hamiltonian formulation is the natural starting point for quantum mechanics.


Summary: Newton vs. Lagrange vs. Hamilton

Aspect Newton Lagrange Hamilton
Variables \mathbf{x}, \dot{\mathbf{x}} q, \dot{q} q, p
Space \mathbb{R}^{3N} Configuration TQ Phase space T^*Q
Equations 2nd order ODE 2nd order ODE 1st order ODE
Central object Force \mathbf{F} Lagrangian L Hamiltonian H
Constraints Awkward Natural Natural
Symmetries Case by case Noether’s theorem Poisson brackets
Quantization No direct path Path integrals Canonical quantization

Connection to Quantum Mechanics and QFT

The Hamiltonian formulation leads directly to quantum mechanics:

  • Canonical quantization: Promote q_i, p_j to operators with [\hat{q}i, \hat{p}_j] = i\hbar\delta{ij}
  • Schrödinger equation: i\hbar\frac{\partial}{\partial t}|\psi\rangle = \hat{H}|\psi\rangle

The Lagrangian formulation leads to quantum field theory:

  • Path integrals: \langle \text{out}|\text{in}\rangle = \int \mathcal{D}q \, e^{iS[q]/\hbar}
  • Field theory Lagrangians: Replace L(q, \dot{q}) with \mathcal{L}(\phi, \partial_\mu\phi)

Both roads lead to quantum theory — and both start here, in classical mechanics.


References

  • L. D. Landau and E. M. Lifshitz, Mechanics, 3rd ed. (Pergamon, 1976), Chapters 1–7
  • V. I. Arnold, Mathematical Methods of Classical Mechanics, 2nd ed. (Springer, 1989)
  • H. Goldstein, C. Poole, and J. Safko, Classical Mechanics, 3rd ed. (Addison-Wesley, 2002), Chapters 2, 8–9
  • R. Abraham and J. E. Marsden, Foundations of Mechanics, 2nd ed. (AMS Chelsea, 2008)
  • D. Tong, Lectures on Classical DynamicsFree online notes