Question 2: How do you model an optimization problem with several variables subject
to a constraint?
Many of these objective functions may be written as multivariable functions with the
variables constrained. In this section, you’ll learn how to apply Lagrange multipliers to
solve these types of optimization problems.
1
Question 1: How do you find the relative extrema of a surface when the values of the
variables are constrained?
In Section 12.3, you learned how to find the relative maximum or relative minimum on a
surface. Now we will find relative maximum and minimum along a specific portion of the
surface defined by a constraint.
subject to x y 4 . This means we want to find points on the surface that are higher
than the other nearby points where the plane x y 4 intersects the surface.
x y 4
z 2 x 2 3x 2 15
Figure 1 - The plane intersects the surface along the path traced
by the black curve.
The relative maximum is found by defining a new function called F in terms of the
surface and the constraint. If there are any relative extrema along the path, they will
occur at critical points of this new function.
2
Lagrange Multiplier Method
Fx x, y, 0, Fy x, y, 0, F x, y, 0
system of equations.
We have a surface f, but not a constraint matching g. To get g, we need to write the
constraint so that zero appears on one side. Subtract 4 from both sides of the constraint
to give
x y 4 0
g x, y
The other side of the constraint is g. Once the constraint is in the proper format, we
apply the steps above to find the relative maximum.
3
Example 1 Maximize the Constrained Function
where g x, y x y 4 .
F x, y, 2 x 2 3 y 2 15 x y 4
f x, y g x, y
2 x 2 3 y 2 15 x y 4
Fx x, y, 4 x
Fy x, y, 6 y
F x, y, x y 4
4 x 0
6 y 0
x y40
The first and second equation are easy to solve for . Solve each for
and them set them equal to eliminate ,
4x 6 y
After solving for one of the variables (in this case x), substitute the
resulting equation into the third equation,
4
6
4 y y40 Replace x with 6
4 y
Combine like terms
10
4 y40
10
4 y4 Add 4 to both sides
y 16
10 1.6 Multiply both sides by 4
10 and simplify.
x 64 1.6 2.4
The critical point is 2.4,1.6 , but we don’t know whether this point is a
x 1 2 2.4 3 4
y 3 2 1.6 1 0
f x, y 2 x 2 3 y 2 15 -14 -5 -4.2 -6 -17
(2.4, 1.6)
5
In practice, the most difficult part of the Lagrange Multiplier Method is solving the
system of equations. A good strategy is to solve Fx x, y, 0 and Fy x, y, 0 for .
Setting these equations equal to each other eliminates from the system. Then we can
use the resulting relationship in F x, y, 0 to find the critical point.
Minimize f x, y x 2 y 2 subject to x 2 y 1 .
x 2 y 1 0
g x, y
F x, y, x 2 y 2 x 2 y 1
f x, y g x, y
Fx x, y, 2 x
Fy x, y, 2 y 2
F x, y, x 2 y 1
Set each partial derivative equal to zero and solve the resulting system
for x and y.
2 x 0 2 x
Solve each equation for and
y 2x
2 y 2 0 y then set equal to each other
6
x 2 2x 1 0 Substitute y 2 x into the third
equation in the system and solve for x
x 4x 1 0
3 x 1 0
3 x 1
x 13
x 2 y 1 -3 -1 1
3 1 3
2
y -1 0 3 1 2
f x, y x 2 y 2 8 1 13 0 5
The x and y values in the table must be picked in the table so that they
2
satisfy the constraint. In this case, values of y are picked near 3 and
then the constraint is used to find the corresponding y value. The lowest
value of the function occurs at the critical point so 13 is the minimum
f x, y x 2 y 2
1
3
, 2
3
7
Question 2: How do you model an optimization problem with several variables subject
to a constraint?
A farmer is fencing a rectangular area for two equally sized pens. These
pens share a divider that will be constructed from chicken wire costing
$0.60 per foot. The rest of the pen will be built from fencing costing
$1.10 per foot.
If the pens should enclose a total of 400 square feet, what overall
dimensions should the pens have to minimize fencing costs?
Solution Identify the variables in the problem. Since the problem asks
us to find the overall dimensions of the pens, define the width of the
enclosure as w and the length as l. These are label on the diagram.
8
w
Since we know the cost per foot for each side, we will use that
information to write down the cost in terms of l and w,
C l , w 2 1.10l 2 1.10 w
0.6l
cost of left cost of top cost of
and right sides and bottom sides divider
This simplifies to
C l , w 2.80l 2.20 w
The pens must enclose 400 square feet. In terms of the variables, the
area is lw so we have the constraint
lw 400
In the proper format for the Lagrange Multiplier Method, this becomes
lw 400 0
9
Fl l , w, 2.8 w
Fw l , w, 2.2 l
F l , w, lw 400
2.8 w 0
2.2 l 0
lw 400 0
2.8
2.8 w 0
w
2.2
2.2 l 0
l
2.8 2.2
w l
You can solve for either variables, but in this case we’ll solve for l to
give
2.2 w
l
2.8
Substitute this expression into the third equation and solve for w:
10
2.2w
w 400 0
2.2 w
Replace l with 2.8
2.8
2.2 w2
400
2
Isolate w
2.8
2.8
w2 400
2.2
2.8
w 400 Square root both sides of the equation
2.2
w 22.56
400
lw 400 l
w
400
l 17.73
22.56
l 400
w 40 20 17.73 10
w 10 20 22.56 40
C l , w 2.80l 2.20 w 134 100 99.28 116
The enclosure that costs the least is approximately 22.56 feet long and
17.73 feet wide and costs $99.28.
11
limits the linear dimensions (defined as the sum of the length, width and
height) to 45 inches.
w
l
V l , w l w2
However, we must make sure the the sum of the length, width and
height is 45. This gives the constraint
12
l 2 w 45
Subtract 45 from each side to put the constraint in the proper format,
l 2 w 45 0
F l , w, lw2 l 2 w 45
Fl l , w, w2
Fw l , w, 2lw 2
F l , w, l 2 w 45
w2 0
2lw 2 0
l 2 w 45 0
w2 0 w2
2lw 2 0 lw
Set these equation equal to each other to find a relationship for the
variables,
13
w2 lw
l 2l 45 0
3l 45 0
3l 45
l 15
15 2 w 45
2 w 30
w 15
l 45 2 w 35 25 15 5
w 5 10 15 20
The largest volume is 3375 cubic inches and occurs when the lenghth,
width and height are all 15 inches.
14
Example 5 Maximize Production
C L 100 0
F C , L, L C 100
gives the critical points of F. Solve the first two equation for to yield
15
1.01 0.25C 0.75 L0.75 0 1.01 0.25C 0.75 L0.75
L 3C
0.25
Multiply each side by L by adding exponents
4C 100
C 25
C 75 50 25 0
L 25 50 75 100
16