z = f ( x,y )

14
Consider minimizing and/or maximizing a function z = f(x,y) subject to a constraint g(x,y) = c. y z x z = f(x,y) Parametrize the curve defined by g(x,y) = c as c(t) = (x(t),y(t)) g(c(t)) = c . For example, consider minimizing and maximizing the function z = x 2 – y 2 subject to the constraint x 2 + y 2 = 1. Parametrize x 2 + y 2 = 1 as c(t) = (cos t , sin t) cos 2 t + sin 2 t = 1. d g(c(t)) = dt d c dt g(c(t)) • c (t) = 0 d (cos 2 t + sin 2 t) = dt d — 1 dt

description

Consider minimizing and/or maximizing a function z = f ( x,y ) subject to a constraint g ( x,y ) = c. For example, consider minimizing and maximizing the function z = x 2 – y 2 subject to the constraint x 2 + y 2 = 1. z. z = f ( x,y ). x. - PowerPoint PPT Presentation

Transcript of z = f ( x,y )

Page 1: z = f ( x,y )

Consider minimizing and/or maximizing a function z = f(x,y) subject to a constraint g(x,y) = c.

y

z

x

z = f(x,y)

Parametrize the curve defined by g(x,y) = c as c(t) = (x(t),y(t)) g(c(t)) = c .

For example, consider minimizing and maximizing the function z = x2 – y2 subject to the constraint x2 + y2 = 1.

Parametrize x2 + y2 = 1 as c(t) = (cos t , sin t) cos2t + sin2t = 1.

d—g(c(t)) =dt

d— cdt

g(c(t)) • c (t) = 0

d—(cos2t + sin2t) =dt

d— 1dt

Page 2: z = f ( x,y )

Parametrize the curve defined by g(x,y) = c as c(t) = (x(t),y(t)) g(c(t)).= c .

Parametrize x2 + y2 = 1 as c(t) = (cos t , sin t) cos2t + sin2t = 1.

d—g(c(t)) =dt

d— cdt

g(c(t)) • c (t) = 0

d—(cos2t + sin2t) =dt

d— 1dt

2x 2y = 0– sin t

cos t

Maximizing/Minimizing f(x,y) subject to g(x,y) = c is the same as maximizing/minimizing f(c(t)). Consequently,

Maximizing/Minimizing f(x,y) = x2 – y2 subject to x2 + y2 = 1 is the same as maximizing/minimizing cos2t – sin2t .

d—f(c(t)) = 0dt

d—(cos2t – sin2t) = 0dt

f (c(t)) • c (t) = 0

Observe that both f (c(t)) and g(c(t)) must be orthogonal to c (t).

Page 3: z = f ( x,y )

y

x

If both f (c(t)) and g(c(t)) must be orthogonal to c (t), then f (c(t)) and g(c(t)) must be

c (t0) multiples of each other, that is, for any point c(t0) = (x0 , y0) at which f and g are both orthogonal to c (t), we must have f(x0 , y0) = g(x0 , y0), assuming neither gradient is the zero vector.

This motivates the Method of Lagrange Multipliers (stated in its most general form in Theorem 8 on page 226). To maximize/minimize f(x,y) subject to g(x,y) = c,

(1)

(2)

(3)

Set up the system of equations f(x,y) = g(x,y) and g(x,y) = c.Let = 0 to find critical points of the function f(x,y), but eliminate these points from consideration if they do not satisfy g(x,y) = c.Assume 0, solve for (x,y), and substitute each candidate for an extremum into f to find the desired maximum/minimum values for f.

Page 4: z = f ( x,y )

Find the extreme values of z = x2 – y2 along the circle of radius 1 centered at the origin in the xy plane.

With f(x,y) = x2 – y2 and g(x,y) = x2 + y2 , we have

f(x,y) = g(x,y) =

Setting f(x,y) = g(x,y) and including the constraint equation, we have

[ 2x – 2y ] [ 2x 2y ]

2x = 2x

– 2y = 2y

x2 + y2 = 1

= 0 implies x = y = 0, which is not possible, since the third equation is not satisfied.

Candidates for extrema are (0,1), (0,–1), (1,0), (–1,0).

f(0,1) = f(0,–1) = –1 is the minimum value of the function on the circle.

f(1,0) = f(–1,0) = 1 is the maximum value of the function on the circle.

0 implies either x or y must be zero, since we cannot have both = 1 and = –1.

If x = 0, then from the third equation y = 1 or y = –1.If y = 0, then from the third equation x = 1 or x = –1.

Page 5: z = f ( x,y )

Find the extreme values of f(x,y) = x2 + y2 along the line y = x + 1, that is, the line y – x = 1.

With f(x,y) = x2 + y2 and g(x,y) = y – x , we have

f(x,y) = g(x,y) =

Setting f(x,y) = g(x,y) and including the constraint equation, we have

[ 2x 2y ] [ –1 1 ]

2x = –

2y =

y – x = 1

= 0 implies x = y = 0, which is not possible, since the third equation is not satisfied.

The only candidate for an extremum is (–1/2 , 1/2).

Since f(x,y) goes to infinity as either x or y goes to negative or positive infinity, then there can be no global maximum; therefore, the single candidate for an extremum f(–1/2 , 1/2) = 1/2 is the minimum value of the function on the line.

0 implies x = –y. From the third equation, x = –1/2 and y = 1/2.

Page 6: z = f ( x,y )

Note how we could have solved this problem using substitution. Since f(x,y) = x2 + y2 and y = x + 1, then we may write

Setting h (x) = 4x + 2 = 0, we find that x = –1/2 is a critical point. We then find that this critical point is a local minimum, since, h (x) = 4 > 0.

To use Lagrange multipliers to find the absolute maximum and minimum for a function f(x,y) over a region:

(1)

(2)

Find the extreme values of f(x,y) = x2 + y2 along the line y = x + 1, that is y – x = 1.

f(x,y) = x2 + y2 = x2 + (x + 1)2 = 2x2 + 2x + 1 = h(x).

Use Lagrange multipliers to find candidates for extrema on the boundary of the region.

Add to the candidates for extrema all critical points of the function that lie in the region, and substitute each candidate into f .

Page 7: z = f ( x,y )

Find the absolute maximum and minimum of f(x,y) = xy on the unit disc, i.e., where x2 + y2 1.

With f(x,y) = xy and g(x,y) = x2 + y2, we have

f(x,y) = g(x,y) =[ y x ] [ 2x 2y ]

(0,0).First, we find all critical points of f(x,y) located in the unit disk, by solving fx = fy = 0. The only critical point is

Next, we locate the candidates for extrema on the boundary of the unit disk, that is, on the unit circle of radius 1.

Setting f(x,y) = g(x,y) and including the constraint equation, we have y = 2x

x = 2y

x2 + y2 = 1

= 0 implies x = y = 0, which again gives us the critical point (0,0).

0 implies x and y must either both be zero or both be non-zero with x2 = y2. From the third equation, x = 1/2 or x = –1/2.

Candidates for extrema are

Page 8: z = f ( x,y )

Candidates for extrema are(0,0) (1/2 , 1/2) (–1/2 , 1/2) (1/2 , –1/2) (–1/2 , –1/2) .

f(0,0) =

f(1/2 , 1/2) =

f(–1/2 , 1/2) =

f(1/2 , –1/2) =

f(–1/2 , –1/2) =

0

1/2

–1/2

–1/2

1/2

The absolute maximum of f is 1/2 and occurs at

(1/2 , 1/2) and (–1/2 , –1/2) .

The absolute minimum of f is –1/2 and occurs at

(–1/2 , 1/2) and (1/2 , –1/2)

Note: from the second derivative test, we find that (0,0) is a saddle point.

Page 9: z = f ( x,y )

Find the absolute maximum and minimum of

f(x,y) = (x2 + y2)/2 on the elliptical region defined by x2/2 + y2 1.

With f(x,y) = (x2 + y2)/2 and g(x,y) = x2/2 + y2, we have

f(x,y) = g(x,y) =[ x y ] [ x 2y ]

(0,0).First, we find all critical points of f(x,y) located in the elliptical region, by solving fx = fy = 0. The only critical point is

Next, we locate the candidates for extrema on the boundary of the elliptical region.

Setting f(x,y) = g(x,y) and including the constraint equation, we have x = x

y = 2y

x2/2 + y2 = 1

= 0 implies x = y = 0, which again gives us the critical point (0,0).

0 implies x and y cannot both be non-zero, since we cannot have both = 1 and = 1/2.

Page 10: z = f ( x,y )

x = x

y = 2y

x2/2 + y2 = 1

If x = 0, then from the third equation, y = 1 or y = –1;

if y = 0, then from the third equation, x = 2 or x = –2.

Candidates for extrema are

(0,0) (0, 1) (0, –1) (2 , 0) (–2 , 0) .

f(0,0) = f(0, 1) = f(0, –1) =

f(2 , 0) = f(–2 , 0) =

0 1/2 1/2

1 1

The absolute maximum of f is 1 and occurs at (2 , 0) and (–2 , 0) .

The absolute minimum of f is 0 and occurs at (0,0) .

Using Lagrange multipliers to find the absolute maximum and minimum for a function of more than two variables over a region is a natural generalization of the method with a function of two variables.

Page 11: z = f ( x,y )

Find the absolute maximum and minimum of

f(x,y,z) = xy + z2 subject to the constraint that x2 + y2 + z2 = 1.

With f(x,y,z) = xy + z2 and g(x,y,z) = x2 + y2 + z2 , we have

f(x,y,z) = g(x,y,z) =

Setting f(x,y,z) = g(x,y,z) and including the constraint equation, we have

[ y x 2z ] [2x 2y 2z ]

y = 2x

x = 2y

2z = 2z

x2 + y2 + z2 = 1

= 0 x = y = z = 0, which is not possible, since the fourth equation is not satisfied.

Candidates for extrema are (1/2 , 1/2 , 0) , (–1/2 , 1/2 , 0) , (1/2 , –1/2 , 0) , (–1/2 , –1/2 , 0)

f (–1/2 , 1/2 , 0) = f(1/2 , –1/2 , 0) = –1/2 is the absolute minimum,

0 either that x = y = 0 and z = –1 or 1, or that x2 = y2 = 1/2 and z = 0.

(0 , 0 , 1) , (0 , 0 , –1) ,

and f(0 , 0, 1) = f(0 , 0 , –1) = 1 is the absolute maximum.

Page 12: z = f ( x,y )

Find the absolute maximum and minimum of

f(x,y,z) = xy + yz subject to the constraint that x2 + y2 + z2 = 1.

With f(x,y,z) = xy + yz and g(x,y,z) = x2 + y2 + z2 , we have

f(x,y,z) = g(x,y,z) =

Setting f(x,y,z) = g(x,y,z) and including the constraint equation, we have

[ y x + z y ] [2x 2y 2z ]

y = 2x

x + z = 2y

y = 2z

x2 + y2 + z2 = 1

= 0 y = 0 and x = – z , which gives us x = 1/2 & z = –1/2 or x = –1/2 & z = 1/2 .

0 x = z 0 and y2 = 2x2 , which gives us that x = z = 1/2 and y = 1/2 or –1/2, or

Candidates for extrema are (1/2 , 0 , –1/2) , (–1/2 , 0 , 1/2) ,

f (1/2 , –1/2 , 1/2) = f(–1/2 , 1/2 , –1/2) = –1/2 is the absolute minimum, and

(1/2 , 1/2 , 1/2) , (1/2 , –1/2 , 1/2) , (–1/2 , 1/2 , –1/2) , (–1/2 , –1/2 , –1/2) .

f(1/2 , 1/2 , 1/2) = f(–1/2 , –1/2 , –1/2) = 1/2 is the absolute maximum.

that x = z = –1/2 and y = 1/2 or –1/2 .

Page 13: z = f ( x,y )

Let x, y, and z be the dimensions of a rectangular box. Maximize the volume V = subject to the constraint that the surface area of the box is S =

With f(x,y,z) = and g(x,y,z) = , we have

f(x,y,z) = g(x,y,z) =

Setting f(x,y,z) = g(x,y,z) and including the constraint equation, we have

[ yz xz xy ] [2y +2z 2x +2z 2x +2y ]

yz = 2(y+z)

xz = 2(x+z)

xy = 2(x+y)

2xy + 2xz + 2yz = S

= 0 implies xy = xz = yz = 0, which is not possible, since the fourth equation is not satisfied (and the box must have positive dimensions).

yz xzFrom the first two equations, —— = —— , from which it follows x = y.

y+z x+z

0 implies none of x, y, or z can be 0.

xz xyFrom the last two equations, —— = —— , from which it follows y = z.

x+z x+y

xyz2xy + 2xz + 2yz.

xyz 2xy + 2xz + 2yz

Page 14: z = f ( x,y )

Then, from the constraint equation, we find that the only candidate for extrema where each of x, y, and z is nonnegative is

(S/6 , S/6, S/6) .

We know this must be an absolute maximum by checking that volume can only become smaller as any one of the dimensions goes to zero. The maximum volume is

yz = 2(y+z)

xz = 2(x+z)

xy = 2(x+y)

2xy + 2xz + 2yz = S

= 0 implies of x, y, and z is 0, which is not possible, since the fourth equation is not satisfied (i.e., the box must have positive dimensions).

yz xzFrom the first two equations, —— = —— , from which it follows x = y.

y+z x+z

0 implies none of x, y, or z can be 0.

xz xyFrom the last two equations, —— = —— , from which it follows y = z.

x+z x+y

(S/6)3/2.