Multivariable CalculusOptimization5 of 6
Optimization · 5

Lagrange Multipliers

We often need to find the maximum or minimum of a function f(x,y)\fn{f(x, y)} when the point (x,y)(x, y) has to stay on a curve g(x,y)=cg(x, y) = c.

1

Tangency and the Lagrange Multiplier

When a constraint equation g(x,y)=cg(x, y) = c is complicated, solving it for yy and plugging that into f(x,y)\fn{f(x, y)} leads to messy square roots, and setting ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle} doesn't work because the surface doesn't have to be flat at the highest point of a path. Instead, we look at where the constraint curve meets the level curves of f(x,y)\fn{f(x, y)}.

Tangency and the Lagrange Multiplier
z\htmlClass{lc-mute}{z}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
f(x,y)\htmlClass{lc-blue}{f(x, y)}
∇f=⟨0,0⟩\htmlClass{lc-pink}{\nabla f = \langle 0, 0 \rangle}
g(x,y)=cg(x, y) = c

At the highest or lowest point along the constraint curve g(x,y)=cg(x, y) = c, the constraint curve is tangent to a level curve of f(x,y)\fn{f(x, y)}, which means their perpendicular gradient vectors lie on the same line:

∇f\displaystyle \grad{\nabla f} =λ⏟Lagrange multiplier∇g,g(x,y)\displaystyle = \underbrace{\lambda}_{\text{Lagrange multiplier}} \grad{\nabla g}, \qquad g(x, y) =c\displaystyle = c

Wherever the path g(x,y)=cg(x, y) = c crosses the contour lines of f(x,y)\fn{f(x, y)}, the gradient ∇f\grad{\nabla f} angles forward or backward along the path toward higher values of f\fn{f}; at the exact points where f(x,y)\fn{f(x, y)} reaches a peak or a low point along the path, the contour line is tangent to the path and ∇f\grad{\nabla f} and ∇g\grad{\nabla g} line up along the same line.

Along the trail, you hit a high or low point right where the contour line just touches the trail and the two gradients line up.
2

Optimizing on a Curve

Let's find the maximum and minimum values of f(x,y)=xy\fn{f(x, y) = xy} on the ellipse x2+4y2=8x^2 + 4y^2 = 8.

Optimizing on a Curve
f(x,y)=xy\htmlClass{lc-blue}{f(x, y) = xy}
x2+4y2=8x^2 + 4y^2 = 8
xx
yy
Text solution
1. Match the components of ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g} and include the constraintComputing ∇f=⟨y,x⟩\grad{\nabla f = \langle y, x \rangle} and ∇g=⟨2x,8y⟩\grad{\nabla g = \langle 2x, 8y \rangle} gives three equations for the three unknowns xx, yy, and λ\lambda:
y=2λxx=8λyx2+4y2=8\displaystyle \begin{aligned} y &= 2\lambda x \\ x &= 8\lambda y \\ x^2 + 4y^2 &= 8 \end{aligned}
2. Eliminate λ\lambda to find how xx and yy are relatedBecause x=0x = 0 makes y=0y = 0, y=0y = 0 makes x=0x = 0, and (0,0)\out{(0, 0)} is not on the ellipse, neither coordinate is zero, so we solve both gradient equations for λ\lambda and set them equal:
λ=y2xλ=x8yy2x=x8y8y2=2x2x2=4y2\displaystyle \begin{aligned} \lambda &= \frac{y}{2x} \\ \lambda &= \frac{x}{8y} \\ \frac{y}{2x} &= \frac{x}{8y} \\ 8y^2 &= 2x^2 \\ x^2 &= 4y^2 \end{aligned}
3. Substitute x2=4y2x^2 = 4y^2 into the constraint equationReplacing x2x^2 with 4y24y^2 in the ellipse equation gives the xx- and yy-coordinates of all four tangent points:
4y2+4y2=88y2=8y2=1y=1 or y=−1x2=4(1)=4x=2 or x=−2\displaystyle \begin{aligned} 4y^2 + 4y^2 &= 8 \\ 8y^2 &= 8 \\ y^2 &= 1 \\ y &= 1 \text{ or } y = -1 \\ x^2 &= 4(1) = 4 \\ x &= 2 \text{ or } x = -2 \end{aligned}
4. Evaluate f(x,y)\fn{f(x, y)} at all four candidate pointsPlugging each sign combination (2,1)(2, 1), (−2,−1)(-2, -1), (2,−1)(2, -1), and (−2,1)(-2, 1) into f(x,y)=xy\fn{f(x, y) = xy} tells us which points give the maximum and which give the minimum:
f(2,1)=(2)(1)=2(maximum)f(−2,−1)=(−2)(−1)=2(maximum)f(2,−1)=(2)(−1)=−2(minimum)f(−2,1)=(−2)(1)=−2(minimum)\displaystyle \begin{aligned} \fn{f(2, 1)} &= (2)(1) = \fn{2} \quad (\text{maximum}) \\ \fn{f(-2, -1)} &= (-2)(-1) = \fn{2} \quad (\text{maximum}) \\ \fn{f(2, -1)} &= (2)(-1) = \fn{-2} \quad (\text{minimum}) \\ \fn{f(-2, 1)} &= (-2)(1) = \fn{-2} \quad (\text{minimum}) \end{aligned}
x2+4y2=8x^2 + 4y^2 = 8
xy=2\htmlClass{lc-blue}{xy = 2}
xy=−2\htmlClass{lc-blue}{xy = -2}
xy=2\htmlClass{lc-blue}{xy = 2}
xy=−2\htmlClass{lc-blue}{xy = -2}
(2, 1)(2,\,1)
(−2, −1)(-2,\,-1)
(2, −1)(2,\,-1)
(−2, 1)(-2,\,1)
∇f\htmlClass{lc-pink}{\nabla f}
∇g\htmlStyle{opacity:.7}{\htmlClass{lc-pink}{\nabla g}}
∇f\htmlClass{lc-pink}{\nabla f}
∇g\htmlStyle{opacity:.7}{\htmlClass{lc-pink}{\nabla g}}
xx
yy

So on the ellipse x2+4y2=8x^2 + 4y^2 = 8, f(x,y)=xy\fn{f(x, y) = xy} reaches a maximum of 22 at (2,1)(2, 1) and (−2,−1)(-2, -1), and a minimum of −2-2 at (2,−1)(2, -1) and (−2,1)(-2, 1).

3

Optimizing in Three Variables

For a function of three variables f(x,y,z)\fn{f(x, y, z)} restricted to a constraint surface g(x,y,z)=cg(x, y, z) = c, each constant value f(x,y,z)=k\fn{f(x, y, z) = k} gives a level surface in 3D space, and the maximum and minimum values still happen where a level surface of f\fn{f} is tangent to the constraint surface gg.

Now let's find the maximum and minimum values of f(x,y,z)=x+2y+3z\fn{f(x, y, z) = x + 2y + 3z} on the sphere x2+y2+z2=14x^2 + y^2 + z^2 = 14.

Optimizing in Three Variables
f(x,y,z)=x+2y+3z\htmlClass{lc-blue}{f(x, y, z) = x + 2y + 3z}
z\htmlClass{lc-mute}{z}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
x2+y2+z2=14x^2 + y^2 + z^2 = 14
f=21\htmlClass{lc-blue}{f = 21}
f=−21\htmlClass{lc-blue}{f = -21}
Text solution
1. Set the 3D gradients parallel and include the sphere equationMatching ∇f=⟨1,2,3⟩\grad{\nabla f = \langle 1, 2, 3 \rangle} with λ∇g=λ⟨2x,2y,2z⟩\lambda \grad{\nabla g} = \lambda \grad{\langle 2x, 2y, 2z \rangle} gives a system of four equations:
1=2λx2=2λy3=2λzx2+y2+z2=14\displaystyle \begin{aligned} 1 &= 2\lambda x \\ 2 &= 2\lambda y \\ 3 &= 2\lambda z \\ x^2 + y^2 + z^2 &= 14 \end{aligned}
2. Write yy and zz in terms of xx using λ\lambdaSince λ=0\lambda = 0 would make 1=0\out{1 = 0}, we can divide by 2λ2\lambda to express yy and zz in terms of xx:
x=12λy=22λ=2xz=32λ=3x\displaystyle \begin{aligned} x &= \frac{1}{2\lambda} \\ y &= \frac{2}{2\lambda} = 2x \\ z &= \frac{3}{2\lambda} = 3x \end{aligned}
3. Substitute y=2xy = 2x and z=3xz = 3x into the sphere equationWriting the whole constraint equation in terms of xx gives the two tangent points on the sphere:
x2+(2x)2+(3x)2=14x2+4x2+9x2=1414x2=14x2=1x=1  ⟹  (x,y,z)=(1,2,3)x=−1  ⟹  (x,y,z)=(−1,−2,−3)\displaystyle \begin{aligned} x^2 + (2x)^2 + (3x)^2 &= 14 \\ x^2 + 4x^2 + 9x^2 &= 14 \\ 14x^2 &= 14 \\ x^2 &= 1 \\ x &= 1 \implies (x, y, z) = (1, 2, 3) \\ x &= -1 \implies (x, y, z) = (-1, -2, -3) \end{aligned}
4. Plug both points into f(x,y,z)\fn{f(x, y, z)}Evaluating f(x,y,z)=x+2y+3z\fn{f(x, y, z) = x + 2y + 3z} at (1,2,3)(1, 2, 3) and (−1,−2,−3)(-1, -2, -3) gives the maximum and minimum values:
f(1,2,3)=1+2(2)+3(3)=14(maximum)f(−1,−2,−3)=−1+2(−2)+3(−3)=−14(minimum)\displaystyle \begin{aligned} \fn{f(1, 2, 3)} &= 1 + 2(2) + 3(3) = \fn{14} \quad (\text{maximum}) \\ \fn{f(-1, -2, -3)} &= -1 + 2(-2) + 3(-3) = \fn{-14} \quad (\text{minimum}) \end{aligned}

So on the sphere x2+y2+z2=14x^2 + y^2 + z^2 = 14, f(x,y,z)=x+2y+3z\fn{f(x, y, z) = x + 2y + 3z} has a maximum of 1414 at (1,2,3)(1, 2, 3) and a minimum of −14-14 at (−1,−2,−3)(-1, -2, -3).

The level plane x+2y+3z=k\fn{x + 2y + 3z = k} slices through the sphere x2+y2+z2=14x^2 + y^2 + z^2 = 14 whenever their normal vectors ∇f=⟨1,2,3⟩\grad{\nabla f = \langle 1, 2, 3 \rangle} and ∇g=⟨2x,2y,2z⟩\grad{\nabla g = \langle 2x, 2y, 2z \rangle} point in different directions, and is tangent to the sphere only at (1,2,3)(1, 2, 3) and (−1,−2,−3)(-1, -2, -3) where ∇f\grad{\nabla f} and ∇g\grad{\nabla g} are parallel.

The level plane slices through the sphere everywhere except at the two spots where their normal arrows are parallel.
4

Optimizing on a Closed Region

When the constraint is an inequality g(x,y)≤cg(x, y) \le c, we want the absolute maximum and minimum of f(x,y)\fn{f(x, y)} over an entire region: both its interior g(x,y)<cg(x, y) < c and its boundary curve g(x,y)=cg(x, y) = c. Inside the region, you can step freely in any direction, so a peak or valley can only happen at a flat critical point where ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle}; along the boundary curve, maximums and minimums happen where ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g}.

Let's find the absolute maximum and minimum values of f(x,y)=2x2+y2−2y\fn{f(x, y) = 2x^2 + y^2 - 2y} on the closed disk x2+y2≤4x^2 + y^2 \le 4.

Optimizing on a Closed Region
f(x,y)=2x2+y2−2y\htmlClass{lc-blue}{f(x, y) = 2x^2 + y^2 - 2y}
x2+y2≤4x^2 + y^2 \le 4
x2+y2<4x^2 + y^2 < 4
x2+y2=4x^2 + y^2 = 4
xx
yy
Text solution
1. Set ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle} to find critical points inside the disk x2+y2<4x^2 + y^2 < 4Setting both partial derivatives to zero gives one critical point, which we check in the inequality to make sure it actually lies inside the disk:
∇f=⟨4x,2y−2⟩=⟨0,0⟩4x=0  ⟹  x=02y−2=0  ⟹  y=102+12=1<4(inside the disk)\displaystyle \begin{aligned} \grad{\nabla f = \langle 4x, 2y - 2 \rangle} &= \grad{\langle 0, 0 \rangle} \\ 4x &= 0 \implies x = 0 \\ 2y - 2 &= 0 \implies y = 1 \\ 0^2 + 1^2 &= 1 < 4 \quad (\text{inside the disk}) \end{aligned}
2. Set ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g} on the boundary circle x2+y2=4x^2 + y^2 = 4 and factorInstead of dividing 4x=2λx4x = 2\lambda x by xx (which would lose any boundary solution where x=0x = 0), we move everything to one side and factor:
4x=2λx4x−2λx=02x(2−λ)=02y−2=2λyx2+y2=4\displaystyle \begin{aligned} 4x &= 2\lambda x \\ 4x - 2\lambda x &= 0 \\ 2x(2 - \lambda) &= 0 \\ 2y - 2 &= 2\lambda y \\ x^2 + y^2 &= 4 \end{aligned}
3. Solve the x=0x = 0 case and the λ=2\lambda = 2 case for the boundary pointsPlugging each factor of 2x(2−λ)=02x(2 - \lambda) = 0 into the remaining equations gives four boundary candidates:
If x=0:02+y2=4y=±2  ⟹  (0,2),(0,−2)If λ=2:2y−2=2(2y)2y−2=4y−2=2yy=−1x2+(−1)2=4x2=3x=±3  ⟹  (3,−1),(−3,−1)\displaystyle \begin{aligned} \text{If } x = 0: \quad 0^2 + y^2 &= 4 \\ y &= \pm 2 \implies (0, 2), (0, -2) \\[4pt] \text{If } \lambda = 2: \quad 2y - 2 &= 2(2y) \\ 2y - 2 &= 4y \\ -2 &= 2y \\ y &= -1 \\ x^2 + (-1)^2 &= 4 \\ x^2 &= 3 \\ x &= \pm\sqrt{3} \implies (\sqrt{3}, -1), (-\sqrt{3}, -1) \end{aligned}
4. Evaluate f(x,y)\fn{f(x, y)} at the interior point and all four boundary pointsComparing the values of f(x,y)=2x2+y2−2y\fn{f(x, y) = 2x^2 + y^2 - 2y} at all five candidates gives the highest and lowest values on the disk:
f(0,1)=2(0)2+12−2(1)=−1(absolute minimum)f(0,2)=2(0)2+22−2(2)=0f(0,−2)=2(0)2+(−2)2−2(−2)=8f(±3,−1)=2(3)+(−1)2−2(−1)=9(absolute maximum)\displaystyle \begin{aligned} \fn{f(0, 1)} &= 2(0)^2 + 1^2 - 2(1) = \fn{-1} \quad (\text{absolute minimum}) \\ \fn{f(0, 2)} &= 2(0)^2 + 2^2 - 2(2) = \fn{0} \\ \fn{f(0, -2)} &= 2(0)^2 + (-2)^2 - 2(-2) = \fn{8} \\ \fn{f(\pm\sqrt{3}, -1)} &= 2(3) + (-1)^2 - 2(-1) = \fn{9} \quad (\text{absolute maximum}) \end{aligned}

So on the closed disk x2+y2≤4x^2 + y^2 \le 4, f(x,y)=2x2+y2−2y\fn{f(x, y) = 2x^2 + y^2 - 2y} has an absolute minimum of −1-1 at (0,1)(0, 1) inside the disk and an absolute maximum of 99 at (3,−1)(\sqrt{3}, -1) and (−3,−1)(-\sqrt{3}, -1) on the boundary.

Inside the disk x2+y2≤4x^2 + y^2 \le 4, the minimum at (0,1)(0, 1) happens where ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle}, while along the boundary circle x2+y2=4x^2 + y^2 = 4 the gradient ∇f\grad{\nabla f} is never zero and the maximums and minimums happen at the four points where ∇f\grad{\nabla f} lines up with ∇g\grad{\nabla g}.

Inside the disk, the low point sits where the uphill arrow shrinks to nothing, while on the rim, high and low points happen where the uphill arrow lines up with the wall's outward arrow.
5

What the Multiplier Means

The Lagrange multiplier λ\lambda tells you how fast the maximum or minimum value of f\fn{f} changes when you change the constant cc in the constraint g(x,y)=cg(x, y) = c.

What the Multiplier Means
∇f=λ ∇g\htmlClass{lc-pink}{\nabla f} = \lambda\, \htmlStyle{opacity:.7}{\htmlClass{lc-pink}{\nabla g}}
g(x,y)=cg(x, y) = c
f=max\htmlClass{lc-blue}{f = \text{max}}
∇f\htmlClass{lc-pink}{\nabla f}
∇g\htmlStyle{opacity:.7}{\htmlClass{lc-pink}{\nabla g}}
xx
yy

When g(x,y)=cg(x, y) = c represents a budget or resource limit, increasing that limit from cc to c+1c + 1 increases the maximum value of f\fn{f} by approximately λ\lambda:

Δfmax≈λ(when c increases by 1)\displaystyle \fn{\Delta f_{\text{max}}} \approx \lambda \quad (\text{when } c \text{ increases by } 1)
g=cg = c
f=max\htmlClass{lc-blue}{f = \text{max}}
g=c+1g = c + 1
f≈max+λ\htmlClass{lc-blue}{f \approx \text{max} +} \lambda
xx
yy

Summary

When a constraint g(x,y)=cg(x, y) = c is easy to solve for one variable (such as a line y=2x+1y = 2x + 1), substitute it straight into f(x,y)\fn{f(x, y)} and take a regular derivative. Use Lagrange multipliers when solving the constraint brings in square roots (like an ellipse or circle) or when there are three variables.

On a curve or surface (g=cg = c)

Maximums and minimums happen where the level curve or level surface of f\fn{f} is tangent to the constraint g=cg = c, so their gradients are parallel:

∇f\displaystyle \grad{\nabla f} =λ∇g,g\displaystyle = \lambda \grad{\nabla g}, \qquad g =c\displaystyle = c
Eliminate λ\lambda to relate the coordinates. For f(x,y)=xy\fn{f(x, y) = xy} on x2+4y2=8x^2 + 4y^2 = 8, matching λ=y2x=x8y\lambda = \frac{y}{2x} = \frac{x}{8y} gives x2=4y2x^2 = 4y^2; for f(x,y,z)=x+2y+3z\fn{f(x, y, z) = x + 2y + 3z} on x2+y2+z2=14x^2 + y^2 + z^2 = 14, writing x=12λ,y=22λ,z=32λx = \frac{1}{2\lambda}, y = \frac{2}{2\lambda}, z = \frac{3}{2\lambda} gives y=2xy = 2x and z=3xz = 3x. If a variable appears on both sides of a gradient equation, such as 4x=2λx4x = 2\lambda x, move terms to one side and factor as 2x(2−λ)=02x(2 - \lambda) = 0 rather than dividing by xx.

On a closed region (g≤cg \le c)

Make one list of candidate points combining the interior critical points where ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle} (leaving out any point where g(x,y)≥cg(x, y) \ge c) and the boundary points on g=cg = c where ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g}, then compare f\fn{f} at every candidate.

Sensitivity to the constraint (λ\lambda)

Evaluating λ\lambda at the maximum or minimum point tells you approximately how much the maximum or minimum value of f\fn{f} changes when the resource limit cc in g=cg = c increases by 11 unit.

6

Practice

1

Find the maximum and minimum values of f(x,y)=xy\fn{f(x, y) = xy} on the ellipse x2+9y2=18x^2 + 9y^2 = 18, and the points where they occur.

Set ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g} and solve both gradient equations for λ\lambda: how is x2x^2 related to y2y^2?

Matching ∇f=⟨y,x⟩\grad{\nabla f = \langle y, x \rangle} with λ∇g=λ⟨2x,18y⟩\lambda \grad{\nabla g} = \lambda \grad{\langle 2x, 18y \rangle} gives the system:
y=2λxx=18λyx2+9y2=18\displaystyle \begin{aligned} y &= 2\lambda x \\ x &= 18\lambda y \\ x^2 + 9y^2 &= 18 \end{aligned}
Since neither xx nor yy can be 00 at the maximum or minimum, solve for λ\lambda in both equations and cross-multiply:
λ=y2x=x18y18y2=2x2x2=9y2\displaystyle \begin{aligned} \lambda = \frac{y}{2x} &= \frac{x}{18y} \\ 18y^2 &= 2x^2 \\ x^2 &= 9y^2 \end{aligned}
Substitute x2=9y2x^2 = 9y^2 into the ellipse equation:
9y2+9y2=1818y2=18y2=1  ⟹  y=±1x2=9(1)=9  ⟹  x=±3\displaystyle \begin{aligned} 9y^2 + 9y^2 &= 18 \\ 18y^2 &= 18 \\ y^2 &= 1 \implies y = \pm 1 \\ x^2 &= 9(1) = 9 \implies x = \pm 3 \end{aligned}
(Watch out: taking only the positive roots x=3,y=1x = 3, y = 1 misses (−3,−1)(-3, -1) and misses the minimum −3-3 altogether; likewise, substituting x=9yx = 9y instead of x2=9y2x^2 = 9y^2 gives 90y2=1890y^2 = 18 and a wrong maximum of 95\frac{9}{5}.)
Evaluating f(x,y)=xy\fn{f(x, y) = xy} at all four sign combinations gives a maximum of 33 at (3,1)(3, 1) and (−3,−1)(-3, -1), and a minimum of −3-3 at (3,−1)(3, -1) and (−3,1)(-3, 1).
2

Find the maximum and minimum values of f(x,y,z)=x+2y+4z\fn{f(x, y, z) = x + 2y + 4z} on the ellipsoid x2+2y2+4z2=28x^2 + 2y^2 + 4z^2 = 28, and the points where they occur.

Write ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g} for each coordinate and solve for xx, yy, and zz in terms of λ\lambda: how do the three coordinates compare?

Matching ∇f=⟨1,2,4⟩\grad{\nabla f = \langle 1, 2, 4 \rangle} with λ∇g=λ⟨2x,4y,8z⟩\lambda \grad{\nabla g} = \lambda \grad{\langle 2x, 4y, 8z \rangle} gives:
1=2λx2=4λy4=8λzx2+2y2+4z2=28\displaystyle \begin{aligned} 1 &= 2\lambda x \\ 2 &= 4\lambda y \\ 4 &= 8\lambda z \\ x^2 + 2y^2 + 4z^2 &= 28 \end{aligned}
(Watch out: if you treat the ellipsoid like a sphere and write ∇g=⟨2x,2y,2z⟩\nabla g = \langle 2x, 2y, 2z \rangle, you get y=2xy = 2x and z=4xz = 4x, leading to 73x2=2873x^2 = 28 instead of equal coordinates.)
Divide each gradient equation by the number in front of xx, yy, or zz along with λ\lambda:
x=12λy=24λ=12λ=xz=48λ=12λ=x\displaystyle \begin{aligned} x &= \frac{1}{2\lambda} \\ y &= \frac{2}{4\lambda} = \frac{1}{2\lambda} = x \\ z &= \frac{4}{8\lambda} = \frac{1}{2\lambda} = x \end{aligned}
Substitute y=xy = x and z=xz = x into the ellipsoid equation:
x2+2(x)2+4(x)2=287x2=28x2=4x=±2  ⟹  (2,2,2) and (−2,−2,−2)\displaystyle \begin{aligned} x^2 + 2(x)^2 + 4(x)^2 &= 28 \\ 7x^2 &= 28 \\ x^2 &= 4 \\ x &= \pm 2 \implies (2, 2, 2) \text{ and } (-2, -2, -2) \end{aligned}
Plugging both points into f(x,y,z)=x+2y+4z\fn{f(x, y, z) = x + 2y + 4z} gives a maximum of 1414 at (2,2,2)(2, 2, 2) and a minimum of −14-14 at (−2,−2,−2)(-2, -2, -2).
3

Find the absolute maximum and minimum values of f(x,y)=x2+2y2−2x\fn{f(x, y) = x^2 + 2y^2 - 2x} on the closed disk x2+y2≤4x^2 + y^2 \le 4, and the points where they occur.

After finding the interior critical point where ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle}, look at the yy-equation on the boundary (4y=2λy4y = 2\lambda y): how do you solve it without dividing by yy?

First check the interior x2+y2<4x^2 + y^2 < 4 by setting ∇f=⟨2x−2,4y⟩=⟨0,0⟩\grad{\nabla f = \langle 2x - 2, 4y \rangle} = \grad{\langle 0, 0 \rangle}:
2x−2=0  ⟹  x=14y=0  ⟹  y=012+02=1<4  ⟹  (1,0) is inside\displaystyle \begin{aligned} 2x - 2 &= 0 \implies x = 1 \\ 4y &= 0 \implies y = 0 \\ 1^2 + 0^2 &= 1 < 4 \implies (1, 0) \text{ is inside} \end{aligned}
(Watch out: skipping the interior check ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle} leaves only the boundary points and gives a wrong absolute minimum of 00 at (2,0)(2, 0) instead of −1-1 at (1,0)(1, 0).)
Next check the boundary x2+y2=4x^2 + y^2 = 4 with ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g}:
2x−2=2λx4y=2λy  ⟹  2y(2−λ)=0x2+y2=4\displaystyle \begin{aligned} 2x - 2 &= 2\lambda x \\ 4y &= 2\lambda y \implies 2y(2 - \lambda) = 0 \\ x^2 + y^2 &= 4 \end{aligned}
(Watch out: dividing 4y=2λy4y = 2\lambda y by 2y2y loses the y=0y = 0 case, (2,0)(2, 0) and (−2,0)(-2, 0).)
Plug both cases into the boundary equation:
If y=0:x2+02=4  ⟹  x=±2  ⟹  (2,0),(−2,0)If λ=2:2x−2=4x  ⟹  x=−1(−1)2+y2=4  ⟹  y2=3  ⟹  y=±3  ⟹  (−1,3),(−1,−3)\displaystyle \begin{aligned} \text{If } y = 0: \quad x^2 + 0^2 &= 4 \implies x = \pm 2 \implies (2, 0), (-2, 0) \\ \text{If } \lambda = 2: \quad 2x - 2 &= 4x \implies x = -1 \\ (-1)^2 + y^2 &= 4 \implies y^2 = 3 \implies y = \pm\sqrt{3} \implies (-1, \sqrt{3}), (-1, -\sqrt{3}) \end{aligned}
Compare f(x,y)=x2+2y2−2x\fn{f(x, y) = x^2 + 2y^2 - 2x} at all five points:
f(1,0)=−1f(2,0)=0f(−2,0)=8f(−1,±3)=9\displaystyle \begin{aligned} \fn{f(1, 0)} &= \fn{-1} \\ \fn{f(2, 0)} &= \fn{0} \\ \fn{f(-2, 0)} &= \fn{8} \\ \fn{f(-1, \pm\sqrt{3})} &= \fn{9} \end{aligned}
Absolute maximum 99 at (−1,3)(-1, \sqrt{3}) and (−1,−3)(-1, -\sqrt{3}); absolute minimum −1-1 at (1,0)(1, 0).
4

Find the absolute maximum and minimum values of f(x,y)=x2+y2−12x−16y\fn{f(x, y)} = \fn{x^2 + y^2 - 12x - 16y} on the closed disk x2+y2≤25x^2 + y^2 \le 25, and the points where they occur.

Find the point where ∇f=⟨0,0⟩\grad{\nabla f = \langle 0, 0 \rangle} first, then plug its coordinates into x2+y2x^2 + y^2: does it belong on your candidate list?

Check for interior critical points where ∇f=⟨2x−12,2y−16⟩=⟨0,0⟩\grad{\nabla f = \langle 2x - 12, 2y - 16 \rangle} = \grad{\langle 0, 0 \rangle}:
2x−12=0  ⟹  x=62y−16=0  ⟹  y=862+82=100>25(outside the disk, discard)\displaystyle \begin{aligned} 2x - 12 &= 0 \implies x = 6 \\ 2y - 16 &= 0 \implies y = 8 \\ 6^2 + 8^2 &= 100 > 25 \quad \out{(\text{outside the disk, discard})} \end{aligned}
(Watch out: forgetting to check whether (6,8)\out{(6, 8)} lies inside x2+y2≤25x^2 + y^2 \le 25 and plugging it into f(x,y)\fn{f(x, y)} gives f(6,8)=−100f(6, 8) = -100, the most common wrong answer for the absolute minimum.)
On the boundary x2+y2=25x^2 + y^2 = 25, set ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g}:
2x−12=2λx  ⟹  2x(1−λ)=122y−16=2λy  ⟹  2y(1−λ)=16\displaystyle \begin{aligned} 2x - 12 &= 2\lambda x \implies 2x(1 - \lambda) = 12 \\ 2y - 16 &= 2\lambda y \implies 2y(1 - \lambda) = 16 \end{aligned}
Dividing the second equation by the first cancels 1−λ1 - \lambda:
yx=1612=43y=43x\displaystyle \begin{aligned} \frac{y}{x} &= \frac{16}{12} = \frac{4}{3} \\ y &= \frac{4}{3}x \end{aligned}
Substitute y=43xy = \frac{4}{3}x into x2+y2=25x^2 + y^2 = 25:
x2+(43x)2=25259x2=25x2=9x=3  ⟹  y=4  ⟹  (3,4)x=−3  ⟹  y=−4  ⟹  (−3,−4)\displaystyle \begin{aligned} x^2 + \left(\frac{4}{3}x\right)^2 &= 25 \\ \frac{25}{9}x^2 &= 25 \\ x^2 &= 9 \\ x &= 3 \implies y = 4 \implies (3, 4) \\ x &= -3 \implies y = -4 \implies (-3, -4) \end{aligned}
Evaluate f(x,y)=x2+y2−12x−16y\fn{f(x, y) = x^2 + y^2 - 12x - 16y} at both boundary points:
f(−3,−4)=9+16+36+64=125f(3,4)=9+16−36−64=−75\displaystyle \begin{aligned} \fn{f(-3, -4)} &= 9 + 16 + 36 + 64 = \fn{125} \\ \fn{f(3, 4)} &= 9 + 16 - 36 - 64 = \fn{-75} \end{aligned}
Absolute maximum 125125 at (−3,−4)(-3, -4); absolute minimum −75-75 at (3,4)(3, 4).
5

Maximizing output f(x,y)=xy\fn{f(x, y) = xy} subject to the resource constraint x+2y=100x + 2y = 100 gives a maximum of 12501250 at (50,25)(50, 25). Find the Lagrange multiplier λ\lambda at this point, and state approximately how much the maximum output increases if the resource limit is increased from 100100 to 101101.

Plug (x,y)=(50,25)(x, y) = (50, 25) into ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g}: what value of λ\lambda makes the vectors equal?

Compute ∇f=⟨y,x⟩\grad{\nabla f = \langle y, x \rangle} and ∇g=⟨1,2⟩\grad{\nabla g = \langle 1, 2 \rangle} at (50,25)(50, 25) and set ∇f=λ∇g\grad{\nabla f} = \lambda \grad{\nabla g}:
⟨y,x⟩=λ⟨1,2⟩⟨25,50⟩=λ⟨1,2⟩λ=25\displaystyle \begin{aligned} \grad{\langle y, x \rangle} &= \lambda \grad{\langle 1, 2 \rangle} \\ \grad{\langle 25, 50 \rangle} &= \lambda \grad{\langle 1, 2 \rangle} \\ \lambda &= 25 \end{aligned}
(Watch out: swapping the partial derivatives in ∇f=⟨y,x⟩\grad{\nabla f = \langle y, x \rangle} and writing ⟨50,25⟩\langle 50, 25 \rangle gives the wrong multiplier λ=50\lambda = 50.)
λ=25\lambda = 25; the maximum output increases by approximately 2525 units.