In the previous section we optimized (i.e. found the absolute extrema) a function on a region that
contained its boundary. Finding
potential optimal points in the interior of the region isn’t too bad in
general, all that we needed to do was find the critical points and plug them
into the function. However, as we saw in
the examples finding potential optimal points on the boundary was often a
fairly long and messy process.
In this section we are going to take a look at another way
of optimizing a function subject to given constraint(s). The constraint(s) may be the equation(s) that
describe the boundary of a region although in this section we won’t concentrate
on those types of problems since this method just requires a general constraint
and doesn’t really care where the constraint came from.
So, let’s get things set up.
We want to optimize (find the minimum and maximum) of a function, ,
subject to the constraint . Again, the constraint may be the equation
that describes the boundary of a region or it may not be. The process is actually fairly simple,
although the work can still be a little overwhelming at times.
Method of Lagrange
Notice that the system of equations actually has four
equations, we just wrote the system in a simpler form. To see this let’s take the first equation and
put in the definition of the gradient vector to see what we get.
In order for these two vectors to be equal the individual
components must also be equal. So, we
actually have three equations here.
These three equations along with the constraint, ,
give four equations with four unknowns x,
y, z, and .
Note as well that if we only have functions of two variables
then we won’t have the third component of the gradient and so will only have
three equations in three unknowns x, y, and .
As a final note we also need to be careful with the fact
that in some cases minimums and maximums won’t exist even though the method
will seem to imply that they do. In
every problem we’ll need to go back and make sure that our answers make sense.
Let’s work a couple of examples.
Example 1 Find
the dimensions of the box with largest volume if the total surface area is 64
Before we start the process here note that we also saw a
way to solve this kind of problem in Calculus
I, except in those problems we required a condition that related one of
the sides of the box to the other sides so that we could get down to a volume
and surface area function that only involved two variables. We no longer need this condition for these
Now, let’s get on to solving the problem. We first need to identify the function that
we’re going to optimize as well as the constraint. Let’s set the length of the box to be x, the width of the box to be y and the height of the box to be z.
Let’s also note that because we’re dealing with the dimensions of a
box it is safe to assume that x, y, and z are all positive quantities.
We want to find the largest volume and so the function
that we want to optimize is given by,
Next we know that the surface area of the box must be a
constant 64. So this is the
constraint. The surface area of a box
is simply the sum of the areas of each of the sides so the constraint is
Note that we divided the constraint by 2 to simplify the
equation a little. Also, we get the
function from this.
Here are the four equations that we need to solve.
There are many ways to solve this system. We’ll solve it in the following way. Let’s multiply equation (1)
by x, equation (2)
by y and equation (3)
by z. This gives,
Now notice that we can set equations (5)
equal. Doing this gives,
This gave two possibilities. The first, is not possible since if this was the case
would reduce to
Since we are talking about the dimensions of a box neither
of these are possible so we can discount . This leaves the second possibility.
Since we know that (again since we are talking about the
dimensions of a box) we can cancel the z
from both sides. This gives,
Next, let’s set equations (6)
equal. Doing this gives,
As already discussed we know that won’t work and so this leaves,
We can also say that since we are dealing with the
dimensions of a box so we must have,
Plugging equations (8)
into equation (4)
However, we know that y
must be positive since we are talking about the dimensions of a box. Therefore the only solution that makes
physical sense here is
So, it looks like we’ve got a cube here.
We should be a little careful here. Since we’ve only got one solution we might
be tempted to assume that these are the dimensions that will give the largest
volume. The method of Lagrange
Multipliers will give a set of points that will either maximize or minimize a
given function subject to the constraint, provided there actually are
minimums or maximums.
The function itself, will clearly have neither minimums or maximums
unless we put some restrictions on the variables. The only real restriction that we’ve got is
that all the variables must be positive.
This, of course, instantly means that the function does have a
The function will not have a maximum if all the variables
are allowed to increase without bound.
That however, can’t happen because of the constraint,
Here we’ve got the sum of three positive numbers (because x, y,
and z are positive) and the sum
must equal 32. So, if one of the
variables gets very large, say x,
then because each of the products must be less than 32 both y and z must be very small to make sure the first two terms are less
than 32. So, there is no way for all
the variables to increase without bound and so it should make some sense that
the function, ,
will have a maximum.
This isn’t a rigorous proof that the function will have a
maximum, but it should help to visualize that in fact it should have a
maximum and so we can say that we will get a maximum volume if the dimensions
are : .
Notice that we never actually found values for in the above example. This is fairly standard for these kinds of
problems. The value of isn’t really important to determining if the
point is a maximum or a minimum so often we will not bother with finding a
value for it. On occasion we will need
its value to help solve the system, but even in those cases we won’t use it
past finding the point.
Example 2 Find
the maximum and minimum of subject to the constraint .
This one is going to be a little easier than the previous
one since it only has two variables.
Also, note that it’s clear from the constraint that region of possible
solutions lies on a disk of radius which is a closed and bounded region and
hence by the Extreme Value
Theorem we know that a minimum and
maximum value must exist.
Here is the system that we need to solve.
Notice that, as with the last example, we can’t have since that would not satisfy the first two
equations. So, since we know that we can solve the first two equations
for x and y respectively. This
Plugging these into the constraint gives,
We can solve this for .
Now, that we know we can find the points that will be
potential maximums and/or minimums.
If we get,
and if we get,
To determine if we have maximums or minimums we just need
to plug these into the function. Also
recall from the discussion at the start of this solution that we know these
will be the minimum and maximums because the Extreme Value Theorem tells us
that minimums and maximums will exist for this problem.
Here are the minimum and maximum values of the function.
In the first two examples we’ve excluded either for physical reasons or because it
wouldn’t solve one or more of the equations.
Do not always expect this to happen.
Sometimes we will be able to automatically exclude a value of and sometimes we won’t.
Let’s take a look at another example.
Example 3 Find
the maximum and minimum values of subject to the constraint . Assume that .
First note that our constraint is a sum of three positive
or zero number and it must be 1.
Therefore it is clear that our solution will fall in the range . Therefore the solution must lie in a closed
and bounded region and so by the Extreme Value Theorem we know that a minimum and maximum value
Here is the system of equation that we need to solve.
Let’s start this solution process off by noticing that
since the first three equations all have they are all equal. So, let’s start off by setting equations (10)
So, we’ve got two possibilities here. Let’s start off with by assuming that . In this case we can see from either
that we must then have .
From equation (12) we see that this means
This in turn means that either or .
So, we’ve got two possible cases to deal with there. In each case two of the variables must be
zero. Once we know this we can plug
into the constraint, equation (13),
to find the remaining value.
So, we’ve got two possible solutions and .
Now let’s go back and take a look at the other
possibility, . We also have two possible cases to look at
here as well.
This first case is . In this case we can see from the constraint
that we must have and so we now have a third solution .
The second case is . Let’s set equations (11)
Now, we’ve already assumed that and so the only possibility is that . However, this also means that,
Using this in the constraint gives,
So, the next solution is .
We got four solutions by setting the first two equations
To completely finish this problem out we should probably
set equations (10)
equal as well as setting equations (11)
equal to see what we get. Doing this
Both of these are very similar to the first situation that
we looked at and we’ll leave it up to you to show that in each of these cases
we arrive back at the four solutions that we already found.
So, we have four solutions that we need to check in the
function to see whether we have minimums or maximums.
So, in this case the maximum occurs only once while the
minimum occurs three times.
Note as well that we never really used the assumption that
in this problem. This assumption is here mostly to make sure
that we really do have a maximum and a minimum of the function. Without this assumption it wouldn’t be too difficult
to find points that give both larger and smaller values of the
functions. For example.
With these examples you can clearly see that it’s not too
hard to find points that will give larger and smaller function values. However, all of these examples required
negative values of x, y and/or z to make sure we satisfy the constraint. By eliminating these we will know that
we’ve got minimum and maximum values by the Extreme Value Theorem.
To this point we’ve only looked at constraints that were
equations. We can also have constraints
that are inequalities. The process for
these types of problems is nearly identical to what we’ve been doing in this
section to this point. The main difference
between the two types of problems is that we will also need to find all the
critical points that satisfy the inequality in the constraint and check these
in the function when we check the values we found using Lagrange Multipliers.
Let’s work an example to see how these kinds of problems
Example 4 Find
the maximum and minimum values of on the disk .
Note that the constraint here is the inequality for the
disk. Because this is a closed and
bounded region the Extreme
Value Theorem tells us that a minimum and maximum value must exist.
The first step is to find all the critical points that are
in the disk (i.e. satisfy the
constraint). This is easy enough to do
for this problem. Here are the two
first order partial derivatives.
So, the only critical point is and it does satisfy the inequality.
At this point we proceed with Lagrange Multipliers and we
treat the constraint as an equality instead of the inequality. We only need to deal with the inequality
when finding the critical points.
So, here is the system of equations that we need to solve.
From the first equation we get,
If we have then the constraint gives us .
If we have the second equation gives us,
The constraint then tells us that .
If we’d performed a similar analysis on the second
equation we would arrive at the same points.
So, Lagrange Multipliers gives us four points to check : ,
To find the maximum and minimum we need to simply plug
these four points along with the critical point in the function.
In this case, the minimum was interior to the disk and the
maximum was on the boundary of the disk.
The final topic that we need to discuss in this section is
what to do if we have more than one constraint.
We will look only at two constraints, but we can naturally extend the
work here to more than two constraints.
We want to optimize subject to the constraints and . The system that we need to solve in this case
So, in this case we get two Lagrange Multipliers. Also, note that the first equation really is
three equations as we saw in the previous examples. Let’s see an example of this kind of
Example 5 Find
the maximum and minimum of subject to the constraints and .
Verifying that we will have a minimum and maximum value
here is a little trickier. Clearly,
because of the second constraint we’ve got to have . With this in mind there must also be a set
of limits on z in order to make
sure that the first constraint is met.
If one really wanted to determine that range you could find the
minimum and maximum values of subject to and you could then use this to determine the
minimum and maximum values of z. We won’t do that here. The point is only to acknowledge that once
again the possible solutions must lie in a closed and bounded region and so
minimum and maximum values must exist by the Extreme Value Theorem.
Here is the system of equations that we need to solve.
First, let’s notice that from equation (16)
we get .
Plugging this into equation (14)
and equation (15)
and solving for x and y respectively gives,
Now, plug these into equation (18).
So, we have two cases to look at here. First, let’s see what we get when . In this case we know that,
Plugging these into equation (17)
So, we’ve got one solution.
Let’s now see what we get if we take . Here we have,
Plugging these into equation (17)
and there’s a second solution.
Now all that we need to is check the two solutions in the
function to see which is the maximum and which is the minimum.
So, we have a maximum at and a minimum at .