You are on page 1of 16

I.g Maximum and Minimum. Lagrange Multipliers Recall: Suppose we are given y = f (x).

We recall that the maximum/minimum points occur at the following points: (1) where f = 0; (2) where f does not exist; (3) on the frontier (if any) of the domain of f . Not all points x0 which satisfy one of the above three conditions are maximum or minimum. To distinguish among points of type (1), we have the second derivative test: f (x0 ) = 0 and f (x0 ) < 0, then x0 is a maximum; f (x0 ) = 0 and f (x0 ) > 0 imply x0 is a minimum; f (x0 ) = 0 means the test fails. Example 1. Let f (x) = x2 . Then f has a single minimum at x = 0, where

f (x) = 0. Note f (x) = 2 > 0. Example 2. does not exist.


y

Let f (x) = |x|. Then f has a single minimum at x = 0. Here f

y = f (x)

Example 3.

Let f (x) = x, but the domain of f is the interval 0 x 1. Note


61

f (x) = 1, and yet f has a maximum at x = 1 and at minimum at x = 0. These

are points on the frontier of the domain.


y

y = f (x) 0 1 x

We now pass to consider the case w = f (x, y, z). We shall only consider situations corresponding to the earlier cases (1) and (3). Case (2) will not be considered in this course. Suppose w has a maximum (or a minimum) at a point P0 = (x0 , y0 , z0 ) properly inside the domain of w. Then, xing y = y0 and z = z0 gives a function of the single variable x, namely f (x, y0 , z0 ). This will have a maximum (or a minimum) when x = x0 and so
f (x0 , y0 , z0 ) x

= 0. In the same way, f (x0 , y0 , z0 ) = 0. z

f (x0 , y0 , z0 ) = 0, y

w = f ( x 0 , y0 , z 0 ) ( x 0 , y0 , z 0 )

So, maximum (or minimum) inside the domain of f occur at the points where f /x = f /y = f /z = 0 (or f = 0). We term all points, where f = 0,

critical points and note that as in the one dimensional case, not all such points need be maximum or minimum.
62

To nd which points (x, y, z) amongst those satisfying f (x, y, z) = 0 are maximum, which are minimum and which are neither, we have a second derivative test, analogous to the one for the one dimensional case. We give this test only for the case w = f (x, y), and remark that it depends on the second partial derivative matrix being denite. For the purposes of this course it suces to know: Suppose (x0 , y0 ) satises (x0 , y0 ). If
2 a) fxx fyy fxy > 0 and fxx < 0, then (x0 , y0 ) is a maximum; 2 b) fxx fyy fxy > 0 and fxx > 0, then (x0 , y0 ) is a minimum; 2 c) fxx fyy fxy < 0, then (x0 , y0 ) is a saddle point (see below); 2 d) fxx fyy fxy = 0, test fails: (x0 , y0 ) could be anything. 2 f (x0 , y0 ) = 0. Then calculate fxx fyy fxy at

Remark.

A saddle point P is, as its name indicates, related to what a cowboy f (P ) = 0.

sits on. It is neither a maximum nor a minimum, even though


P

Remark.

Suppose we have w = f (x, y, z), and we only wish to nd either the

absolute maximum or the absolute minimum. One very simple way, often quite useful in practice is to calculate all points where f = 0, and then use physical

intuition and/or evaluation of f at all these points. Choose the point(s) where f is largest or smallest, as needed. In such a situation, you need not calculate second derivatives of f . However, note that if
63

f = 0 at just one point and physical

intuition fails, it will be impossible to tell in this way whether it is a maximum, minimum or nothing. Example 1. Find all critical points of w = x2 2x + y 2 and classify them as maximum, minimum or saddle points. Answer. (1) w w = 2x 2, = 2y, so x y w = 0 i x = 1, y = 0. This is the only

critical point. (2) We now use the second derivative test: 2w = 2, x2 and so 2w 2w 2w > 0, x2 y 2 xy and since 2 w/x2 > 0 we conclude that x = 1, y = 0 is a minimum. Example 2. Same as Example 1, except now w = x4 xy + y 4 . w w = 4x3 y, = 4y 3 x and so we need x y 4x3 y = 0 4y 3 x = 0
64

2w = 2, y 2

2w =0 xy

Answer.

Now:

and so (4x3 )3 = y 3 = i.e., 4 4 x9 = x and either x = 0, or 44 x8 = 1, whence x = 1/2. We thus have three critical points: (0, 0), (1/2, 1/2), (1/2, 1/2). To see what they are, use the second derivative test: 2w = 12x2 , 2 x Hence at (0, 0) 2w 2w x2 y 2 and (0, 0) is a saddle point. At (1/2, 1/2): 2w 2w x2 y 2 2w xy
2

x , 4

2w = 12y 2 , 2 y

2w = 1. xy

2w xy

= 1 < 0

= 12

1 4

12

1 4

(1)2 > 0

and

2w >0 x2

so (1/2, 1/2) is a minimum. At (1/2, 1/2): 2w 2w x2 y 2 2w xy


2

> 0 and

2w > 0, x2

so (1/2, 1/2) is also a minimum. In the above examples, the domain of f had no frontier, so max./min. (if any) had to occur inside the domain. We now consider the case where the domain has a frontier where maximum/minimum could also occur. To nd these new possible
65

points, we note that in practice the boundary of a domain is given by a surface which constrains the domain, i.e., on the boundary of the domain the variables satisfy some relationship of the form g(x, y, z) = 0 (see below). We are thus led to the problem: Given: w = f (x, y, z) and a constraint g(x, y, z) = 0 nd all max./min. We solve this problem by the method of Lagrange Multipliers. Suppose we could solve g(x, y, z) = 0 for z = z(x, y), say, and substituted this expression for z into w = f (x, y, z). We now have w = f (x, y, z) just as a function of (x, y), and we can proceed as before to nd points where the gradient is zero! Note that since z is a function of (x, y) from g, we seek those (x, y) such that f z f + =0 x z x f z f + = 0. y z y How do we nd z/x, z/y? We use g(x, y, z) = 0! So g g z + = 0, and we have x z x g g z + =0 y z y z = (g/x)/(g/z) x z = (g/y)/(g/z) y f f + x z f f + y z (g/x) =0 (g/z) (g/y) = 0. (g/z) (1) (2)

and, substituting into (1), (2) we get

Put = (f /z)/(g/z). is called a Lagrange Multiplier. We then have at


66

max./min. for the constrained problem f g =0 x x f g =0 y y g f = 0, z z plus the constraint g(x, y, z) = 0. Summary: Given w = f (x, y, z), with the constraint g(x, y, z) = 0, set H = f g. The maximum/minimum are amongst those points (x, y, z) where H H H H = = = = 0. x y z Note that H/ = 0 is simply g(x, y, z) = 0, i.e., the constraint. We remark that if (x, y) satisfy (3), then it does not mean they are max./min. For the purposes of this course, we shall use (3) only to nd the absolute maximum/minimum (see below). Remark. Suppose we have a problem with more constraints, e.g., w = f (x, y, z) (3)

with g(x, y, z) = 0 and h(x, y, z) = 0. The same procedure gives: H = f g h, with 2 Lagrange Multipliers , , and we need to solve the equations H H H H H = = = = = 0. x y z

Remark.

It is very dicult, in general, to solve for x, y, z (andif need be)


67

in the equations H H H H = = = = 0. x y z Observe however, that since we seek the absolute max./min. of f , it does not matter if we solve these equations exactly, in the following sense: Make sure you do not miss points, but it is OK to include extra points (x, y, z) which may not satisfy all of the above equations, as long as such points satisfy the constraint. We just evaluate f at all of the points we have found, and choose those points where f is biggest or smallest. This may make the situation a little simpler, at expense of a bit of extra work: namely evaluating f at more points! See the examples below.

Remark.

There is another way to note that an absolute maximum of w = f (x, y)

on the constraint g(x, y) = 0 we must have f /x = g/x, f /y = g/y and of course g(x, y) = 0. Specically, consider the gure shown, where the constraint g(x, y) = 0 (a curve in this case!) is plotted.
f (x , y) = c2

g (x , y) = 0

f (x , y) = c1

f (x , y) = c*

We also plot curves f (x, y) = c, for various values of c, in the same gure. Now suppose f (x, y) = c1 properly intersects the curve g(x, y) = c1 . Then c1 cannot be the maximum of f (x, y) on g(x, y) = 0, since the cuve f (x, y) = c2 will also
68

intersect g(x, y) = 0 for some c2 bigger than c1 and very close to c1 . It follows that at c , the largest value of c for which f (x, y) = c intersects g(x, y) = 0, the curves f (x, y) = c and g(x, y) = 0 must be tangential to each other, i.e., their normals must point in the same (or opposite) direction and this We now consider the following examples. Example 1. Find the absolute maximum and the absolute minimum of f = xy on x2 + y 2 + z 2 = 1. Answer. Here H = f g where g = x2 + y 2 + z 2 1, so H = xy (x2 + y 2 + z 2 1), then H = y (2x) = 0 x H = x (2y) = 0 y H = 2z = 0 z H = (x2 + y 2 + z 2 1) = 0. We focus on the 3rd equation: 2z = 0. Thus either = 0 or z = 0. If = 0, then x = y = 0 from the rst two equations. But x2 + y 2 + z 2 = 1 and thus z = 1. On the other hand, if z = 0, then y = 2x, x = 2y. f = g for some .

Observe that if = 0, then x = 0, y = 0. So it looks like we found the point = 0 and (0, 0, 0). We cannot keep this point, since it is o the constraint surface
69

x2 + y 2 + z 2 = 1. Note that if f (0, 0, 0) were smaller or bigger than f at the other points we found (this is not the case for this specic problem), then we would conclude that (0, 0, 0) would be a min or a max, and this would be wrong. On the other hand, if (0, 0, 0) had actually satised the constraint we could simply keep it and evaluate f there at the end. After all this, we conclude that = 0 and so xy = 2x2 xy = 2y 2 and thus x2 = y 2 . We have from the constraint 2x2 = 1 or x = 1/ 2. Since also 2y 2 = 1 then y = 1/ 2. We conclude that a max./min. must be among the points (1/ 2, 1/ 2, 0), (1/ 2, 1/ 2, 0), (1/ 2, 1/ 2, 0), (1/ 2, 1/ 2, 0). We had earlier found the points (0, 0, 1), (0, 0, 1). All of these 6 points satisfy the constraint, and the easiest thing is just to evaluate f at all of them. We nd f has the absolute maximum of 1/2 at (1/ 2, 1/ 2, 0) and (1/ 2, 1/ 2, 0); the absolute minimum of 1/2 at (1/ 2, 1/ 2, 0), (1/ 2, 1/ 2, 0). Example 2. origin. Answer. Let (x, y, z) be a given point. Its distance to the origin is x2 + y 2 + z 2 . arguments, its easiest to work with D(x, y, z) = distance 2 = x2 + To avoid Find the points on the surface x2 = yz + 2 that are nearest to the

y 2 + z 2 . So we wish to minimize D(x, y, z) if (x, y, z) must satisfy the constraint H = x2 = yz + 2 or g(x, y, z) = x2 yz 2 = 0. We set H = D g. Then x H H H = = = 0 give y z 2x 2x = 0
70

2y + z = 0 2z + y = 0 x2 yz 2 = 0. The rst equation gives two possibilities: either x = 0 or x = 0. Suppose rst x = 0. Then = 1 and so 2y + z = 0 2z + y = 0 x2 = 2 4y y = 0,

i.e., y = 0 and then z = 0. We get from the last equation or x = 2.

So we have found two possible points: ( 2, 0, 0), ( 2, 0, 0). Next, suppose x = 0. Then 2y + z = 0 2z + y = 0 yz = 2. Multiplying the rst equation by z, the second by y: 2zy = z 2 z 2 = y 2 . 2zy = y 2

Now = 0 (otherwise y = 0, z = 0 contradicting the 3rd equation) and so z 2 = y 2 ,

i.e., z = y. But the 3rd equation gives that z and y have opposite sign. We thus conclude z = y and y 2 = 2 or y = 2. So we have 2 more points: (0, 2, 2), (0, 2, 2). We now note from the nature of the problem that there are points on the
71

surface where D is smallest and evaluate D at the four candidates: D( 2, 0, 0) = 2, D(0, 2, 2) = 4, D( 2, 0, 0) = 2 D(0, 2, 2) = 4.

Consequently, the points nearest the origin are ( 2, 0, 0), and their distance = D = 2. Remark. It is possible to do this problem in a dierent way, which removes the

constraint. We have D = x2 + y 2 + z 2 , but x2 = yz + 2 and so D = y 2 + z 2 + yz + 2. Note that (y, z) are not constrained except for the fact that x2 = yz + 2 0, i.e., yz 2 and D is now D(x, y). We then have D = 2y + z, y So D = 0 at 2y + z = 0 2z + y = 0 = y = 0 (and so z = 0). D = 2z + y. z

2 But Dyy = 2, Dyz = 1, Dzz = 2, i.e., Dyy Dzz Dyz > 0 and so y = 0, z = 0 gives

a minimum where D = 2. In the previous example, we had the luxury of two dierent methods! Example 3. A at plate has the shape of the unit disc: x2 + y 2 1. The plate is heated, so that the temperature T (x, y) is given by T (x, y) = 2x2 + y 2 y. Find the hottest and coldest points of the plate. Answer. We rst seek maximum/minimum points properly inside the disc (i.e.,
72

x2 + y 2 < 1). Here T = 2x2 + y 2 y gives T = 4x, x 2T =4 x2 So, T = 2y 1 y 2T = 0, xy 2T = 2. y 2

2T 2T the disc, so we proceed: x2 y 2 a minimum.

T = 0 at 4x = 0, 2y 1 = 0 or x = 0, y = 1/2 . This point is properly inside 2T xy


2

> 0 and at (x = 0, y = 1/2) T has

We now check for max./min. on the frontier of the domain: x2 + y 2 = 1. So we seek max./min. T = 2x2 + y 2 y subject to the constraint x2 + y 2 = 1 or x2 + y 2 1 = 0. Put H = T g = (2x2 + y 2 y) (x2 + y 2 1) So H/x = H/y = H/ = 0 give: 4x 2x = 0 2y 1 2y = 0 x2 + y 2 = 1. Now = 0, for otherwise x = 0, y = 1/2 and the 3rd equation fails. Now 2x(2 ) = 0 2y(1 ) = 1. The rst equation gives either x = 0 or = 2. If x = 0, then y = 1 (3rd equation). If = 2, then y = 1/2 and so x2 = 3/4 (3rd equation). I.e., x = 3/2. We have
73

thus found the possible points: (0, 1), (0, 1), 3 1 , 2 2 , 3 1 , 2 2

and the earlier point (a minimum): (0, 1/2). We evaluate T at all of them: 1 2 1 4

T (0, 1) = 0, 3 1 , 2 2

T (0, 1) = 2, 3 3 = + , 2 4 T

0,

= =

3 1 , 2 2

3 3 + . 2 4

So we have: absolute minimum at (0, 1/2), absolute maxima at ( 3/2, 1/2), ( 3/2, 1/2).
y

( 0, 1 2) x

(-

3 2, 1 2)

( 3 2, -1 2)

Example 4.

Find the absolute max./min. of f = x + y + z on the surface

x4 + y 4 + z 4 = 1. Answer. We have H = (x + y + z) (x4 + y 4 + z 4 1).


74

So H = 1 4x3 = 0 x H = 1 4y 3 = 0 y H = 1 4z 3 = 0 z H = (x4 + y 4 + z 4 1). We note from the rst three equations that = 0. Thus x3 = y 3 = z 3 and so x = y = z. Now from the constraint equation, 3x4 = 1 or x = 1/3 4 . In the same way, y = 1/3 4 and z = 1/3 4 . We can now check f at the 8 possible points (1/3 4 , 1/3 4 , 1/3 4 ). This is silly here, since it is extra work, but it is not wrong due to the fact that all 8 points satisfy the constraint. Note that we actually know x = y = z so there are only two points to really check: 1 31/4 , 1 31/4 , 1 31/4 and 1 31/4 , 1 31/4 , 1 31/4 .
1 1 1 1 1 1

We clearly have the maximum of f at the rst point, and the mimimum at the second point. Observe that actually the point (1/3 4 , 1/3 4 , 1/3 4 ) does not satisfy the rst two equations, but keeping itand the other extra pointsonly leads to extra work, not to the wrong answer since (1) all the points found satisfy the constraint and (2) only the absolute max./min. are sought. The constraint equation is more important than the others.
1 1 1

75

Further Exercises: Find the local maximum, minimum and saddle points of the given function. Identify each point you nd. 1) f (x, y) = 2x x2 + 4y y 2 2) f (x, y) = x2 y 2 3) f (x, y) = ey sin x 4) f (x, y) = x2 x+y + y2 + 1

5) f (x, y) = xy x y + 1 Use Lagrange Multipliers to nd the absolute maximum and minimum values of the given functions f subject to the given constraints. 6) f = x2 4y 2 + 6z 2 7) f = x on on x2 + y 2 + z 2 = 1

x2 + 4y 2 + 9z 2 = 100 on x2 + 4y 2 + 9z 2 = 100 and x=z

8) f = x + y 9) f = xy on

x2 + 4y 2 + 9z 2 = 1

10) Use Lagrange Multipliers to nd the box of maximum values V if the product of the length of the sides must be 120. 11) Use Lagrange Multipliers to nd the volume of the largest box that can be placed inside the sphere x2 + y 2 + z 2 = 4. 12) Find the absolute maximum and minimum of the function f (x, y) = x2 + y 2 on the region composed of the ellipsoidal disc x2 + 4y 2 1.
76