2.1.10Analytical Mechanics

Constraints using Lagrange multipliers

2,074 words9 min readdifficulty · medium1 backlinks

WHY do we need this method?

The WHY: if you ever need to ask "when does the bead fly off the hoop?" or "what is the tension?", the embedded method can't answer it directly. The multiplier method can.


HOW: deriving it from d'Alembert's principle

We start from the foundation, d'Alembert's principle (virtual work of applied + inertial forces vanishes):

k(ddtTq˙kTqkQk)δqk=0.\sum_k \left(\frac{d}{dt}\frac{\partial T}{\partial \dot q_k}-\frac{\partial T}{\partial q_k}-Q_k\right)\delta q_k = 0.

For conservative applied forces this becomes, with L=TVL=T-V:

\sum_{k=1}^{n}\left(\frac{d}{dt}\frac{\partial L}{\partial \dot q_k}-\frac{\partial L}{\partial q_k}\right)\delta q_k = 0. \tag{1}

Why this isn't just "each bracket = 0": if the qkq_k were independent, each δqk\delta q_k is free, so each bracket vanishes — the ordinary Euler–Lagrange equations. But under a constraint f(q,t)=0f(q,t)=0, the δqk\delta q_k are not independent. Taking the variation of the constraint at fixed time:

\delta f = \sum_{k}\frac{\partial f}{\partial q_k}\,\delta q_k = 0. \tag{2}

So (1) must hold only for those δq\delta q obeying (2). We can't set each bracket to zero yet.

Multiply (2) by an as-yet-unknown function λ(t)\lambda(t) and add to (1):

k(ddtLq˙kLqkλfqk)δqk=0.\sum_{k}\left(\frac{d}{dt}\frac{\partial L}{\partial \dot q_k}-\frac{\partial L}{\partial q_k}-\lambda\frac{\partial f}{\partial q_k}\right)\delta q_k = 0.

Now choose λ\lambda to kill the bracket of the one dependent coordinate. The remaining δqk\delta q_k are independent, so every bracket must vanish:

For mm constraints fa=0f_a=0 you sum: the RHS becomes a=1mλafa/qk\sum_{a=1}^{m}\lambda_a \,\partial f_a/\partial q_k.


Figure — Constraints using Lagrange multipliers

WORKED EXAMPLE 1 — Bead on a wire / disk rolling, find the constraint force

Setup: A particle of mass mm slides on the inside of a vertical hoop of radius RR (polar coords r,θr,\theta). Constraint: f=rR=0f = r - R = 0. Find the normal force NN from the hoop.

Lagrangian in plane polar: L=12m(r˙2+r2θ˙2)mgrsinθ.L=\tfrac12 m(\dot r^2+r^2\dot\theta^2)-mgr\sin\theta.

Why polar? Because the constraint is simply r=Rr=R, making f/r=1\partial f/\partial r=1, f/θ=0\partial f/\partial \theta=0 — clean.

rr-equation: ddt(mr˙)mrθ˙2+mgsinθ=λ1.\frac{d}{dt}(m\dot r)-mr\dot\theta^2+mg\sin\theta = \lambda\cdot 1. Why this step? The RHS uses f/r=1\partial f/\partial r = 1.

Apply constraint r=Rr˙=0,r¨=0r=R\Rightarrow \dot r=0,\ddot r=0: mRθ˙2+mgsinθ=λ.-mR\dot\theta^2+mg\sin\theta=\lambda.

Why this is the answer: λ=L\lambda = \partial L-imbalance along rr = the radial constraint force. So N=λ=mgsinθmRθ˙2.N=\lambda = mg\sin\theta - mR\dot\theta^2. The bead leaves the hoop when N=0N=0, i.e. mgsinθ=mRθ˙2mg\sin\theta = mR\dot\theta^2. That question was unanswerable with the embedded method — this is the payoff.


WORKED EXAMPLE 2 — Atwood-style: rope tension via multiplier

Setup: Disk of radius aa, moment II, mass over a pulley etc. Simplify to: a mass mm hangs from a string wound on a cylinder. Let xx = mass drop, ϕ\phi = cylinder rotation. Constraint of "no slipping": f=xaϕ=0.f = x - a\phi = 0.

L=12mx˙2+12Iϕ˙2+mgx.L=\tfrac12 m\dot x^2+\tfrac12 I\dot\phi^2+mgx.

xx-equation: f/x=1\partial f/\partial x = 1 m\ddot x - mg = \lambda. \tag{i} ϕ\phi-equation: f/ϕ=a\partial f/\partial \phi = -a I\ddot\phi = -a\lambda. \tag{ii}

Why these? RHS is λf/q\lambda\,\partial f/\partial q.

Constraint: x¨=aϕ¨ϕ¨=x¨/a\ddot x = a\ddot\phi \Rightarrow \ddot\phi=\ddot x/a. Substitute (ii): Iax¨a=aλ    λ=Ix¨a2.\frac{I}{a}\frac{\ddot x}{a} = -a\lambda \;\Rightarrow\; \lambda = -\frac{I\ddot x}{a^2}. Plug into (i): mx¨mg=Ix¨a2x¨=mgm+I/a2.m\ddot x - mg = -\frac{I\ddot x}{a^2}\Rightarrow \ddot x = \frac{mg}{m+I/a^2}. And the tension is its constraint force magnitude: T=λ=Ix¨a2=mg(I/a2)m+I/a2.T=|\lambda| = \frac{I\ddot x}{a^2}=\frac{mg\,(I/a^2)}{m+I/a^2}. Why T=λT=|\lambda|: λf/x=λ\lambda\,\partial f/\partial x = \lambda is the generalized force on xx from the string = T-T (string pulls up). Sign just tracks direction.


WORKED EXAMPLE 3 — Sphere rolling down an incline (find friction)

Constraint (rolling, no slip): f=xRθ=0f = x - R\theta = 0. With L=12Mx˙2+12Iθ˙2+MgxsinαL = \tfrac12 M\dot x^2 + \tfrac12 I\dot\theta^2 + Mg x\sin\alpha:

  • xx: Mx¨Mgsinα=λM\ddot x - Mg\sin\alpha = \lambda
  • θ\theta: Iθ¨=RλI\ddot\theta = -R\lambda

Same algebra: λ=ffriction\lambda = -f_{\text{friction}}. Solid sphere I=25MR2I=\tfrac25 MR^2 gives x¨=57gsinα\ddot x = \tfrac57 g\sin\alpha and friction λ=27Mgsinα|\lambda| = \tfrac27 Mg\sin\alpha. The multiplier is the static friction force.



Recall Feynman: explain to a 12-year-old

Imagine you're rolling a marble inside a bowl. The bowl pushes the marble to keep it on the surface — that's the "constraint force." Usually in physics we're lazy and just say "the marble stays on the bowl," and we never figure out how hard the bowl pushes. The Lagrange-multiplier trick is like adding a tiny honest helper number λ\lambda to our equations whose only job is to tell us how hard the bowl is pushing at every moment. When that push drops to zero, the marble jumps off the surface!


Active Recall

Why are virtual displacements not independent under a holonomic constraint?
Because δf=k(f/qk)δqk=0\delta f=\sum_k(\partial f/\partial q_k)\delta q_k=0 links them; one δq\delta q is determined by the others.
What is the modified Lagrange equation with one constraint?
ddtLq˙kLqk=λfqk\frac{d}{dt}\frac{\partial L}{\partial\dot q_k}-\frac{\partial L}{\partial q_k}=\lambda\,\frac{\partial f}{\partial q_k}, plus f=0f=0.
Physical meaning of the Lagrange multiplier λ\lambda?
It scales the generalized constraint force Qk(c)=λf/qkQ_k^{(c)}=\lambda\,\partial f/\partial q_k (tension, normal force, friction).
For mm constraints, what is the RHS of the EL equation?
a=1mλafa/qk\sum_{a=1}^{m}\lambda_a\,\partial f_a/\partial q_k.
How many equations and unknowns for nn coords and 1 constraint?
nn EL equations + 1 constraint equation =n+1=n+1, for nn coordinates + λ\lambda.
Why do constraint forces vanish in the embedded (independent-coordinate) method?
Because they do no virtual work (perpendicular to allowed motion), so they drop out when constraints are solved away.
Condition for a bead to leave a circular hoop?
When the normal force λ=mgsinθmRθ˙2=0\lambda=mg\sin\theta-mR\dot\theta^2=0.
Rolling sphere on incline: what does λ\lambda equal?
Minus the static friction force; magnitude 27Mgsinα\tfrac27 Mg\sin\alpha for a solid sphere.
Why must δf\delta f be taken at fixed time (δ\delta, not dd)?
Virtual displacements are instantaneous; the explicit tt-dependence of ff is frozen during a virtual variation.
What's different for non-holonomic constraints?
Use velocity-form aaka_{ak} coefficients: RHS =aλaaak=\sum_a\lambda_a a_{ak}, since kaakq˙k=0\sum_k a_{ak}\dot q_k=0 isn't an integrable f(q,t)=0f(q,t)=0.

Connections

  • Generalized Coordinates and Degrees of Freedom — what we trade when keeping a constraint.
  • d'Alembert's Principle and Virtual Work — the foundation we derived from.
  • Euler-Lagrange Equations — the unconstrained special case (λ=0\lambda=0).
  • Holonomic vs Non-holonomic Constraints — when this method applies vs needs velocity form.
  • Normal Force and Tension as Constraint Forces — the physical payoff.
  • KKT Conditions — the same multiplier idea in optimization/inequality constraints.

Concept Map

solved by

retained by

loses

independent coords give

dependent coords need

varied gives

parallel vectors define

generalized to

enters

recovers

yields

Holonomic constraint f=0

Embedded approach

Multiplier approach

d'Alembert principle

Standard Euler-Lagrange

Constrained variation delta f=0

Lagrange multiplier lambda

Lagrange eqns with multiplier

Constraint force

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, Lagrangian mechanics mein do raaste hote hain constraints handle karne ke. Pehla — "embedded" — jahan hum smart coordinates choose karke constraint ko hata dete hain. Isme equations simple ho jaate hain, lekin ek nuksaan hai: jo constraint force thi (tension, normal force, friction), woh equations se gayab ho jaati hai. Agar tumhe pata karna ho ki "bead hoop se kab udd jaayegi?" ya "rassi mein tension kitna hai?", toh ye method jawab nahi de sakta.

Yahaan Lagrange multiplier λ\lambda aata hai. Hum constraint ko hatate nahi, balki use rakhte hain aur ek unknown number λ\lambda add kar dete hain. Derivation d'Alembert principle se aati hai: constraint ki wajah se virtual displacements δq\delta q independent nahi hote (δf=0\delta f = 0 unko jodta hai). Isliye hum directly har bracket ko zero nahi kar sakte. Trick: λ\lambda ko aise choose karo ki dependent coordinate ka bracket cancel ho jaaye. Result milta hai: ddtLq˙kLqk=λfqk\frac{d}{dt}\frac{\partial L}{\partial \dot q_k} - \frac{\partial L}{\partial q_k} = \lambda \frac{\partial f}{\partial q_k}, aur saath mein constraint f=0f=0.

Sabse important baat — λ\lambda ka physical matlab: λf/qk\lambda \,\partial f/\partial q_k exactly woh generalized constraint force hai. Gradient f\nabla f hamesha constraint surface ke perpendicular point karta hai — bilkul wahi direction jahaan normal force lagti hai. Toh λ\lambda uss force ka magnitude scale hai. Hoop wale example mein N=mgsinθmRθ˙2N = mg\sin\theta - mR\dot\theta^2, aur jab N=0N=0 ho jaata hai tabhi bead udd jaati hai.

Count yaad rakho: nn coordinates + 11 multiplier = nn EL equations + 11 constraint equation. Sab balanced. Galti mat karna — agar tumne coordinate pehle hi eliminate kar diya, toh f/q=0\partial f/\partial q = 0 ho jaayega aur λ\lambda ka koi matlab nahi rahega. Isliye jab constraint force chahiye, redundant coordinate rakho. Mnemonic: "Gradient times lambda gives the push."

Go deeper — visual, from zero

Test yourself — Analytical Mechanics

Connections