The key principle of optimization is this:

A quantityIf you writeucan only take a maximum (or minimum) value when its differential duis zero or undefined.

So one way that *u* might conceivably take an extreme value
is if either (or both) of its partial derivatives are undefined.
Another way is if both (not just one) of its partial derivatives are zero.
If you can vary *x* and *y* smoothly however you please
(essentially, if you are in the interior of the domain of *f*
and you are free to access the entire domain),
then these are the only possibilities.
However, if you cannot vary them smoothly
(essentially, if you are on the boundary of the domain of *f*
or if the sitaution is otherwise constrained
so that you cannot access the entire domain of *f*),
then there are more possibilities!

If your constraint (essentially, the boundary of *f*)
can be written as an equation *g*(*x* *y*) = 0
(or really, with any constant on the right-hand side),
then as long as ∇*g* is never zero on this boundary,
then you can use the method of *Lagrange multipliers*.
Here, you set up an equation
∇*f*(*x*, *y*) =
λ *g*(*x*, *y*),
combine this with the equation *g*(*x*, *y*) = 0,
and try to solve for *x*, *y*, and λ.
(Since a vector equation is equivalent to 2 sclar equations,
this amounts to a system of 3 equations in 3 variables,
so there is hope to solve for it.)
If you're working in 3 variables,
then you might need two equations to specify the constraint,
in which case
there are two functions in the place of *g* and two Lagrange multipliers,
making 4 equations in 4 variables.
(But you can also have just one *g* even in 3 dimensions;
it's a question of whether the boundary in question is a surface or a curve.)
While λ ultimately doesn't matter,
the solutions that you get for the original variables
give you additional critical points to check for extreme values.

On the other hand, you don't need Lagrange multipliers.
Writing *v* for *g*(*x*, *y*),
if the constraint is *v* = 0 (or *v* equals any constant),
then differentiate this to et d*v* = 0.
(In fact, you could take any equation and just differentiate both sides.)
Then if you try to solve the system of equations
consisting of d*u* = 0 and d*v* = 0
for the differentials d*x* and d*y*,
you should immediately see that d*x* = 0 and d*y* = 0
is a solution.
However, if you actually go through the steps
of solving this as a system of linear equations
(which you can always do because differentials are always linear
in the differentials of the indepednent variables),
you'll find that at some point you need to divide by some quantity
involving *x* and *y*,
which is invalid if that quantity is zero!
So, setting whatever you divide by to zero
and combining that with the constraint equation *v* = 0,
you get two equations to solve for the two variables *x* and *y*.
This will give you the other critical points to check for extreme values.

Be careful, because *u* might not have a maximum or minimum value!
Assuming that *u* varies continuously
(which it must if Calclulus is to be useful at all),
then it must have a maximum and minimum value
whenever the domain of the function (including any constraints)
is both closed and bounded (which is called *compact*);
this means that if you pass continuously through the possibilities in any way,
then you are always approaching some limiting possibility.
However, if the range of possibilities heads off to infinity in some way,
then you also have to take a limit to see what value *u* is approaching,
which can be very difficult to do in more than one dimension.
Or if there is a boundary that's not included in the domain,
then you have to take a limit approaching that boundary,
although in that case
you can hope that you can check the bondary as if it were included,
the same way as above.
If any such limit is larger than every value that *u* actually reaches
(which includes the possibility that a limit is ∞),
then *u* has no maximum value;
if any such limit is smaller than every value that *u* actually reaches
(which includes the possibility that a limit is −∞),
then *u* has no minimum value.

So in the end, you look at these possibilities:

- when any partial derivative of
*u*is undefined, - when all partial derivative of
*u*are zero, - any boundary possibilities given by a constraint,
- any corners (boundaries of the boundaries) given by two constraints,
- any corners or corners given by three constraints (not possible with only two independent variables),
- etc (in more than 3 dimensions), and
- the limits approaching impossible limiting cases.

Here is a typical problem:
The hypotenuse of a right triangle (maybe it's a ladder leaning against a wall)
is fixed at 20 feet,
but the other two sides of the triangle could be anything.
Still, since it's a right triangle,
we know that *x*^{2} + *y*^{2} =
20^{2},
where *x* and *y* are the lengths of legs of the triangle.
(If we think of *x* and *y* as independent variables,
then this equation is our constraint.)
Differentiating this,
2*x* d*x* + 2*y* d*y* = 0.
Now suppose that we want to maximize or minimize the area of this triangle.
Since it's a right triangle,
the area is *A* = ½*x**y*,
so d*A* =
½*y* d*x* + ½*x* d*y*.
If this is zero,
then
½*y* d*x* +
½*x* d*y* =
0,
to go along with the other equation
2*x* d*x* + 2*y* d*y* = 0.

The equations at this point are linear in the differentials
(and they always must be),
so think of this is a system of linear equations
in the variables d*x* and d*y*.
There are various methods for solving systems of linear equations;
I'll use the method of addition aka elimination,
but any other method should work just as well.
So ½*y* d*x* +
½*x* d*y* =
0
becomes
2*x**y* d*x* +
2*x*^{2} d*y* =
0
(multiplying both sides by 4*x*),
while
2*x* d*x* + 2*y* d*y* = 0
becomes
2*x**y* d*x* +
2*y*^{2} d*y* =
0
(multiplying both sides by *y*).
Subtracting these equations gives
(2*x*^{2} −
2*y*^{2}) d*y* =
0,
so either d*y* = 0
or *x*^{2} = *y*^{2}.
Now, *x* and *y* can change freely as long as they're positive,
but we have limiting cases:
*x* → 0^{+} and *y* → 0^{+}.
Since *x*^{2} + *y*^{2} = 400,
we see that *x*^{2} → 400, so *x* → 20,
as *y* → 0.
Similarly, *y* → 20 as *x* → 0.
In those cases, *A* = ½*x**y* → 0.
On the other hand, if *x*^{2} = *y*^{2},
then *x* = *y*,
so *x*, *y* =
10√2,
since *x*^{2} + *y*^{2} = 400.
In that case, *A* = ½*x**y* = 100.

So the largest area is 100 square feet, and while there is no smallest area, the area can get arbitrarily small with a limit of 0.

Go back to the course homepage.

This web page was written in 2015 and 2016 by Toby Bartels, last edited on 2016 February 1. Toby reserves no legal rights to it.

The permanent URI of this web page
is
`http://tobybartels.name/MATH-2080/2016WN/minmax/`

.