Skip to content
Tutorials Center
My learning

Topics

Lesson 14 of 44 · Calculus of Variations

Constraints, Lagrange Multipliers and the Catenary

Learn Lagrange multipliers for ordinary calculus and for variational problems with a fixed length, then derive and compute the catenary shape of a hanging chain.

Many optimization problems come with a side condition. A rectangle with a fixed perimeter has the largest area when it is a square. A chain of fixed length hangs in the shape that has the lowest possible potential energy. The standard tool is the Lagrange multiplier: you add the constraint to the quantity being optimized, multiplied by a new unknown number, and treat everything together. The same device will return in chapter 4, where it gives the constraint forces we have been avoiding.

A hanging chain of fixed length between two supports, with a catenary and a dashed parabola.
A hanging chain minimizes its potential energy at fixed length: that curve is a catenary, not a parabola.

What you will learn

  • How Lagrange multipliers work for a function of several variables.
  • How to extend them to an integral constraint (isoperimetric problems).
  • How to derive the shape of a hanging chain.
  • How to compute the parameters of a catenary numerically.

Key terms

A constraint is a condition g = 0 that the solution must satisfy. A Lagrange multiplier λ is an unknown constant multiplying the constraint. An isoperimetric problem fixes an integral such as a length or an area. A catenary is the curve y = a cosh(x/a).

Multipliers in ordinary calculus

Maximize f(x, y) = x y subject to x + y = 10 (a rectangle of half-perimeter 10). At the best point the gradient of f is parallel to the gradient of the constraint function g = x + y − 10, so

Text
∇f = λ ∇g        ⇒        y = λ,   x = λ

together with the constraint x + y = 10 gives x = y = 5: a square, with area 25. The multiplier λ = 5 has a meaning, too: it tells you how fast the best value of f grows if you relax the constraint a little (d(max f)/d(10) = 5). Equivalent recipe: build F = f − λ g and set all partial derivatives, including ∂F/∂λ, to zero.

Multipliers for functionals

Extremize S[y] = ∫ L(y, y′, x) dx subject to a fixed value of C[y] = ∫ G(y, y′, x) dx. The recipe is the same: apply the Euler-Lagrange equation to the combined integrand

Text
L̃ = L + λ G

and choose λ (and the integration constants) so the constraint and the endpoint conditions hold.

The hanging chain

A uniform chain with mass per unit length ρ hangs between two points at the same height. Take y upward. The potential energy and the fixed length are

Text
U[y] = ρ g ∫ y √(1 + y′²) dx        C[y] = ∫ √(1 + y′²) dx = ℓ

Form L̃ = (y + λ′) √(1 + y′²) (absorbing ρ g into λ′ = λ/(ρ g)). It has no explicit x, so Beltrami's identity gives

Text
(y + λ′) / √(1 + y′²) = a        (a constant)

Solving for y′ yields y′ = √(((y + λ′)/a)² − 1), whose solution is

Text
y = a cosh((x − x₀)/a) − λ′

the catenary, from the Latin for chain. By symmetry, x₀ is the midpoint. For supports at x = ±d the length of the chain is ℓ = 2 a sinh(d/a), which fixes a for a given span 2d and length ℓ. The sag below the supports is a (cosh(d/a) − 1).

Galileo believed a hanging chain would be a parabola. Close, but wrong: the exact answer is the cosh curve, which was found by Leibniz, Huygens and Johann Bernoulli in 1691. The inverted catenary is also the ideal shape for a masonry arch: the Gateway Arch in St. Louis follows a (weighted) catenary.

Worked example. Span 2d = 4 m, chain length ℓ = 5 m. We need 5 = 2a sinh(2/a). This transcendental equation has no closed-form solution, but a root finder gives it quickly (see below).

Worked examples with numbers

Rectangle. Maximize the area A = xy of a rectangle with perimeter 2x + 2y = 20 m. Set ∇A = λ ∇g with g = 2x + 2y − 20. Then y = 2λ and x = 2λ, so x = y = 5 m and A = 25 m², with λ = 2.5. The multiplier has a meaning: the best area as a function of perimeter P is P²/16, and dA/dP = P/8 = 2.5 m, exactly λ. A multiplier is the "price" of the constraint: how much the optimum changes if you relax it by one unit.

Hanging chain. A uniform chain of length 10 m is hung from two points at the same height, 8 m apart. The shape is y = a cosh(x/a) plus a shift, with half-span 4 m and half-length 5 m, so a must satisfy a sinh(4/a) = 5. Solving numerically gives a ≈ 3.38 m. The sag is a (cosh(4/a) − 1) ≈ 2.65 m. A longer chain sags more and a shrinks; a chain almost as long as the span is nearly straight and a grows large. Galileo guessed that a hanging chain is a parabola; Jakob Bernoulli, Huygens and Leibniz showed in 1691 that it is a catenary.

Why the multiplier works

At the constrained optimum the gradient of the objective cannot have any component along the constraint surface (otherwise sliding along it would improve the objective). So ∇f must be perpendicular to the surface, which is also the direction of ∇g; hence ∇f = λ ∇g. For a functional the same idea holds with δJ = λ δK, giving the Euler-Lagrange equation for the augmented integrand.

The isoperimetric problem

Among all closed curves of a given length, which encloses the most area? The answer, the circle, was assumed by the Greeks (the legend of Queen Dido marking out Carthage with an ox-hide cut into strips is the traditional story), but a rigorous proof had to wait for the nineteenth century (Steiner, then Weierstrass using the calculus of variations). For length L = 10 m a circle encloses L²/(4π) = 7.96 m², against 6.25 m² for a square: a quantitative reminder of why soap bubbles are round.

Common misconceptions

"A hanging chain makes a parabola." A parabola is the shape of a chain carrying a uniform load per horizontal length, like a suspension-bridge cable with a heavy deck. A chain carrying only its own weight is a catenary.

"The multiplier is just a trick." It has meaning: for the chain, λ′ shifts the height origin, and in mechanics (chapter 4) multipliers equal constraint forces.

"Constraints can be ignored if the solution looks right." The constraint selects among a family of solutions; without it the problem has no answer.

Try it

First the ordinary-calculus multiplier problem, with SymPy solving the three equations together.

Python Lagrange multipliers: the rectangle problem

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Now the catenary. Given a span and a chain length, find a, plot the shape and compare it with a parabola of the same sag. We also check the length by numerical integration.

Python Catenary of a given length and span

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 5 questions

of 5 answered You scored / 5 · perfect!

  1. 1. In ordinary calculus, at a constrained maximum of f subject to g = 0, the gradients satisfy:

    At a constrained extremum the gradient of f is parallel to the gradient of g.
  2. 2. For an isoperimetric variational problem, which integrand do we feed to the Euler-Lagrange equation?

    The constraint integrand G is added with a multiplier λ.
  3. 3. Which quantity is minimized by a hanging chain?

    The chain settles to the lowest-energy shape allowed by its fixed length.
  4. 4. What is the general form of the catenary?

    The hyperbolic cosine arises from Beltrami's identity applied to (y + λ′)√(1 + y′²).
  5. 5. For a chain between supports at x = ±d, how are length ℓ and parameter a related?

    ∫ from −d to d of cosh(x/a) dx = 2 a sinh(d/a).

Summary

  • A Lagrange multiplier handles a constraint: ∇f = λ ∇g, or for functionals, extremize L + λ G.
  • The hanging chain minimizes U = ρ g ∫ y ds with fixed length; Beltrami's identity gives the catenary y = a cosh(x/a).
  • Length and span fix a through ℓ = 2 a sinh(d/a).
  • A parabola is only an approximation (it describes a uniformly loaded cable).

Next: Chapter 3 Review