Let

be function of one variable and suppose that

.
According to the second-derivative test,

has
a local minimum at

if

a local maximum at

if

We have a similar test for functions of two variables. As one might expect, the test is somewhat more complicated to state and definitely more difficult to prove.
THEOREM THE SECOND-PARTIALS TEST
Suppose that

has continuous second-order partials in a neighborhood of

and that

.
Set

and form the discriminant

.
1. If

,
then

is a saddle point.
2. If

,
then

has
a local minimum at

if

a local maximum at

if

The test is geometrically evident for functions of the form

The graph of such a function is a paraboloid:

The gradient is

at the origin

.
Moreover

and

If

,
then

and

have opposite signs and the surface has a saddle point.
Suppose now that

If

,
then

and the surface has a minimum point; if

then

and the surface has a maximum point.
In the examples that follow we apply the second-partials test to a variety of functions.
Example 1. For the function

we have

Setting both partials equal to zero, we have

The only simultaneous solution to these equations is

.
The point

is thus the only stationary point.
The second partials are constant:

Thus

and

Since

it follows from the second-partials test that

is a local minimum.
Example 2. The function

has partial derivatives

Setting both of these partials equal to zero, we have

The only simultaneous solution to these equations is

The point

is thus the only stationary point.
The second partials are

Evaluating these partials at the point

,
we find that

,

and thus

By the second-partials test,

is a saddle point.
We could have determined that

is a saddle point by comparing the value of

at

with its value at nearby points



For small

,
this expression is positive if

and negative if

Example 3. The function

has partial derivatives

Setting both partials equal to zero, we have

The only simultaneous solutions are

and

.
The points

and

are the only stationary points.
The second partials are

At

,
we have

,
and thus

Since

,
we know that

is a local minimum. At

,
we have

.
Thus

The origin is a saddle point.
Example 4. Here we test the function

on the open square

In the first place

Setting both of these partials equal to zero, we have

Together these equations imply that

.
Since both

and

lie between

and

,
we can conclude that

.
The condition

now gives

Into this last equation we substitute the identity

and thereby obtain the relation

This is a quadratic in

with solutions

We throw out the solution

because

has to lie strictly between

and

.
The other possibility,

,
gives

.
Since

,
we also have

.
This shows that

is the only stationary point.
The second partials are


At

we have

and thus

Since

,
we can conclude that

is a local maximum.
The second-derivative test applies to points

where

but

If

,
the second-derivative test provides no information. The second-partials test
suffers from a similar limitation. It applies to points

where

but

If

the second-partials test provides no information. Consider, for example, the
functions

Each of these functions has zero gradient at the origin, and in each case

Yet,
(1) for

,

gives a local minimum;
(2) for

,

gives a local maximum;
(3) for

,

is a saddle point.
Statements (1) and (2) are obvious. To confirm (3), note that

,
but in every neighborhood of

the function

takes on both positive and negative values:

for

while

for

.
When we ask for the distance from a point

to a line

we are asking for the minimum value of

with

subject to the side condition

When we ask for the distance from a point

to a plane

we are asking for the minimum value of

with

subject to the side condition

Our interest here is to present techniques for handling problems of this sort
in general. In the two-variable case, the problems will take the form of
maximizing (or minimizing) some expression

subject to a side condition

.
In the three-variable case, we will seek to maximize (or minimize) some
expression

subject to a side condition

.
We begin with two simple problems-
Problem 1. Maximize the product

subject to the side condition

Solution. The condition

gives

.
Our initial problem can therefore be solved simply by maximizing the product

.
The derivative

is

only at

.
Since

,
we know from the second-derivative test that

is the desired maximum.
Problem 2. Find the maximum volume of a rectangular solid
given that the sum of the lengths of its edges is

Solution. We denote the dimensions of the solid by

The volume is given by

The stipulation on the edges requires that

Solving this last equation for

,
we find that

Substituting this expression for

in the volume formula, we have

Since

and

must all remain positive, our problem is to find the maximum value of

on the interior of the triangle bounded by the lines

and

The first partials are


Setting both partials equal to zero, we have

Since

and

are assumed positive, we can divide by

and

and get

and

.
Solving these equations simultaneously, we find that

The point

,
which does lie within the triangle, is the only stationary point. The value of

at that point is

.
The conditions of the problem make it clear that this is a maximum.
The last two problems were easy. They were easy in part because the side conditions were such that we could solve for one of the variables in terms of the other(s). In general this is not possible and a more sophisticated approach is required.
Throughout the discussion

will be a function of two or three variables continuously differentiable on
some open set

.
We take

as a curve that lies entirely in

and has at each point a nonzero tangent vector

.
The basic result is this:
if

maximizes (or minimizes)

on

,
then

is perpendicular to

at

Proof. Choose

so that

The composition

has a maximum (or minimum) at

.
Consequently, its derivative

must be zero at

:

This shows that

Since

is tangent to

at

,

is perpendicular to

at

We are now ready for the side condition problems. Suppose that

is a continuously differentiable function of two or three variables defined on
a subset of the domain of

.
Lagrange made the following observation:
if

maximizes (or minimizes)

subject to the side condition

,
then

and

are parallel. Thus, if

,
then there exists a scalar

,
such that

Such a scalar

has come to be called a Lagrange multiplier.
Proof. Let us suppose that

maximizes (or minimizes)

subject to the side condition

.
If

, the result is trivially true: every vector is parallel to the zero vector.
In the two-variable case we suppose the side condition

and

The side condition defines a curve

that has a nonzero tangent vector at

Since

maximizes (or minimizes)

on

,
we know that

is perpendicular to

at

Since

is also perpendicular to

at

, the two gradients are therefore parallel.
In the three-variable case we have the side condition

and

The side condition defines a surface

that lies in the domain of

.
Now let

be a curve that lies on

and passes through

with nonzero tangent vector. We know that

maximizes (or minimizes)

on

.
Consequently,

is perpendicular to

at

. Since this is true for each such curve

,

must be perpendicular to

itself. But

is also perpendicular to

at

. It follows that

and

are parallel.
We come now to some problems that are susceptible to Lagrange's method. In
each case

is not

where

is

and therefore we can focus entirely on those points

that satisfy a Lagrange condition

Problem 3. Maximize and minimize

on the unit circle

Solution. Since

is continuous and the unit circle is closed and bounded, it is clear that both
a maximum and a minimum exist. To apply Lagrange's method we set

We want to maximize and minimize

subject to the side condition

.
The gradients are

Setting

we obtain

Multiplying the first equation by

and the second equation by

,
we find that

and thus

The side condition

now implies that

and therefore that

. The only points that can give rise to an extreme value are

At the first and fourth points

takes on the value

At the second and third points

takes on the value

Clearly then

is the maximum value and

the minimum value.
Problem 4. Find the minimum value taken on by the function

on the hyperbola

.
Solution. This minimum is simply the square of the distance from the
point

to the hyperbola and thus clearly exists. Now set

We want to minimize

subject to the side condition

Here

The Lagrange condition

gives

which we can simplify to

The side condition

shows that

cannot be zero. Dividing

by

,
we get

.
This means that

and therefore

.
With

,
the side condition gives

The points to be checked are therefore

and

.
At each of these points

takes on the value

.
This is the desired minimum.
Remark. The last problem could have been solved more simply by rewriting the
side condition as

and eliminating

from

by substitution. It would then have been only a matter of minimizing

Problem 5. Maximize

subject to the side condition

with

Solution. The set of all points

that satisfy the side condition can be shown to be closed and bounded. Since

is continuous, we can be sure that the desired maximum exists. We begin by
setting

so that the side condition becomes

.
We seek those triples

that simultaneously satisfy a Lagrange condition

and the side condition

.
The gradients are

The Lagrange condition

gives

Multiplying the first equation by

,
the second by

,
and the third by

,
we get

and consequently

We can
exclude
because, if

,
then

,
or

would have to be zero. That would force

to be

,
and

is obviously not a maximum. Having excluded

,
we can divide by

and get

and thus

.
The side condition

now gives

The desired maximum is

.
Problem 6. Show that, of all the triangles inscribed in a fixed circle, the equilateral triangle has the largest perimeter.
Solution. It is intuitively clear that this maximum exists and
geometrically clear that the triangle that offers this maximum contains the
center of the circle in its interior or on its boundary. We denote by

the central angles that subtend the three sides. It can verified by
trigonometry that the perimeter of the triangle is given by the function

As a side condition we have

To maximize the perimeter we form the gradients

The Lagrange condition

gives

and therefore

With

all in

,
we can conclude that

Since the central angles are equal, the sides are equal. The triangle is
therefore equilateral.
The Lagrange equation can be replaced by a cross-product equation: points that
satisfy

satisfy

In two variables this reduces to

Problem 7. Maximize and minimize

on the unit circle

Solution. This problem was solved earlier by means of the Lagrange
equation. This time we will use the cross-product equation instead. As before
we set

so that the side condition takes the form

.
Since

we have

This gives

As before, the side condition

now implies that

and therefore that

.
The points under consideration are

At the first and fourth points

takes on the value

At the second and third points

takes on the value

.
The first is a maximum and the second a minimum.
Find the extreme value of

subject to the condition

(Maximum value is

no minimum)
Find the maximum and minimum distances from the origin to the curve

(Maximum is

,
minimum is

)
Assume

and

are fixed positive numbers.
Find the extreme values of

subject to the condition

(Maximum is

at

minimum is

at

Find the extreme values of

subject to the condition

(Minimum is at

at

no maximum)
Find the extreme values of

subject to the side condition

(Maximum is

at the points

where

is any integer; minimum is

at the points

where

is any integer)
Find the extreme values of the scalar field

on the sphere

(Maximum is

at
(
minimum
is

at
(-
Find the points of the surface

nearest to the origin.
(
and

)
Find the shortest distance from the point

to the parabola

(
)