2.1.10 · D3Analytical Mechanics

Worked examples — Constraints using Lagrange multipliers

3,457 words16 min readBack to topic

Before we do anything, let us fix the symbols we will reuse everywhere so no notation is ever a surprise:

The gradient is just "how fast changes if I nudge only ". Picture the constraint as a wall; the gradient is the arrow pointing straight out of the wall, and a wall can only push straight out — which is exactly why the constraint force must be times that arrow.


The scenario matrix

Every problem this method can throw at you falls into one of these cells. Each row is a distinct case class we must show at least once.

Cell Case class What is different about it Covered by
A Single length constraint, comes out as a force directly Ex 1
B Constraint linking two coordinates ( and ) appears in two equations, eliminate it Ex 2
C Sign of is negative multiplier points opposite the coordinate Ex 2, Ex 3, Ex 5
D Constraint force that changes sign with position flips sign as the bead goes round Ex 1 / Ex 4
E Degenerate: constraint force (the "fly-off" limit) , object leaves the surface Ex 4
F Rolling / two-body word problem (real world) friction is the multiplier Ex 3, Ex 5
G Two simultaneous constraints, sum over constraints on the RHS Ex 6
H Degenerate: eliminated coordinate () becomes meaningless — the trap Ex 7
I Exam twist: constraint force with an external drive time-dependent Ex 8

We now walk each example, and each is labelled with the cell(s) it fills.


Example 1 — Bead on a vertical hoop (Cells A, D)

Forecast: guess before reading on — will be bigger at the bottom of the hoop or at the top? Write down "bigger at ___".

The figure below (s01) sketches the hoop as a violet circle, the bead as a magenta dot at , the dashed navy radius from centre to bead, the orange arrow that is the radial constraint force , and the small magenta arrow straight down. Keep your eye on the orange arrow — it is the only direction a frictionless hoop can push.

Figure — Constraints using Lagrange multipliers
  1. Write the Lagrangian in polar coordinates. Why this step? Kinetic energy in the plane is — the term is the sideways speed of going around. We choose polar so the constraint is the dead-simple , giving .

  2. Write the -equation with a multiplier. Why this step? The right-hand side is the constraint force along . Since , whatever is, it equals the radial force. In figure s01 the orange arrow points along , straight out of the hoop — exactly where a normal force can point.

  3. Impose the constraint . Why this step? On the hoop never changes, so its time-derivatives die. The radial direction is now pure force balance.

  4. Read off the normal force. Why this step? is the generalized radial force, and because is an ordinary length, that generalized force is a genuine force in newtons.

Verify: At the bottom of the hoop , so : (the sign reflects our convention that points outward; magnitude , largest here). At the top , , which is smaller. This change of sign of with position is Cell D in action. Units: is , and is . ✓


Example 2 — Mass on a string wound round a cylinder (Cells B, C)

Forecast: will the tension be less than , equal to it, or more? Guess.

  1. Lagrangian. Why this step? Two kinetic pieces (falling mass, spinning cylinder) make ; the gravitational potential is (dropping distance lowers height), so .

  2. Two multiplier equations. With and : Why this step? This is Cell B: one shows up in both equations. That single shared unknown is what ties the two motions together.

  3. Use the constraint to link accelerations. . Sub into (ii): Why this step? We now express the mystery purely through , ready to plug into (i).

  4. Solve. Put into (i): Numbers: , so

  5. Tension. Why this step? came out negative (Cell C). By our sign rule, points down, so means a force pointing up — a tension. Its magnitude is .

Verify: , correct — the cylinder's inertia holds the mass back. And : tension is less than the weight, exactly what lets the mass accelerate downward. Newton cross-check: ✓. Did you forecast "less than "?


Example 3 — Solid sphere rolling down an incline (Cells C, F)

Forecast: compared to a frictionless block (), will the sphere accelerate faster or slower?

The figure below (s02) shows the violet incline at , the magenta sphere resting on it, the orange arrow for friction pointing up the slope (this is ), and the navy arrow for the gravity component pointing down the slope. The two opposing arrows are the whole story of why the sphere is slower than a sliding block.

Figure — Constraints using Lagrange multipliers
  1. Lagrangian. Why this step? Same structure as Ex 2, but the "gravity along the coordinate" is only the component down the slope, giving .

  2. Multiplier equations. , :

  3. Constraint , eliminate exactly as before: Why this step? ; since points down-slope, the force points up-slope — that is the friction (Cell C/F), pointing exactly as the orange arrow in s02.

  4. Solve. , so

  5. Friction. Cross-check the "" formula: ✓.

Verify: : the sphere is slower than a frictionless block, because energy also spins it up — matches forecast "slower". Friction points up-slope, which is exactly what supplies the torque to roll it. Units: is N. ✓


Example 4 — The fly-off: bead leaves the hoop (Cells D, E)

Forecast: a smaller or larger angle from the top? Guess "leaves at ___ degrees below the top".

  1. The degenerate condition. The constraint force is a push, never a pull. The bead flies off the instant : Why this step? Cell E is the limiting case . When the multiplier hits zero, the constraint is doing nothing — the surface has let go. This is the exact question the embedded method could never answer. (And it is Cell D too: just above this angle was positive, just below it would go negative — the sign flip.)

  2. Get from energy. Falling from the top, the bead drops a height — using the same relation sketched in figure s01: Why this step? We need in terms of alone to solve. Energy conservation supplies it cleanly.

  3. Combine. Why this step? Set the two expressions for equal; the and cancel — the fly-off angle is universal, independent of size and gravity.

Verify: gives and — the two match, so exactly there ✓. Below the bead has already left. Classic result . ✓


Example 5 — Real-world: two masses over a pulley with rope tension (Cells C, F)

Forecast: which way does the system accelerate, and is between and ?

  1. Write with the linking constraint kept. Measuring both coordinates downward: Why this step? Keeping both coordinates lets appear — that's the tension we want (Cell F, real-world payoff).

  2. Multiplier equations. :

  3. Constraint . Subtract the two equations: Why this step? Subtracting cancels the shared (a common tension acts equally on both sides), and substituting leaves one equation in one unknown — that is why subtraction, not addition, is the right move.

  4. Tension. From the first equation, Why this step? is the generalized force from the rope; points down, so (Cell C) is a force pointing up — the tension. Its magnitude is .

Verify: lies between and ✓ (a real rope must). Check : ✓. Forecast: descends (heavier), in between.


Example 6 — Two constraints at once (Cell G)

Forecast: will (vertical) equal the weight ? Will be nonzero even though the drive is purely along ?

  1. General form for many constraints. With constraints the RHS sums over them: Why this step? Cell G: each constraint gets its own honest helper ; the total constraint force on is the sum of their gradients — this is the same stacking of multipliers you meet in the KKT Conditions.

  2. -equation. . Gradients: , : Why this step? Only mentions , so only survives here. On the shelf is constant, so , giving

  3. - and -equations. , ; contributes nothing: Why this step? The drive enters the -equation (from ); the diagonal wall's gradient splits as in and in .

  4. Impose the constraint and solve. . Subtract the -equation from the -equation: Why this step? Subtraction isolates because the two equations carry it with opposite signs. Adding them instead cancels : along the line.

Verify: (the shelf holds up the weight, forecast ✓). (the diagonal wall reacts even to an axis-aligned push ✓). Check -equation: ✓.


Example 7 — The trap: multiplier on an already-eliminated coordinate (Cell H, degenerate)

Forecast: guess what equals here.

  1. What coordinate survives? After substituting , the only coordinate left is . The constraint no longer mentions any live coordinate. Why this step? This is Cell H, the degenerate case where the constraint has been folded away.

  2. Compute the gradient. (there is no in ), and there is no live to differentiate against. Why this step? The multiplier term vanishes identically can be anything and changes nothing. It is undetermined and meaningless.

  3. The lesson. To get a constraint force you must keep the redundant coordinate ( here) so that can carry . Eliminating it destroys the very information you wanted.

Verify: With retained (Ex 1) we found , a real force; with eliminated we get , no information. Same physics, but only the retained-coordinate route yields . This is exactly Error 1 in the parent's mistake list. ✓


Example 8 — Exam twist: a moving constraint (Cell I, time-dependent )

Forecast: with the bead pushed outward and spinning, is positive (push out) or negative (pull in)?

  1. Lagrangian (no gravity). Why this step? Only kinetic energy; the wire supplies whatever force is needed via the constraint.

  2. -equation with time-dependent constraint. (the -part doesn't affect the spatial gradient): Why this step? Cell I: even though contains explicitly, the gradient in coordinates is still what multiplies . Time enters only through the constraint equation .

  3. Impose the moving constraint. , . At , : Why this step? The steady outward push has , so it needs no force; all that remains is the term .

Verify: is negative → by our sign rule, points outward so means the wire pulls the bead inward (centripetal), because a rotating bead "wants" to fly out and the mechanism resists that. Units: ✓. Forecast check: negative, pulling inward.


Recall One-line summary of the whole matrix

In every single cell the recipe was identical — write keeping the constrained coordinate, put on the right, apply , read as the force — and the only things that changed were how many 's and what sign they carried.

Active recall

Which cell? Bead flies off a dome — which scenario cell and what is the trigger condition?
Cell E; the multiplier (normal force) reaches zero, .
Why did tension come out as and not ?
Because was negative — and since points down, a negative multiplier is a force pointing up; the magnitude is the tension.
In Example 7, what is and why is that fatal?
It is , because was eliminated so holds no live coordinate; the multiplier term vanishes and no constraint force can be recovered.
For simultaneous constraints, what replaces the single ?
The sum , one multiplier per constraint.
Why does (not ) appear in the hoop's potential?
Because is measured up from the horizontal, so the height is and .