Menu
Lesson 1.2 · Foundations

Lagrangian Mechanics

Now that we have the Euler-Lagrange equation, let's see why it's so powerful. The key insight: choose coordinates that match your problem, and the physics follows automatically.

Generalized Coordinates

In Newtonian mechanics, we work with Cartesian coordinates $(x, y, z)$ and must carefully handle constraints with forces. The Lagrangian approach is different:

Generalized coordinates are any set of independent variables $q_1, q_2, \ldots, q_n$ that completely specify the configuration of a system.

The word "generalized" means: use whatever coordinates are natural for your problem. They don't need to be positions — they can be angles, distances along curves, or any parameters that uniquely describe the state.

Degrees of Freedom

The number of generalized coordinates equals the degrees of freedom — the number of independent ways the system can move. A particle in 3D has 3 degrees of freedom. A pendulum constrained to swing in a plane has 1.

Example: The Simple Pendulum

A mass $m$ hangs from a string of length $\ell$, swinging in a vertical plane.

θ m
The simple pendulum. One degree of freedom: the angle θ.

Cartesian approach: The mass has coordinates $(x, y)$ with constraint $x^2 + y^2 = \ell^2$. We'd need to handle the tension force.

Lagrangian approach: Use the angle $\theta$ as our single generalized coordinate. The constraint is automatically satisfied.

Position in terms of $\theta$:

$$ x = \ell \sin\theta, \quad y = -\ell \cos\theta $$

Velocity:

$$ \dot{x} = \ell \dot{\theta} \cos\theta, \quad \dot{y} = \ell \dot{\theta} \sin\theta $$

Kinetic energy:

$$ T = \frac{1}{2}m(\dot{x}^2 + \dot{y}^2) = \frac{1}{2}m\ell^2\dot{\theta}^2 $$

Potential energy (taking $y=0$ at the pivot):

$$ V = mgy = -mg\ell\cos\theta $$

The Lagrangian:

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

Now apply Euler-Lagrange: $\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}} - \frac{\partial L}{\partial \theta} = 0$

Step 1: Compute derivatives

$\frac{\partial L}{\partial \dot{\theta}} = m\ell^2\dot{\theta}$

$\frac{\partial L}{\partial \theta} = -mg\ell\sin\theta$

Step 2: Time derivative

$\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}} = m\ell^2\ddot{\theta}$

Step 3: Euler-Lagrange equation

$m\ell^2\ddot{\theta} + mg\ell\sin\theta = 0$

Simplifying:

$$ \ddot{\theta} + \frac{g}{\ell}\sin\theta = 0 $$

This is the pendulum equation. Notice: we never mentioned tension. The constraint is built into our choice of coordinate.

Small Angle Approximation

For small oscillations, $\sin\theta \approx \theta$, giving $\ddot{\theta} + \frac{g}{\ell}\theta = 0$ — simple harmonic motion with period $T = 2\pi\sqrt{\ell/g}$.

Constraints

Constraints reduce the degrees of freedom. There are two types:

Holonomic Constraints

Expressible as equations relating coordinates (possibly with time):

$$ f(q_1, q_2, \ldots, q_n, t) = 0 $$

Examples:

For holonomic constraints, we can always eliminate variables and work with independent generalized coordinates. This is the Lagrangian's strength.

Non-Holonomic Constraints

Involve velocities and cannot be integrated to position constraints:

$$ f(q_1, \ldots, q_n, \dot{q}_1, \ldots, \dot{q}_n, t) = 0 $$

Example: A ball rolling without slipping. The no-slip condition relates velocity to angular velocity but can't be reduced to a position constraint.

Non-holonomic constraints require more care (Lagrange multipliers), but many important systems are holonomic.

Example: Double Pendulum

Two masses connected by rigid rods — a classic chaotic system.

θ₁ θ₂ ℓ₁ ℓ₂ m₁ m₂
The double pendulum. Two degrees of freedom: θ₁ and θ₂.

Two generalized coordinates: $\theta_1$ and $\theta_2$.

Positions:

$$ x_1 = \ell_1 \sin\theta_1, \quad y_1 = -\ell_1 \cos\theta_1 $$
$$ x_2 = \ell_1 \sin\theta_1 + \ell_2 \sin\theta_2, \quad y_2 = -\ell_1 \cos\theta_1 - \ell_2 \cos\theta_2 $$

The Lagrangian (after computing $T$ and $V$):

$$ L = \frac{1}{2}(m_1 + m_2)\ell_1^2\dot{\theta}_1^2 + \frac{1}{2}m_2\ell_2^2\dot{\theta}_2^2 + m_2\ell_1\ell_2\dot{\theta}_1\dot{\theta}_2\cos(\theta_1 - \theta_2) $$ $$ + (m_1 + m_2)g\ell_1\cos\theta_1 + m_2 g\ell_2\cos\theta_2 $$

The equations of motion are coupled and nonlinear — this is why the double pendulum exhibits chaos for large amplitudes.

Why is the double pendulum chaotic?

Chaos requires: (1) nonlinearity, (2) at least 3 dimensions in phase space. The double pendulum has 4D phase space $(\theta_1, \theta_2, \dot{\theta}_1, \dot{\theta}_2)$ and the $\cos(\theta_1 - \theta_2)$ coupling is nonlinear. Tiny differences in initial conditions lead to vastly different trajectories.

The Recipe

For any mechanical system:

  1. Identify degrees of freedom — how many independent ways can it move?
  2. Choose generalized coordinates — pick coordinates that naturally describe the motion
  3. Write $T$ and $V$ — express kinetic and potential energy in terms of $q_i$ and $\dot{q}_i$
  4. Form $L = T - V$
  5. Apply Euler-Lagrange — one equation per coordinate

Why This Works

The Lagrangian formulation automatically:

  • Handles constraints (built into coordinate choice)
  • Works in any coordinate system
  • Reveals conserved quantities (next lesson)
  • Generalizes to fields, relativity, and quantum mechanics

Multiple Coordinates

With $n$ generalized coordinates $q_1, \ldots, q_n$, we get $n$ Euler-Lagrange equations:

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

These form a system of coupled differential equations describing the motion.

Exercises

  1. Atwood machine: Two masses $m_1$ and $m_2$ connected by a string over a pulley. Choose a single generalized coordinate and derive the equation of motion.
  2. Bead on a wire: A bead slides frictionlessly on a parabolic wire $y = ax^2$ in a gravitational field. Find the Lagrangian and equation of motion.
  3. Spherical pendulum: A pendulum free to swing in any direction (not confined to a plane). How many degrees of freedom? Write the Lagrangian.

Key Takeaways