338 CHAPTER 18. OPTIMIZATION

and you would expect its partial derivatives to be 0 at the point of interest. By the chainrule (never mind the mathematical questions on existence), at this special point,

fx + fzzx = 0, fy + fzzy = 0

By the process of implicit differentiation applied to g(x,y,z) = 0,

zx =−gx

gz, zy =−

gy

gz

Thus,

fx = fzgx

gz=

(fz

gz

)gx, fy = fz

gy

gz=

(fz

gz

)gy, fz =

(fz

gz

)gz

So letting λ = fz(x0,y0,z0)gz(x0,y0,z0)

, it follows that at this point

∇ f (x0,y0,z0) = λ∇g(x0,y0,z0)

The situation in which it is x or y that is a function of the other variables is exactly similar.Also, if there are more or fewer variables there is no difference in the argument. This λ iscalled a Lagrange multiplier after Lagrange who considered such problems in the 1700’s.

Example 18.5.1 Maximize xyz subject to x2 + y2 + z2 = 27.

Here f (x,y,z) = xyz while g(x,y,z) = x2 + y2 + z2−27. Then ∇g(x,y,z) = (2x,2y,2z)and ∇ f (x,y,z)= (yz,xz,xy). Then at the point which maximizes this function1, (yz,xz,xy)=λ (2x,2y,2z) . Therefore, each of 2λx2,2λy2,2λ z2 equals xyz. It follows that at any pointwhich maximizes xyz, |x|= |y|= |z|. Therefore, the only candidates for the point where themaximum occurs are

(3,3,3) ,(−3,−3,3)(−3,3,3)

etc. The maximum occurs at (3,3,3) which can be verified by plugging in to the functionwhich is being maximized.

The method of Lagrange multipliers allows you to consider maximization of functionsdefined on closed and bounded sets. Recall that any continuous function defined on aclosed and bounded set has a maximum and a minimum on the set. Candidates for theextremum on the interior of the set can be located by setting the gradient equal to zero. Theconsideration of the boundary can then sometimes be handled with the method of Lagrangemultipliers.

Example 18.5.2 Maximize f (x,y) = xy+ y subject to the constraint, x2 + y2 ≤ 1.

Here I know there is a maximum because the set is the closed disk, a closed and boundedset. Therefore, it is just a matter of finding it. Look for singular points on the interior of thecircle. ∇ f (x,y) = (y,x+1) = (0,0). There are no points on the interior of the circle wherethe gradient equals zero. Therefore, the maximum occurs on the boundary of the circle.That is, the problem reduces to maximizing xy+ y subject to x2 + y2 = 1. From the above,

(y,x+1)−λ (2x,2y) = 0.

1There exists such a point because the sphere is closed and bounded.