When we optimize a function f(x,y,z) on a single constraint surface g(x,y,z)=c, we look for points where ∇f points entirely in the forbidden direction perpendicular to the surface, ∇f=λ∇g. Now we want to find the maximum and minimum values of f(x,y,z) when we have to satisfy two constraints at the same time, g(x,y,z)=c1 and h(x,y,z)=c2.
1
Optimizing with Two Constraints
Staying on two surfaces g(x,y,z)=c1 and h(x,y,z)=c2 at once restricts us to the curve where the two surfaces intersect.
Optimizing with Two Constraints
At an extreme point on the intersection curve, the direction of fastest increase ∇f cannot have any component along the curve. It must lie entirely in the plane perpendicular to the curve, which is spanned by the two forbidden directions ∇g and ∇h:
∇f=forbidden direction off g=c1λ∇g+forbidden direction off h=c2μ∇h
As you move along the intersection of the cylinder g=c1 and the plane h=c2,∇f pulls along the curve everywhere except at the hottest and coldest points, where it lies flat in the perpendicular plane spanned by ∇g and ∇h.
Along the curve where the two surfaces meet, the temperature keeps changing wherever its gradient leans along the curve, and hits its hottest and coldest spots only where that gradient lies flat in the perpendicular plane made by the two surface gradients.
2
Worked Example: A Cylinder and a Plane
With three coordinates (x,y,z) and two multipliers (λ,μ), we have five unknowns and five equations: the three components of ∇f=λ∇g+μ∇h together with the two constraints g(x,y,z)=c1 and h(x,y,z)=c2.
Let's find the maximum and minimum values of the temperature
f(x,y,z)=x+2y+3z
on the curve where the cylinder g(x,y,z)=x2+y2=2 meets the plane h(x,y,z)=y+z=1, along with the multipliers λ and μ at each point.
Worked Example: A Cylinder and a Plane
Text solution
Match the components of ∇f=λ∇g+μ∇hWe take the gradients of f,g, and h and set their x-, y-, and z-components equal to connect the coordinates through λ and μ.
Use μ and λ to relate x and yPutting μ=3 from the z-component into the y-component lets us compare the x- and y-equations directly without solving for λ first.
22λy2λx=2λy+3=−1=1⟹y=−x
Substitute y=−x into the two constraints to find the candidate pointsPlugging y=−x into the cylinder x2+y2=2 gives the possible values of x, and the plane y+z=1 gives the matching z for each point.
Evaluate f and find λ and μ at each pointWe plug both points into f(x,y,z)=x+2y+3z to find the hottest and coldest spots, then use 2λx=1 and μ=3 to find the multipliers at each one.
f(1,−1,2)=1+2(−1)+3(2)=5(Maximum, with λ=21,μ=3)f(−1,1,0)=−1+2(1)+3(0)=1(Minimum, with λ=−21,μ=3)
So on the curve where the cylinder and plane meet, the maximum temperature is 5 at (1,−1,2) and the minimum temperature is 1 at (−1,1,0).
3
What the Multiplier Means
A multiplier is the rate at which the extreme value of f changes when we adjust the constraint constant.
Suppose we change a single constraint slightly from g(x,y,z)=c to g(x,y,z)=c+Δc, shifting the boundary surface and moving the extreme value fbest (either fmax or fmin).
What the Multiplier Means
When the constraint surface shifts, moving from the old peak to the new one combines a sideways slide along the surface with a step perpendicular to it. Because f has zero rate of change along the surface at an extreme point, a small sideways slide does not change f, so all the change comes from the perpendicular step where ∇f=λ∇g:
Δfbest≈λΔc(λ=dcdfmax or dcdfmin)
With two constraints g(x,y,z)=c1 and h(x,y,z)=c2, changing the constants by small amounts Δc1 and Δc2 adds the effects from both boundaries:
When the surface g(x,y,z)=c shifts to g=c+Δc, the perpendicular step across to the new surface changes the extreme value by λΔc. The extreme value rises when the surface shifts in the direction of ∇f(λΔc>0) and falls when it shifts opposite to ∇f(λΔc<0).
When you nudge the surface, sliding sideways to the new peak adds nothing, so the whole change in the peak value comes from stepping straight across to the new surface.
4
Estimating Changes When Constraints Shift
Once we have the multipliers λ and μ at an extreme point, we can estimate how the maximum or minimum value changes when the constraints shift slightly, without solving the system over again.
In our cylinder-and-plane example (f(x,y,z)=x+2y+3z on x2+y2=2 and y+z=1), we found fmax=5 with λ=21,μ=3 and fmin=1 with λ=−21,μ=3. Let's estimate the new extreme values if we widen the cylinder to x2+y2=2.2 and shift the plane to y+z=1.1.
Estimating Changes When Constraints Shift
Widening the cylinder: Δc1=+0.2 x2+y2=2→2.2,y+z=1
Shifting the plane: Δc2=+0.1 x2+y2=2,y+z=1→1.1
Text solution
Widen the cylinder from x2+y2=2 to x2+y2=2.2 (Δc1=+0.2,Δc2=0)We multiply Δc1=0.2 by the value of λ at each extreme point to estimate how the maximum and minimum temperatures change when the cylinder widens.
Shift the plane from y+z=1 to y+z=1.1 (Δc1=0,Δc2=+0.1)Since μ=3 at both extreme points, sliding the plane upward by Δc2=0.1 raises both the maximum and minimum temperatures by the same amount.
Change both constraints at once to x2+y2=2.2 and y+z=1.1 (Δc1=+0.2,Δc2=+0.1)When both constants shift together, we add the change from widening the cylinder and the change from shifting the plane.
So widening the cylinder to 2.2 and raising the plane to 1.1 increases the maximum temperature to approximately 5.4. Notice that the maximum and minimum can have different multipliers (λ=21 at the maximum, λ=−21 at the minimum), so always pair each extreme value with the multipliers found at that specific point.
Summary
When you optimize f(x,y,z) on a single surface g(x,y,z)=c, there is only one forbidden direction, so ∇f=λ∇g is all you need. When you have to stay on two surfaces g(x,y,z)=c1 and h(x,y,z)=c2 at the same time, you are moving along their intersection curve, and an extreme point occurs where ∇f is built purely out of the two forbidden directions:
∇f=λ∇g+μ∇h
For instance, on x2+y2=2 and y+z=1 with f(x,y,z)=x+2y+3z, write (1,2,3)=λ(2x,2y,0)+μ(0,1,1), use λ and μ to connect the component equations and relate the coordinates (2λx=1 and 2λy=−1 give y=−x), and substitute that relationship into the two constraints.
Once you have solved the problem, do not re-solve the system from scratch if the constraint constants c1 and c2 shift by small amounts Δc1 and Δc2. The multipliers at an extreme point are the rates of change λ=∂c1∂fbest and μ=∂c2∂fbest, so you can estimate the change in the maximum or minimum directly:
Δfbest≈λΔc1+μΔc2
For example, at fmax=5 where λ=21 and μ=3, shifting c1=2 to 2.2(Δc1=+0.2) and c2=1 to 1.1(Δc2=+0.1) changes the maximum by Δfmax≈21(0.2)+3(0.1)=+0.4, giving fmax≈5.4.
5
Practice
1
Find the maximum and minimum values of f(x,y,z)=x+2y+5z on the intersection of the cylinder g(x,y,z)=x2+z2=8 and the plane h(x,y,z)=x+y+2z=6, and give the points and multipliers λ and μ where they occur.
Watch the minus sign here: dropping the negative sign and writing z=x leads to the points (2,0,2) and (−2,12,−2), which both give the wrong value f=12.
Which coordinate is missing from the cylinder x2+z2=8? Start with that component of ∇f=λ∇g+μ∇h to get μ immediately.
Substituting μ=2 into the x- and z-components gives 2λx=−1 and 2λz=1, so z=−x.(Watch the minus sign here: dropping the negative sign and writing z=x leads to the points (2,0,2) and (−2,12,−2), which both give the wrong value f=12; also remember to multiply μ=2 by 2 in the z-component 5=2λz+2μ.)
Plugging z=−x into x2+z2=8 gives 2x2=8, so x=−2 or x=2:
At x=−2:zAt x=2:z=2,−2+y+2(2)=6⟹y=4⟹(−2,4,2)=−2,2+y+2(−2)=6⟹y=8⟹(2,8,−2)
Evaluating f(x,y,z)=x+2y+5z and using 2λx=−1:
Maximum value 16 at (−2,4,2) with λ=41 and μ=2; minimum value 8 at (2,8,−2) with λ=−41 and μ=2.
2
Find the minimum value of f(x,y,z)=x2+y2+z2 subject to the two plane constraints g(x,y,z)=x+y+z=6 and h(x,y,z)=x−y=2, and state the point where it occurs.
Be careful to add both λ's on the right: writing 2x+2y=λ instead of 2λ gives x+y=z, which leads to (25,21,3) and the wrong value 15.5.
Look at the z-component of ∇f=λ∇g+μ∇h to write λ in terms of z, then add the x- and y-components to eliminate μ.
Adding the x- and y-equations eliminates μ and gives 2x+2y=2λ, so x+y=λ=2z.(Be careful to add both λ's on the right: writing 2x+2y=λ instead of 2λ gives x+y=z, which leads to (25,21,3) and the wrong value 15.5.)
Substituting x+y=2z into x+y+z=6 gives 3z=6⟹z=2. Then x+y=4 and x−y=2 give x=3 and y=1, where f(3,1,2)=32+12+22=14.
Minimum value 14 at (3,1,2).
3
Optimizing a function f(x,y,z) subject to g(x,y,z)=10 and h(x,y,z)=5 gives a maximum value fmax=20 with multipliers λ=−2 and μ=4, and a minimum value fmin=6 with multipliers λ=3 and μ=−1. Estimate the new maximum and minimum values if the constraints are changed to g(x,y,z)=10.3 and h(x,y,z)=4.8.
Watch the negative sign on Δc2: using +0.2 instead of −0.2 when h drops from 5 to 4.8 gives the wrong estimates fmax≈20.2 and fmin≈6.7.
Find the signed changes Δc1 and Δc2 first, then pair fmax and fmin with their own multipliers in Δfbest≈λΔc1+μΔc2.
The constraint constants change by Δc1=10.3−10=+0.3 and Δc2=4.8−5=−0.2.(Watch the negative sign on Δc2: using +0.2 instead of −0.2 when h drops from 5 to 4.8 gives the wrong estimates fmax≈20.2 and fmin≈6.7.)
Find the maximum and minimum values of f(x,y,z)=2x+y+2z subject to g(x,y,z)=x2+y2=4 and h(x,y,z)=x+z=3, and then use the multipliers to estimate the new maximum value if the constraints are changed to x2+y2=3.6 and x+z=3.2.
Use the z-component of ∇f=λ∇g+μ∇h to find μ, then look at the x- and y-components together. Since 2λy=1, can λ be zero in 2λx=0?
Substituting μ=2 into the x-component gives 2λx=0. Because 2λy=1 means λ=0, we must have x=0. Then x2+y2=4 gives y=2 or y=−2, and x+z=3 gives z=3:
At (0,2,3):f(0,2,3)=8 (Maximum), with 2λ(2)=1⟹λ=41 and μ=2.
At (0,−2,3):f(0,−2,3)=4 (Minimum), with 2λ(−2)=1⟹λ=−41 and μ=2.
When the constraints shift to x2+y2=3.6 and x+z=3.2, the changes in the constants are Δc1=3.6−4=−0.4 and Δc2=3.2−3=+0.2.(Be sure to use Δc1=−0.4 rather than +0.4, which would give the wrong estimate 8.5.)