Lagrange Multipliers - Tidewater Community College

advertisement
Lagrange Multipliers
By
Dr. Julia Arnold
Professor of Mathematics
Tidewater Community College, Norfolk Campus,
Norfolk, VA
With Assistance from a CPDP Grant
In this lesson you will
•Understand the method of Lagrange Multipliers
•Use Lagrange Multipliers to solve constrained
optimization problems
•Use the method of Lagrange multipliers with two
constraints
Objective 1
Understand the method of
Lagrange Multipliers
Fig.13.77
Objective function : f ( x , y )  4 xy
C onstraint : g ( x , y ) 
x
2
3
2

y
2
4
2
1
Recall
Fig. 13.48
Objective 2
Use Lagrange Multipliers to solve
constrained optimization problems
Basically, Lagrange Multipliers are another way to think about
solving optimization problems with constraints. Lets look at a
problem we can solve either way.
Problem: Suppose I have 50 feet of fencing for a
rectangular shaped garden and want to enclose
the maximum area.
The usual way we would solve this problem is to look at a
picture and put in variables.
Next we write the constraint
equation 2x + 2y = 50
Last we determine we want to
maximize the Area of the
Garden whose formula is
y
A = xy
x
Problem: Suppose I have 50 feet of fencing for a
rectangular shaped garden and want to enclose
the maximum area.
2x + 2y = 50 Constraint
A = xy Objective
y
x
We want to get the Area in terms of just x or
y so we use the constraint to eliminate one or
the other.
2y=50-2x
Y = 25-x
A = x (25-x)=25x – x2
A’ = 25 – 2x
0= 25 – 2x
X = 12.5 and y = 12.5
Now we will use the method of Lagrange Multipliers to
Solve the same problem.
2x + 2y = 50 Constraint
A = xy Objective
f(x,y)=xy is the objective equation and g(x,y)=2x +2y is the constraint
equation.
f x ( x, y )  y; f y ( x, y )  x
Find
g x ( x , y )  2; g y ( x , y )  2
 S et f x   g x  y  2 

 S et f y   g y  x  2 

2 x  2 y  50

S o lve sim u lta n e o u sly
4  4  50
8  50
  6 .2 5
x  1 2 .5
y  1 2 .5
Now let’s look at a problem that might be difficult to
solve the old way.
Problem 2: Find the maximum and minimum values for
f ( x , y )  x  y objective equation
2
2
g ( x, y )  x  y
4
4
w ith the con strain t x  y  1
4
4
F ind f x  2 x ; f y  2 y
gx  4x ; gy  4 y
3
3
 2 x   4 x3

3
2 y   4 y
 x4  y4  1

3
2
2 x   4 x  2 x (1   2 x )  x  0 or   1
2x
3
2
2 y   4 y  2 y (1   2 y )  y  0 or   1
Solve : 1
2x
2
 1
 x  y
2
2y
2
2
x  y  1  x  x  1  2x  1
4
4
1
x
4
2
4
4
4
2
2y
2
If x  0 then y  1  y   1
4
IIf y  0 then x  1  x   1
4
1
and y 
4
2

1
1 
W e could have the follow ing p o in ts  
,
 w hich yield a m ax value o f
4
4
2
2


and (0,  1), (  1, 0) w hich yields a m in value of 1
2
y
Z=
2
The constraint is
the red graph.

Z=1
The blue graph
and green graph
are level curves of
the paraboloid.
x


The blue graph is
at 1 and the green
graph is at 2
which is the exact
value for the max.

As the paraboloid
extends in the z
direction it gets
wider than the
constraint.
Objective 3
Use the method of Lagrange
multipliers with two constraints
Suppose we want to find the max and min values of f(x,y,z)
subject to two constraints of the form g(x,y,z)=p and
h(x,y,z)= q. Geometrically, this means that we are looking for
the extreme values of f when (x,y,z) is restricted to lie on
the curve of intersection of the level surfaces g and h. It can
be shown that if an extreme value occurs at  x o , y o , z o  ,
then the gradient vector  f ( x o , y o , z o ) is in the plane
determined by  g ( x o , y o , z o ) and  h ( x o , y o , z o ) .
We assume these gradient vectors are not 0 or parallel and
thus there are numbers  and  (Lagrange multipliers)
such that
 f ( xo , yo , zo )    g ( xo , yo , zo )   h ( xo , yo , zo )
Problem: Maximize f(x,y,z) = xyz subject to the two
constraints 2
2
x  z  5 and x  2 y  0
f ( x , y , z )  xyz
g ( x, y, z )  x  z
2
h( x, y, z )  x  2 y
f x  yz
2
gx  2x
g y  0 gz  2z
hx  1 h y   2 hz  0
x  z  5 and x  2 y  0
2
f y  xz f z  xy
2
S o lve
yz   2 x  


xz   0   2


xy   2 z   0

 x 2  z 2  5 and x  2 y  0

Solve
yz   2 x  


xz   0   2


xy   2 z   0

2
2
 x  z  5 and x  2 y  0

xz   2    
 xz
Solved eq 2 for mu
2
xy   2 z   
xy
2z
yz 
xy
2z
2x 
 xz
2
Solved eq 3 for lambda
Substituted into eq 1 for mu
and lambda.
Continued
 xz
xz   2    
y 
2
yz 
2
xy
z 5 x
2z
x  0, o r x 
xy   2 z   
xy
2
2x 
2
2
from x  2 y  0
Sub z  5  x
2
z 5
2
from x  z  5
2
2
5  x   2x

2

2
2
x
2
2

 x 5 x
2
  x x  x 5  x 
2 x 5  x   x
x 5 x
2
2
2
2
, y 
10 x  2 x  x  0
3
10 x  3 x  0
3
2
10
3
10
2
3
,
5
,z  
3
3
p o in ts
(0 , 0 , 5 ),





f 


x (10  3 x )  0
2
5

1
10 1
,
3 2
10
5 

3 
,
3
10
5 

3 
,
3
f (0 , 0 , 5 ) = 0
3
x  0, or x 

10

10
1
,


3
2

3
3
10
3
3
x
x
10
fo r x 
2
2
 x
fo r x  0, y  0, z   5
2 yz  2 x y  xz
Sub y 
10
3
2
2
2
2
 xz
2z
x
 x
10
3
10 1
,
3 2
10

10
1
f 
,

3
2

5  5 15

3 
9
,
3
10
3
,
5  5 15

3 
9
I found this very interesting website written by
a student who is sharing his talents with
everyone. The topic is Lagrange Multipliers.
Check it out.
http://www.youtube.com/watch?v=ry9cgNx1QV8
His method is slightly different from the way your
text presented it. Are they equivalent?
For comments on this presentation you may email the author Dr.
Julia Arnold at jarnold@tcc.edu.
Download