Multivariable Calculus, Interactive EditionXYZ Homework Edition

⇩ Download ▾

4.3 Lagrange Multipliers

Most optimization in practice comes with a leash: maximize ff, subject to g=cg = c. The leash changes everything. A constrained maximum is almost never at a critical point of ff itself — our specimen f(x,y)=xyf(x, y) = xy has only a saddle, no maximum at all — yet on the constraint circle x2+y2=4x^2 + y^2 = 4 the problem has clean, finite answers. The question is where to look, and the figure answers it twice over: once on the map, once along a ribbon.

A translucent red-and-blue saddle surface, z equals x times y, with seventeen sky-blue contour lines on the plane z equals 0: hyperbolas, plus a crossed pair of straight lines at level zero. A flat amber circle of radius 2 lies in that plane, and a red curve traces the value of x times y above and below each point of the circle, rising to two crests of height 2 and dipping to two troughs of depth 2. Two red marker points at the crests are hidden in this view; they can be shown by opening the figure in XYZ 3D.Explore in 3D (opens in a new tab)

A translucent red-and-blue saddle surface, z equals x times y, with seventeen sky-blue contour lines on the plane z equals 0: hyperbolas, plus a crossed pair of straight lines at level zero. A flat amber circle of radius 2 lies in that plane, and a red curve traces the value of x times y above and below each point of the circle, rising to two crests of height 2 and dipping to two troughs of depth 2. Two red marker points at the crests are hidden in this view; they can be shown by opening the figure in XYZ 3D.

The translucent red-and-blue saddle z=xyz = xy, its seventeen sky-blue level curves on the plane z=0z = 0 (hyperbolas, plus a crossed pair of lines at level 00), a flat amber circle of radius 22 in that same plane — the constraint x2+y2=4x^2 + y^2 = 4 — and a red curve, the ribbon, that follows the circle while rising and falling with the surface: ff evaluated along the constraint, the only part of the surface the problem is allowed to use. Two marker points at the constrained maxima are hidden in this view; step 4 shows them in the XYZ 3D editor.

Explore

  1. Orbit to a low side view and follow the red ribbon once around. How many crests and how many troughs does it have? Note roughly where the crests sit over the amber circle.
  2. A crest is where ff, walking along the constraint, stops increasing and starts decreasing — it stalls. What is the ribbon's slope, measured along the walk, at a stall?
  3. The ribbon's height over the circle is xyxy. Using symmetry — the product is largest where xx and yy are equal and share a sign — predict the exact coordinates of the two crests and the value of ff there. Commit before revealing.
  4. Press Open in XYZ 3D ↗ under the figure, and in the editor's object list turn on the two hidden Point rows with their eye toggles. They sit at the crests; zoom in and read their positions against the grid. Do they match your ±(2,2)\pm(\sqrt{2}, \sqrt{2}), f=2f = 2?
  5. Now the map view, still in the editor: step the Contours row's z offset box (steps of 0.50.5) from 00 up to 22. The whole family of level curves rides up the saddle as one flat sheet. At crest height, the raised curve xy=2xy = 2 meets the red ribbon at exactly the two marked points — does it cross the ribbon there, or kiss it tangentially? Then set the z offset back to 00 and look straight down: on the floor, the same curve xy=2xy = 2 meets the amber circle directly below the markers, in the same way.
  6. Set the z offset to 11: the raised curve xy=1xy = 1 meets the ribbon at four points, crossing it each time. Over those four points, is the ribbon at a crest, or still rising or falling? Back at z offset 00, the same curve makes four honest crossings of the amber circle. Say the connection out loud: crossing a level curve means the walk is still changing ff. (The 17 levels put drawn curves exactly at the integer values −8,…,8-8, \ldots, 8, so both curves in this step and the last are actually drawn; other level counts can hide them.)

From kiss to equations

At a tangency the constraint curve and the level curve share a tangent line, so their normals point along one line. Those normals are gradients — ∇f\nabla f for the level curve, ∇g\nabla g for the constraint — so at a constrained extremum

∇ f = λ ∇ g \nabla f = \lambda\, \nabla g

for some scalar λ\lambda, the Lagrange multiplier, solved together with g=cg = c. The logic runs through step 6: where the level curve crosses the constraint, level curves of larger and smaller value lie on either side, so sliding along the constraint still changes ff — no extremum there. Only a kiss can stop the walk, and the ribbon says the same thing in its own language: kisses on the map are stalls on the ribbon.

12,−12\frac{1}{2},\; -\frac{1}{2}
The multiplier equation, solved ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The multiplier equation, solved, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The pivot of the example: eliminating xx and yy from the Lagrange equations leaves 4λ2=14\lambda^2 = 1 (written here with LL for λ\lambda), whose two roots λ=±12\lambda = \pm\tfrac{1}{2} hand back the lines y=xy = x and y=−xy = -x and, with the constraint, all four kiss points.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Aligned to OpenStax Calculus Volume 3 (Strang & Herman), © OpenStax (Rice University), licensed CC BY-NC-SA 4.0; no OpenStax content is reproduced, and this work is not affiliated with or endorsed by OpenStax or Rice University. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.