Skip to content

Lagrangian Mechanics

3.1 The Lagrangian

The Lagrangian of a system is defined as

L(q1,,qn,q˙1,,q˙n,t)=TVL(q_1, \ldots, q_n, \dot{q}_1, \ldots, \dot{q}_n, t) = T - V

Where TT is the kinetic energy and VV is the potential energy.

3.2 Derivation of the Euler-Lagrange Equation from D”Alembert’s Principle

Theorem 3.1 (Euler-Lagrange from D’Alembert). The equations of motion for a holonomic system with ideal constraints are:

ddt(Lq˙j)Lqj=0,j=1,,n\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_j}\right) - \frac{\partial L}{\partial q_j} = 0, \quad j = 1, \ldots, n

Proof. Start from D’Alembert’s principle with only applied forces (ideal constraints):

i(Fi(app)mir¨i)δri=0\sum_i (\mathbf{F}_i^{(\mathrm{app})} - m_i\ddot{\mathbf{r}}_i) \cdot \delta\mathbf{r}_i = 0

Express the virtual displacement in terms of generalised coordinates:

δri=jriqjδqj\delta\mathbf{r}_i = \sum_j \frac{\partial \mathbf{r}_i}{\partial q_j}\delta q_j

First term (applied forces). For a conservative system, Fi(app)=iV\mathbf{F}_i^{(\mathrm{app})} = -\nabla_i VSo:

iFi(app)δri=iiVjriqjδqj=jVqjδqj\sum_i \mathbf{F}_i^{(\mathrm{app})} \cdot \delta\mathbf{r}_i = -\sum_i \nabla_i V \cdot \sum_j \frac{\partial \mathbf{r}_i}{\partial q_j}\delta q_j = -\sum_j \frac{\partial V}{\partial q_j}\delta q_j

Defining the generalised force Qj=iFiriqjQ_j = \sum_i \mathbf{F}_i \cdot \frac{\partial \mathbf{r}_i}{\partial q_j}For conservative forces Qj=V/qjQ_j = -\partial V/\partial q_j.

Second term (inertia). Using r˙iq˙j=riqj\frac{\partial \dot{\mathbf{r}}_i}{\partial \dot{q}_j} = \frac{\partial \mathbf{r}_i}{\partial q_j} (which holds when ri=ri(q,t)\mathbf{r}_i = \mathbf{r}_i(q, t)):

imir¨iδri=imir¨ijriqjδqj=j[imir¨iriqj]δqj\sum_i m_i\ddot{\mathbf{r}}_i \cdot \delta\mathbf{r}_i = \sum_i m_i\ddot{\mathbf{r}}_i \cdot \sum_j \frac{\partial \mathbf{r}_i}{\partial q_j}\delta q_j = \sum_j \left[\sum_i m_i\ddot{\mathbf{r}}_i \cdot \frac{\partial \mathbf{r}_i}{\partial q_j}\right]\delta q_j

Now:

imir¨iriqj=ddt(imir˙iriqj)imir˙iddtriqj\sum_i m_i\ddot{\mathbf{r}}_i \cdot \frac{\partial \mathbf{r}_i}{\partial q_j} = \frac{d}{dt}\left(\sum_i m_i\dot{\mathbf{r}}_i \cdot \frac{\partial \mathbf{r}_i}{\partial q_j}\right) - \sum_i m_i\dot{\mathbf{r}}_i \cdot \frac{d}{dt}\frac{\partial \mathbf{r}_i}{\partial q_j}

Using ddtriqj=r˙iqj\frac{d}{dt}\frac{\partial \mathbf{r}_i}{\partial q_j} = \frac{\partial \dot{\mathbf{r}}_i}{\partial q_j} and r˙iq˙j=riqj\frac{\partial \dot{\mathbf{r}}_i}{\partial \dot{q}_j} = \frac{\partial \mathbf{r}_i}{\partial q_j}:

imir¨iriqj=ddt(imir˙ir˙iq˙j)imir˙ir˙iqj\sum_i m_i\ddot{\mathbf{r}}_i \cdot \frac{\partial \mathbf{r}_i}{\partial q_j} = \frac{d}{dt}\left(\sum_i m_i\dot{\mathbf{r}}_i \cdot \frac{\partial \dot{\mathbf{r}}_i}{\partial \dot{q}_j}\right) - \sum_i m_i\dot{\mathbf{r}}_i \cdot \frac{\partial \dot{\mathbf{r}}_i}{\partial q_j}

=ddtTq˙jTqj= \frac{d}{dt}\frac{\partial T}{\partial \dot{q}_j} - \frac{\partial T}{\partial q_j}

Combining both terms in D’Alembert’s principle:

j[QjddtTq˙j+Tqj]δqj=0\sum_j \left[Q_j - \frac{d}{dt}\frac{\partial T}{\partial \dot{q}_j} + \frac{\partial T}{\partial q_j}\right]\delta q_j = 0

For conservative forces, Qj=V/qjQ_j = -\partial V/\partial q_j. Since L=TVL = T - V and VV is independent of q˙j\dot{q}_j:

j[LqjddtLq˙j]δqj=0\sum_j \left[\frac{\partial L}{\partial q_j} - \frac{d}{dt}\frac{\partial L}{\partial \dot{q}_j}\right]\delta q_j = 0

Since the δqj\delta q_j are independent (and we have nn degrees of freedom):

ddt(Lq˙j)Lqj=0\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_j}\right) - \frac{\partial L}{\partial q_j} = 0

\blacksquare

3.3 Hamilton’s Principle (Action Formulation)

Theorem 3.2 (Hamilton’s Principle). The actual path of a system between times t1t_1 and t2t_2 is The one that makes the action

S=t1t2L(q,q˙,t)dtS = \int_{t_1}^{t_2} L(q, \dot{q}, t)\, dt

Stationary.

Theorem 3.3 (Euler-Lagrange Equation from Hamilton’s Principle). The path q(t)q(t) that makes SS stationary satisfies

ddt(Lq˙j)Lqj=0,j=1,,n\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_j}\right) - \frac{\partial L}{\partial q_j} = 0, \quad j = 1, \ldots, n

Proof (for one degree of freedom). Consider a variation q(t)+ϵη(t)q(t) + \epsilon \eta(t) where η(t1)=η(t2)=0\eta(t_1) = \eta(t_2) = 0. The variation of the action:

δS=t1t2(Lqη+Lq˙η˙)dt\delta S = \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:

δS=t1t2(LqddtLq˙)ηdt+[Lq˙η]t1t2\delta S = \int_{t_1}^{t_2} \left(\frac{\partial L}{\partial q} - \frac{d}{dt}\frac{\partial L}{\partial \dot{q}}\right) \eta\, dt + \left[\frac{\partial L}{\partial \dot{q}}\eta\right]_{t_1}^{t_2}

The boundary term vanishes since η(t1)=η(t2)=0\eta(t_1) = \eta(t_2) = 0. For δS=0\delta S = 0 for all η\etaBy The fundamental lemma of the calculus of variations:

LqddtLq˙=0\frac{\partial L}{\partial q} - \frac{d}{dt}\frac{\partial L}{\partial \dot{q}} = 0

\blacksquare

Intuition. Hamilton’s principle says nature is “lazy”: out of all possible paths connecting two configurations, the actual path taken is the one that makes the action stationary. This is a profound generalisation of Fermat’s principle of least time in optics.

3.4 Worked Example: Simple Pendulum

Problem. Derive the equation of motion for a simple pendulum of length ll and mass mm.

Solution. Take θ\theta as the generalised coordinate. The position of the bob is (lsinθ,lcosθ)(l\sin\theta, -l\cos\theta).

T=12m(x˙2+y˙2)=12ml2θ˙2T = \frac{1}{2}m(\dot{x}^2 + \dot{y}^2) = \frac{1}{2}ml^2\dot{\theta}^2

V=mglcosθV = -mgl\cos\theta

L=TV=12ml2θ˙2+mglcosθL = T - V = \frac{1}{2}ml^2\dot{\theta}^2 + mgl\cos\theta

Euler-Lagrange equation:

Lθ=mglsinθ,Lθ˙=ml2θ˙\frac{\partial L}{\partial \theta} = -mgl\sin\theta, \quad \frac{\partial L}{\partial \dot{\theta}} = ml^2\dot{\theta}

ddt(ml2θ˙)+mglsinθ=0    θ¨+glsinθ=0\frac{d}{dt}(ml^2\dot{\theta}) + mgl\sin\theta = 0 \implies \ddot{\theta} + \frac{g}{l}\sin\theta = 0

For small angles (sinθθ\sin\theta \approx \theta): θ¨+glθ=0\ddot{\theta} + \frac{g}{l}\theta = 0Giving simple Harmonic motion with ω=g/l\omega = \sqrt{g/l}. \blacksquare

3.5 Worked Example: Double Pendulum

Problem. Derive the equations of motion for a double pendulum: mass m1m_1 on rod l1l_1Mass m2m_2 on rod l2l_2 attached to m1m_1.

Solution. Generalised coordinates: angles θ1,θ2\theta_1, \theta_2 from the vertical. Position of m1m_1:

x1=l1sinθ1,y1=l1cosθ1x_1 = l_1\sin\theta_1, \quad y_1 = -l_1\cos\theta_1

Position of m2m_2:

x2=l1sinθ1+l2sinθ2,y2=l1cosθ1l2cosθ2x_2 = l_1\sin\theta_1 + l_2\sin\theta_2, \quad y_2 = -l_1\cos\theta_1 - l_2\cos\theta_2

Velocities:

x˙1=l1θ˙1cosθ1,y˙1=l1θ˙1sinθ1\dot{x}_1 = l_1\dot{\theta}_1\cos\theta_1, \quad \dot{y}_1 = l_1\dot{\theta}_1\sin\theta_1

x˙2=l1θ˙1cosθ1+l2θ˙2cosθ2,y˙2=l1θ˙1sinθ1+l2θ˙2sinθ2\dot{x}_2 = l_1\dot{\theta}_1\cos\theta_1 + l_2\dot{\theta}_2\cos\theta_2, \quad \dot{y}_2 = l_1\dot{\theta}_1\sin\theta_1 + l_2\dot{\theta}_2\sin\theta_2

Kinetic energy:

T=12m1(x˙12+y˙12)+12m2(x˙22+y˙22)T = \frac{1}{2}m_1(\dot{x}_1^2 + \dot{y}_1^2) + \frac{1}{2}m_2(\dot{x}_2^2 + \dot{y}_2^2)

=12(m1+m2)l12θ˙12+12m2l22θ˙22+m2l1l2θ˙1θ˙2cos(θ1θ2)= \frac{1}{2}(m_1 + m_2)l_1^2\dot{\theta}_1^2 + \frac{1}{2}m_2 l_2^2\dot{\theta}_2^2 + m_2 l_1 l_2\dot{\theta}_1\dot{\theta}_2\cos(\theta_1 - \theta_2)

Potential energy:

V=m1gl1cosθ1m2g(l1cosθ1+l2cosθ2)V = -m_1 g l_1\cos\theta_1 - m_2 g(l_1\cos\theta_1 + l_2\cos\theta_2)

The Euler-Lagrange equations for θ1\theta_1 and θ2\theta_2 yield two coupled second-order ODEs. For equal masses and lengths (m1=m2=mm_1 = m_2 = m, l1=l2=ll_1 = l_2 = l):

(m+m)l2θ¨1+ml2θ¨2cos(θ1θ2)+ml2θ˙22sin(θ1θ2)+2mglsinθ1=0(m + m)l^2\ddot{\theta}_1 + ml^2\ddot{\theta}_2\cos(\theta_1 - \theta_2) + ml^2\dot{\theta}_2^2\sin(\theta_1 - \theta_2) + 2mgl\sin\theta_1 = 0

ml2θ¨2+ml2θ¨1cos(θ1θ2)ml2θ˙12sin(θ1θ2)+mglsinθ2=0ml^2\ddot{\theta}_2 + ml^2\ddot{\theta}_1\cos(\theta_1 - \theta_2) - ml^2\dot{\theta}_1^2\sin(\theta_1 - \theta_2) + mgl\sin\theta_2 = 0

\blacksquare

3.6 Worked Example: Atwood Machine

Problem. Two masses m1m_1 and m2m_2 (m1>m2m_1 > m_2) are connected by a massless inextensible string over a frictionless pulley. Find the acceleration using the Lagrangian.

Solution

Choose the vertical displacement xx of m1m_1 (downward positive) as the generalised coordinate. Since the string is inextensible, m2m_2 moves up by xx.

T=12m1x˙2+12m2x˙2=12(m1+m2)x˙2T = \frac{1}{2}m_1\dot{x}^2 + \frac{1}{2}m_2\dot{x}^2 = \frac{1}{2}(m_1 + m_2)\dot{x}^2

V=m1gx+m2gx=(m1m2)gxV = -m_1 g x + m_2 g x = -(m_1 - m_2)gx

L=12(m1+m2)x˙2+(m1m2)gxL = \frac{1}{2}(m_1 + m_2)\dot{x}^2 + (m_1 - m_2)gx

Euler-Lagrange equation:

Lx=(m1m2)g,Lx˙=(m1+m2)x˙\frac{\partial L}{\partial x} = (m_1 - m_2)g, \quad \frac{\partial L}{\partial \dot{x}} = (m_1 + m_2)\dot{x}

(m1+m2)x¨=(m1m2)g(m_1 + m_2)\ddot{x} = (m_1 - m_2)g

a=x¨=m1m2m1+m2ga = \ddot{x} = \frac{m_1 - m_2}{m_1 + m_2}g

\blacksquare

3.7 Worked Example: Bead on a Rotating Hoop

Problem. A bead of mass mm slides without friction on a circular hoop of radius RR. The hoop rotates about a vertical diameter with constant angular velocity ω\omega. Find the equilibrium positions and their stability.

Solution

Use the angle θ\theta from the bottom of the hoop as the generalised coordinate. The position of the bead in cylindrical coordinates (ρ,ϕ,z)(\rho, \phi, z):

ρ=Rsinθ,ϕ=ωt,z=Rcosθ\rho = R\sin\theta, \quad \phi = \omega t, \quad z = -R\cos\theta

Velocity:

ρ˙=Rθ˙cosθ,ϕ˙=ω,z˙=Rθ˙sinθ\dot{\rho} = R\dot{\theta}\cos\theta, \quad \dot{\phi} = \omega, \quad \dot{z} = R\dot{\theta}\sin\theta

Kinetic energy:

T=12m(ρ˙2+ρ2ϕ˙2+z˙2)=12mR2θ˙2+12mR2ω2sin2θT = \frac{1}{2}m(\dot{\rho}^2 + \rho^2\dot{\phi}^2 + \dot{z}^2) = \frac{1}{2}m R^2\dot{\theta}^2 + \frac{1}{2}mR^2\omega^2\sin^2\theta

Potential energy:

V=mgRcosθV = -mgR\cos\theta

Lagrangian:

L=12mR2θ˙2+12mR2ω2sin2θ+mgRcosθL = \frac{1}{2}mR^2\dot{\theta}^2 + \frac{1}{2}mR^2\omega^2\sin^2\theta + mgR\cos\theta

Euler-Lagrange equation:

mR2θ¨=mR2ω2sinθcosθmgRsinθmR^2\ddot{\theta} = mR^2\omega^2\sin\theta\cos\theta - mgR\sin\theta

θ¨=sinθ(ω2cosθgR)\ddot{\theta} = \sin\theta\left(\omega^2\cos\theta - \frac{g}{R}\right)

Equilibrium (θ¨=0\ddot{\theta} = 0, θ˙=0\dot{\theta} = 0): sinθ=0\sin\theta = 0 giving θ=0\theta = 0 (bottom), or cosθ=g/(Rω2)\cos\theta = g/(R\omega^2) which exists only when ω2>g/R\omega^2 \gt g/R.

For ω2<g/R\omega^2 \lt g/R: only θ=0\theta = 0 is stable. For ω2>g/R\omega^2 \gt g/R: the bottom becomes unstable and the new equilibria at cosθ=g/(Rω2)\cos\theta = g/(R\omega^2) are stable.

\blacksquare

3.8 Cyclic Coordinates and Conserved Quantities

Definition. A coordinate qjq_j is cyclic (or ignorable) if it does not appear explicitly in the Lagrangian: L/qj=0\partial L / \partial q_j = 0.

Theorem 3.4. If qjq_j is cyclic, the conjugate generalised momentum pj=L/q˙jp_j = \partial L / \partial \dot{q}_j is a constant of motion.

Proof. The Euler-Lagrange equation for a cyclic coordinate is:

ddt(Lq˙j)=0    pj=const\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_j}\right) = 0 \implies p_j = \mathrm{const}

\blacksquare

Intuition. Cyclic coordinates correspond to symmetries of the system. Each symmetry gives a conserved quantity --- this is the essence of Noether’s theorem (Section 5).

3.9 Lagrange Multipliers for Constraints

When holonomic constraints cannot be eliminated by coordinate choice, introduce Lagrange multipliers λa\lambda_a:

ddtLq˙jLqj=aλafaqj\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_j} - \frac{\partial L}{\partial q_j} = \sum_a \lambda_a \frac{\partial f_a}{\partial q_j}

The multipliers λa\lambda_a are proportional to the constraint forces.

3.10 The Energy Function and Its Relation to the Hamiltonian

Definition. The energy function (also called the Jacobi integral) is:

h=jq˙jLq˙jLh = \sum_j \dot{q}_j \frac{\partial L}{\partial \dot{q}_j} - L

Theorem 3.5. If LL does not depend explicitly on time, then hh is conserved. Furthermore, if the transformation ri=ri(q)\mathbf{r}_i = \mathbf{r}_i(q) does not depend explicitly on time and VV is velocity-independent, then h=T+Vh = T + V (the total energy).

Proof. Taking the total time derivative:

dhdt=jq¨jLq˙j+jq˙jddtLq˙jjLqjq˙jjLq˙jq¨jLt\frac{dh}{dt} = \sum_j \ddot{q}_j \frac{\partial L}{\partial \dot{q}_j} + \sum_j \dot{q}_j \frac{d}{dt}\frac{\partial L}{\partial \dot{q}_j} - \sum_j \frac{\partial L}{\partial q_j}\dot{q}_j - \sum_j \frac{\partial L}{\partial \dot{q}_j}\ddot{q}_j - \frac{\partial L}{\partial t}

The q¨j\ddot{q}_j terms cancel. Using the Euler-Lagrange equation ddtLq˙j=Lqj\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_j} = \frac{\partial L}{\partial q_j}:

dhdt=Lt\frac{dh}{dt} = -\frac{\partial L}{\partial t}

If L/t=0\partial L/\partial t = 0Then dh/dt=0dh/dt = 0.

For the second part, when ri=ri(q)\mathbf{r}_i = \mathbf{r}_i(q) (scleronomic) and V=V(q)V = V(q):

T=12i,j,kmiriqjriqkq˙jq˙kT = \frac{1}{2}\sum_{i,j,k} m_i \frac{\partial \mathbf{r}_i}{\partial q_j}\frac{\partial \mathbf{r}_i}{\partial q_k}\dot{q}_j\dot{q}_k

Is a homogeneous quadratic form in q˙j\dot{q}_j. By Euler’s theorem for homogeneous functions:

jq˙jTq˙j=2T\sum_j \dot{q}_j \frac{\partial T}{\partial \dot{q}_j} = 2T

Since L/q˙j=T/q˙j\partial L/\partial \dot{q}_j = \partial T/\partial \dot{q}_j (as VV is velocity-independent):

h=jq˙jTq˙jT+V=2TT+V=T+Vh = \sum_j \dot{q}_j \frac{\partial T}{\partial \dot{q}_j} - T + V = 2T - T + V = T + V

\blacksquare

:::caution Common Pitfall The energy function hh equals T+VT + V only for natural systems (scleronomic constraints and Velocity-independent potentials). For a bead on a rotating hoop (rheonomic constraint), hh is Conserved but hT+Vh \neq T + V. Always check whether the system is natural before identifying hh With the total energy.

:::