2.9: Maximum and Minimum Values
( \newcommand{\kernel}{\mathrm{null}\,}\)
One of the core topics in single variable calculus courses is finding the maxima and minima of functions of one variable. We'll now extend that discussion to functions of more than one variable 1. Rather than leaping into the deep end, we'll not be too ambitious and concentrate on functions of two variables. That being said, many of the techniques work more generally. To start, we have the following natural extensions to some familiar definitions.
Let the function
is a local maximum of if for all close to More precisely, is a local maximum of if there is an such that for all points within a distance of is a local minimum of if for all close to- Local maximum and minimum values are also called extremal values.
is an absolute maximum or global maximum of if for all in is an absolute minimum or global minimum of if for all in
Local Maxima and Minima
One of the first things you did when you were developing the techniques used to find the maximum and minimum values of
- Suppose that the largest value of
is What does that tell us about
After a little thought you answered
- If the largest value of
is and is differentiable at then
Let's recall why that's true. Suppose that the largest value of
Taking the limit
Taking the limit
You also observed at the time that for this argument to work, you only need
- If
is a local maximum for and is differentiable at then
Precisely the same reasoning applies to minima.
- If
is a local minimum for and is differentiable at then
Let's use the ideas of the above discourse to extend the study of local maxima and local minima to functions of more than one variable. Suppose that the function
Then the function
And the directional derivative of
As
Let the function
is a point of that is not on the boundary of and is a local maximum or local minimum of and that- the partial derivatives of
exist at
Then
Let
- if
exists and is zero we call a critical point (or a stationary point) of the function, and - if
does not exist then we call a singular point of the function.
Note that some people (and texts) combine both of these cases and call
Theorem 2.9.2 tells us that every local maximum or minimum (in the interior of the domain of a function whose partial derivatives exist) is a critical point. Beware that it does not 4 tell us that every critical point is either a local maximum or a local minimum.
In fact, we shall see later 5, in Examples 2.9.13 and 2.9.15, critical points that are neither local maxima nor a local minima. None-the-less, Theorem 2.9.2 is very useful because often functions have only a small number of critical points. To find local maxima and minima of such functions, we only need to consider its critical and singular points. We'll return later to the question of how to tell if a critical point is a local maximum, local minimum or neither. For now, we'll just practice finding critical points.
Find all critical points of
Solution
To find the critical points, we need to find the gradient. To find the gradient we need to find the first order partial derivatives. So, as a preliminary calculation, we find the two first order partial derivatives of
So the critical points are the solutions of the pair of equations
or equivalently (dividing by two and moving the constants to the right hand side)
This is a system of two equations in two unknowns (
- First use one of the equations to solve for one of the unknowns in terms of the other unknown. For example, (E1) tells us that
This expresses in terms of We say that we have solved for in terms of - Then substitute the result,
in our case, into the other equation, (E2). In our case, this gives - We have now found that
is the only solution. So the only critical point is Of course it only takes a moment to verify that It is a good idea to do this as a simple check of our work.
An alternative strategy for solving a system of two equations in two unknowns, like (E1) and (E2), is to
- add equations (E1) and (E2) together. This gives
The point here is that adding equations (E1) and (E2) together eliminates the unknown leaving us with one equation in the unknown which is easily solved. For other systems of equations you might have to multiply the equations by some numbers before adding them together. - We now know that
Substituting it into (E1) gives us - Once again (thankfully) we have found that the only critical point is
This was pretty easy because we only had to solve linear equations, which in turn was a consequence of the fact that
Find all critical points of
Solution
As in the last example, we need to find where the gradient is zero, and to find the gradient we need the first order partial derivatives.
So the critical points are the solutions of
We can rewrite the first equation as
When
Alternatively, we could have also used the second equation to write
just as above.
And here is an example for which the algebra requires a bit more thought.
Find all critical points of
Solution
The first order partial derivatives of
The critical points are the solutions of
The first equation,
is satisfied. The second equation,
is satisfied.
So both critical point equations (E1) and (E2) are satisfied if and only if at least one of (E1a), (E1b) is satisfied and in addition at least one of (E2a), (E2b) is satisfied. So both critical point equations (E1) and (E2) are satisfied if and only if at least one of the following four possibilities hold.
- (E1a) and (E2a) are satisfied if and only if
- (E1a) and (E2b) are satisfied if and only if
- (E1b) and (E2a) are satisfied if and only if
- (E1b) and (E2b) are satisfied if and only if
We can use, for example, the second of these equations to solve for in terms of When we substitute this into the first equation we get which we can solve for This gives or and then
In conclusion, the critical points are
A more compact way to write what we have just done is
Let's try a more practical example — something from the real world. Well, a mathematician's “real world”. The interested reader should search-engine their way to a discussion of “idealisation”, “game theory” “Cournot models” and “Bertrand models”. But don't spend too long there. A discussion of breweries is about to take place.
In a certain community, there are two breweries in competition 6, so that sales of each negatively affect the profits of the other. If brewery A produces
respectively. Find the sum of the two profits if each brewery independently sets its own production level to maximize its own profit and assumes that its competitor does likewise. Then, assuming cartel behaviour, find the sum of the two profits if the two breweries cooperate so as to maximize that sum 7.
Solution
If
Equation (E1) yields
On the other hand if
Equation (E1) yields
So cooperating really does help their profits. Unfortunately, like a very small tea-pot, consumers will be a little poorer 8.
Moving swiftly away from the last pun, let's do something a little more geometric.
Equal angle bends are made at equal distances from the two ends of a 100 metre long fence so the resulting three segment fence can be placed along an existing wall to make an enclosure of trapezoidal shape. What is the largest possible area for such an enclosure?
Solution
This is a very geometric problem (fenced off from pun opportunities), and as such we should start by drawing a sketch and introducing some variable names.
The area enclosed by the fence is the area inside the blue rectangle (in the figure on the right above) plus the area inside the two blue triangles.
To maximize the area, we need to solve
Note that both terms in the first equation contain the factor
These equations might look a little scary. But there is no need to panic. They are not as bad as they look because
and the maximum area enclosed is
Now here is a very useful (even practical!) statistical example — finding the line that best fits a given collection of points.
An experiment yields
The definition of “best” is “minimizes the root mean square error”, i.e. minimizes
Note that
- term number
in is the square of the difference between which is the measured value of and which is the approximation to given by the line - All terms in the sum are positive, regardless of whether the points
are above or below the line.
Our problem is to find the
Solution
We wish to choose
There are a lot of symbols here. But remember that all of the
The equations which determine the critical points are (after dividing by two)
These are two linear equations on the unknowns
and then substitute this into (E1) to get the equation
for
Another way to solve the system of equations is
which gives the same solution.
So given a bunch of data points, it only takes a quick bit of arithmetic — no calculus required — to apply the above formulae and so to find the best fitting line. Of course while you don't need any calculus to apply the formulae, you do need calculus to understand where they came from. The same technique can be extended to other types of curve fitting problems. For example, polynomial regression.
The Second Derivative Test
Now let's start thinking about how to tell if a critical point is a local minimum or maximum. Remember what happens for functions of one variable. Suppose that
As
If
- if
then we will have when is close to (but not equal to) so that will be a local minimum and - if
then we will have when is close to (but not equal to) so that will be a local maximum, but - if
then we cannot draw any conclusions without more work.
A similar, but messier, analysis is possible for functions of two variables. Here are some simple quadratic examples that provide a warmup for that messier analysis.
Consider
So
Multiplying the first equation by 2 and subtracting the second equation gives
Then substituting
So
Now let's try to determine if
and study the behaviour of
And a good way to study the sign of quadratic expressions like
When there are two variables around, like
To this point, we have expressed
As the smallest values of
for all
You have already encountered single variable functions that have a critical point which is neither a local max nor a local min. See Example 3.5.9 in the CLP-1 text. Here are a couple of examples which show that this can also happen for functions of two variables. We'll start with the simplest possible such example.
The first partial derivatives of
- First consider moving
along the -axis. Then and So when we start with and then increase the value of the function increases — which means that cannot be a local maximum for - Next let's move
away from along the -axis. Then and So when we start with and then increase the value of the function decreases — which means that cannot be a local minimum for
So moving away from
The figure below show some level curves of
increases as you leave walking along the axis decreases as you leave walking along the axis
Approximately speaking, if a critical point
The critical point
- there is at least one point
within a distance of for which and - there is at least one point
within a distance of for which
Here is another example of a saddle point. This time we have to work a bit to see it.
Consider
So
The first equation gives that
So
To determine if
to give
Completing the square,
Notice that
- If
and are such that the first square is nonzero, but the second square is zero, then That is, whenever and then - On the other hand, if
and are such that the first square is zero but the second square is nonzero, then That is, whenever then
So
at all points on the blue line in the figure above, and at all point on the red line.
We conclude that
The above three examples show that we can find all critical points of quadratic functions of two variables. We can also classify each critical point as either a minimum, a maximum or a saddle point.
Of course not every function is quadratic. But by using the quadratic approximation 2.6.12 we can apply the same ideas much more generally. Suppose that
since
Let
It is called the discriminant of
- if
and then has a local minimum at - if
and then has a local maximum at - if
then has a saddle point at but - if
then we cannot draw any conclusions without more work.
-
We are putting quotation marks around the word “Proof”, because we are not going to justify the fact that it suffices to analyse the quadratic approximation in equation
Let's temporarily suppress the arguments If then by completing the square we can writeSimilarly, if
Note that this algebra breaks down if
We'll deal with that case shortly. More importantly, note that- if
then both and must be nonzero and of the same sign and furthermore, whenever or are nonzero,so that, recalling
- if
then is a local minimum and - if
then is a local maximum.
- if
- If
and is nonzero then
is strictly positive whenever and is strictly negative whenever so that is a saddle point. Similarly, is also a saddle point if and is nonzero. - Finally, if
and then
is strictly positive for one sign of and is strictly negative for the other sign of So is again a saddle point.
- if
You might wonder why, in the local maximum/local minimum cases of Theorem 2.9.16,
You might also wonder why we cannot draw any conclusions when
all have
Here are sketches of some level curves for each of these four functions (with all renamed to simply
Find and classify all critical points of
Solution
Thinking a little way ahead, to find the critical points we will need the gradient and to apply the second derivative test of Theorem 2.9.16 we will need all second order partial derivatives. So we need all partial derivatives of order up to two. Here they are.
(Of course,
We have already found, in Example 2.9.7, that the critical points are
| type | |||
| saddle point | |||
| 24 | local min |
We were able to leave the
- we knew that
and - we knew, from Theorem 2.9.16, that
by itself, was enough to ensure that was a saddle point.
Here is a sketch of some level curves of our
They are not needed to answer this question, but can give you some idea as to what the graph of
Find and classify all critical points of
Solution
We have already computed the first order partial derivatives
of
(Once again, we have computed both
| type | |||
| saddle point | |||
| saddle point | |||
| saddle point | |||
| 75 | local min |
Here is a sketch of some level curves of our
Again this is not needed to answer this question, but can give you some idea as to what the graph of
Find and classify all of the critical points of
Solution
We know the drill now. We start by computing all of the partial derivatives of
The critical points are then the solutions of
The second equation,
- When
equation (E1) forces to obey
so that or - When
equation (E1) forces to obey
which is impossible.
So, there are two critical points:
| type | |||
| local max | |||
| saddle point |
A manufacturer wishes to make an open rectangular box of given volume
Solution
Denote by
The box has two sides of area
However the three dimensions
We can use this constraint to eliminate one variable. Since
Let's start by finding the critical points of
Solving (E1) for
As there is only one critical point, we would expect it to give the minimum 14 . But let's use the second derivative test to verify that at least the critical point is a local minimum. The various second partial derivatives are
So
and, by Theorem 2.9.16.b,
Note that our solution has
Absolute Minima and Maxima
Of course a local maximum or minimum of a function need not be the absolute maximum of minimum. We'll now consider how to find the absolute maximum and minimum. Let's start by reviewing how one finds the absolute maximum and minimum of a function of one variable on an interval.
For concreteness, let's suppose that we want to find the extremal 15 values of a function
So to find the maximum and minimum of the function
- build up a list of all candidate points
at which the maximum or minimum could be attained, by finding all 's for which either and or and does not exist 16 or is a boundary point, i.e. or
- and then you evaluate
at each on the list of candidates. The biggest of these candidate values of is the absolute maximum and the smallest of these candidate values is the absolute minimum.
The procedure for finding the maximum and minimum of a function of two variables,
- build up a list of all candidate points
in the set at which the maximum or minimum could be attained, by finding all 's for which either 17 is in the interior of the set (for our example, ) and or is in the interior of the set and or does not exist or is a boundary 18 point, (for our example, ), and could give the maximum or minimum on the boundary — more about this shortly —
- and then you evaluate
at each on the list of candidates. The biggest of these candidate values of is the absolute maximum and the smallest of these candidate values is the absolute minimum.
The boundary of a set, like
Find the maximum and minimum of
Solution
Let's follow our checklist. First critical points, then points where the partial derivatives don't exist, and finally the boundary.
Interior Critical Points: If
Because the exponential
- As both
and are nonzero, we may divide the two equations, which gives forcing - Substituting this into either equation gives
so that
So the only critical points are
Singular points: In this problem, there are no singular points.
Boundary: Points on the boundary satisfy
As all
That is,
- when
- that is, when
and - which forces
and hence
All together, we have the following candidates for max and min, with the max and min indicated.
| point | ||||
| value of |
||||
| max | min |
The following sketch shows all of the critical points. It is a good idea to make such a sketch so that you don't accidentally include a critical point that is outside of the allowed region.
In the last example, we analyzed the behaviour of
Find the maximum and minimum values of
Solution
Again, we first find all critical points, then find all singular points and, finally, analyze the boundary.
Interior Critical Points: If
The critical points are the solutions of
The second equation,
- When
equation (E1) forces to obey
so that or - When
equation (E1) forces to obey
which is impossible.
So, there are only two critical points:
Singular points: In this problem, there are no singular points.
Boundary: On the boundary,
The max and min of
- when
( ) or - when
( ) or - when
( ).
Here is a sketch showing all of the points that we have identified.
Note that the point
| point | ||||
| value of |
||||
| max | min |
Find the maximum and minimum values of
Solution
As usual, let's examine the critical points, singular points and boundary in turn.
Interior Critical Points: If
The critical points are the solutions of
- If
we cannot have so we must have - If
we cannot have so we must have Dividing gives which is impossible.
So the only critical point in the square is
Singular points: Yet again there are no singular points in this problem.
Boundary: The region is a square, so its boundary consists of its four sides.
- First, we look at the part of the boundary with
On that entire side - Next, we look at the part of the boundary with
On that entire side - Next, we look at the part of the boundary with
There To find the maximum and minimum of on the part of the boundary with we must find the maximum and minimum of whenRecall that, in general, the maximum and minimum of a function
on the interval must occur either at or at or at an for which either or does not exist. In this case, so the max and min of for must occur- either at
where - or at
where - or at
where
- either at
- Finally, we look at the part of the boundary with
There As the only critical point of is at So the the max and min of for must occur- either at
where - or at
where - or at
where
- either at
All together, we have the following candidates for max and min, with the max and min indicated.
| point | ||||||||
| value of |
0 | 0 | 0 | 0 | 0 | 0 | ||
| min | min | min | min | min | min | max |
Find the maximum and minimum values of
Solution
As usual, let's examine the critical points, singular points and boundary in turn.
Interior Critical Points: If
So there is exactly one critical point, namely
Singular points: Yet again there are no singular points for this
Boundary: The region is a triangle, so its boundary consists of its three sides.
- First, we look at the side that runs from
to On that entire side so that The smallest value of on that side is at and the largest value of on that side is at - Next, we look at the side that runs from
to On that entire side so that The smallest value of on that side is at and the largest value of on that side is at - Finally, we look at the side that runs from
to Or first job is to find the equation of the line that contains and By way of review, we'll find the equation using three different methods.- Method 1: You (probably) learned in high school that any line in the
-plane 23 has equation where is the intercept and is the slope. In this case, the line crosses the axis at and so has intercept The line passes through and and so, as we see in the figure below, has slope Thus the side of the triangle that runs from to is with
- Method 1: You (probably) learned in high school that any line in the
- Method 2: Every line in the
-plane has an equation of the form In this case is not on the line so that and we can divide the equation by giving Rename and Thus, because the line does not pass through the origin, it has an equation of the form for some constants and In order for to lie on the line, has to be a solution of That is, so that In order for to lie on the line, has to be a solution of That is so that Thus the line has equation or equivalently, - Method 3: The vector from
to is As we see from the figure above, it is a direction vector for the line. One point on the line is So a parametric equation for the line (see Equation 1.3.1) is
By any of these three methods 24 , we have that the side of the triangle that runs from
Write
where or at where or when so that and
All together, we have the following candidates for max and min, with the max and min indicated.
| point | ||||
| value of |
0 | 2 | 2 | |
| min | max |
Find the high and low points of the surface
Solution
The function
- the minimum of
is achieved at the point in the square that is nearest the origin — namely the origin itself. So is the lowest point on the surface and is at height - The maximum of
is achieved at the points in the square that are farthest from the origin — namely the four corners of the square At those four points So the highest points on the surface are
Even though we have already answered this question, it will be instructive to see what we would have found if we had followed our usual protocol. The partial derivatives of
- There are no critical points because
only for and only for but is not a critical point because and are not defined there.
- There is one singular point — namely
The minimum value of is achieved at the singular point. - The boundary of the square consists of its four sides. One side is
On this side As increases with the smallest value of on that side is (when ) and the largest value of is (when ). The same thing happens on the other three sides. The maximum value of is achieved at the four corners. Note that and are both nonzero at all four corners.
Exercises
Stage 1
a. Some level curves of a function
For each of the four statements below, circle the letters of all points in the diagram where the situation applies. For example, if the statement were “These points are on the
b. The diagram below shows three “
Find the high and low points of the surface
If
Stage 2
Let
- Make a reasonably accurate sketch of the level curves in the
--plane of for and Be sure to show the units on the coordinate axes. - Verify that
is a critical point for and determine from part (a) or directly from the formula for whether is a local minimum, a local maximum or a saddle point. - Can you use the Second Derivative Test to determine whether the critical point
is a local minimum, a local maximum or a saddle point? Give reasons for your answer.
Use the Second Derivative Test to find all values of the constant
Find and classify all critical points of the function
Find all critical points for
Find the largest and smallest values of
Find and classify all the critical points of
Find all saddle points, local minima and local maxima of the function
For the surface
Find and classify [as local maxima, local minima, or saddle points] all critical points of
Find the maximum and minimum values of
The temperature at all points in the disc
- For the function
Find and classify as [local maxima, local minima, or saddle points] all critical points of - The images below depict level sets
of the functions in the list at heights Label the pictures with the corresponding function and mark the critical points in each picture. (Note that in some cases, the critical points might not be drawn on the images already. In those cases you should add them to the picture.)
Let the function
Classify as
Let
- Find and classify the critical points of
as local maxima, local minima or saddle points. - Find the maximum and minimum values of
on the disk
Find the absolute maximum and minimum values of the function
Find the minimum of the function
Let
- Find all critical points of
and classify each one as a local maximum, a local minimum, or saddle point. - Find the location and value of the absolute maximum and minimum of
on the triangular region
Find and classify the critical points of
Consider the function
- Find and classify all of the critical points of
- Find the maximum and minimum values of
in the triangle with vertices and
Find all critical points of the function
Let
- Find every critical point of
and classify each one. - Let
be the region in the plane between the hyperbola and the line Find the maximum and minimum values of on
Find all the critical points of the function
defined in the
A metal plate is in the form of a semi-circular disc bounded by the
Find all the critical points of the function
defined in the
Consider the function
- Find and classify all critical points of
- Find the absolute extrema of
on the bounded region given by
Find and classify all critical points of
Find the maximum value of
on the quarter-circle
Equal angle bends are made at equal distances from the two ends of a 100 metre long fence, so that the resulting three segment fence can be placed along an existing wall to make an enclosure of trapezoidal shape. What is the largest possible area for such an enclosure?
Find the most economical shape of a rectangular box that has a fixed volume
Stage 3
The temperature
- Find the maximum and minimum values of
on the disk defined by - Suppose an ant lives on the disk
If the ant is initially at point in which direction should it move so as to increase its temperature as quickly as possible? - Suppose that the ant moves at a velocity
What is its rate of increase of temperature as it passes through - Suppose the ant is constrained to stay on the curve
Where should the ant go if it wants to be as warm as possible?
Consider the function
where
- Show that the function
has exactly one critical point in the first quadrant and find its value at that point. - Use the second derivative test to classify the critical point in part (a).
- Hence explain why the inequality
is valid for all positive real numbers and
An experiment yields data points
- Life is not (always) one-dimensional and sometimes we have to embrace it.
- Or perhaps your instructor asked you.
- Recall that if
and then This is because the product of any two negative numbers is positive, so that - A very common error of logic that people make is “Affirming the consequent”. “If P then Q” is true, does not imply that “If Q then P” is true . The statement “If he is Shakespeare then he is dead” is true. But concluding from “That man is dead” that “He must be Shakespeare” is just silly.
- And you also saw, for example in Example 3.6.4 of the CLP-1 text, that critical points that are also inflection points are neither local maxima nor local minima.
- We have both types of music here — country and western.
- This sort of thing is generally illegal.
- Sorry about the pun.
- Proof by search engine.
- And has been used for a long time. It was introduced by the French mathematician Adrien-Marie Legendre, 1752--1833, in 1805, and by the German mathematician and physicist Carl Friedrich Gauss, 1777--1855, in 1809.
- This is equivalent to translating the graph so that the critical point lies at
- There are analogous results in higher dimensions that are accessible to people who have learned some linear algebra. They are derived by diagonalizing the matrix of second derivatives, which is called the Hessian matrix.
- The shackles of convention are not limited to mathematics. Election ballots often have the candidates listed in alphabetic order.
- Indeed one can use the facts that
that and that as and as and as and as to prove that the single critical point gives the global minimum. - Recall that “extremal value” means “either maximum value or minimum value”.
- Recall that if
does not exist, then is called a singular point of -
This is probably a good time to review the statement of Theorem 2.9.2.
-
It should intuitively obvious from a sketch that the boundary of the disk
is the circle But if you really need a formal definition, here it is. A point is on the boundary of a set if there is a sequence of points in that converges to and there is also a sequence of points in the complement of that converges to -
We actually found the critical points in Example 2.9.19. But, for the convenience of the reader, we'll repeat that here.
-
Even if you don't believe that “you can't have too many tools”, it is pretty dangerous to have to rely on just one tool.
-
If it contained odd powers too, we could consider the cases
and separately and substitute in the former case and in the latter case. -
We found
as a solution to the critical point equations (E1), (E2). That's because, in the course of solving those equations, we ignored the constraint that -
To be picky, any line the
-plane that is not parallel to the axis. -
In the third method,
has just be renamed to


