Skip to main content

CLP-3 Multivariable Calculus

Section 2.9 Maximum and Minimum Values

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 
Life is not (always) one-dimensional and sometimes we have to embrace it.
. 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.

Definition 2.9.1.

Let the function f(x,y) be defined for all (x,y) in some subset R of R2. Let (a,b) be a point in R.
  • (a,b) is a local maximum of f(x,y) if f(x,y)≀f(a,b) for all (x,y) close to (a,b). More precisely, (a,b) is a local maximum of f(x,y) if there is an r>0 such that f(x,y)≀f(a,b) for all points (x,y) within a distance r of (a,b).
  • (a,b) is a local minimum of f(x,y) if f(x,y)β‰₯f(a,b) for all (x,y) close to (a,b).
  • Local maximum and minimum values are also called extremal values.
  • (a,b) is an absolute maximum or global maximum of f(x,y) if f(x,y)≀f(a,b) for all (x,y) in R.
  • (a,b) is an absolute minimum or global minimum of f(x,y) if f(x,y)β‰₯f(a,b) for all (x,y) in R.

Subsection 2.9.1 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 f(x) was ask yourself
 2 
Or perhaps your instructor asked you.
  • Suppose that the largest value of f(x) is f(a). What does that tell us about a?
After a little thought you answered
  • If the largest value of f(x) is f(a) and f is differentiable at a, then fβ€²(a)=0.
Let’s recall why that’s true. Suppose that the largest value of f(x) is f(a). Then for all h>0,
f(a+h)≀f(a)⟹f(a+h)βˆ’f(a)≀0⟹f(a+h)βˆ’f(a)h≀0if h>0
Taking the limit hβ†’0 tells us that fβ€²(a)≀0. Similarly
 3 
Recall that if h<0 and A≀B, then hAβ‰₯hB. This is because the product of any two negative numbers is positive, so that h<0, A≀B⟹Aβˆ’B≀0⟹h(Aβˆ’B)β‰₯0⟹hAβ‰₯hB.
, for all h<0,
f(a+h)≀f(a)⟹f(a+h)βˆ’f(a)≀0⟹f(a+h)βˆ’f(a)hβ‰₯0if h<0
Taking the limit hβ†’0 now tells us that fβ€²(a)β‰₯0. So we have both fβ€²(a)β‰₯0 and fβ€²(a)≀0 which forces fβ€²(a)=0.
You also observed at the time that for this argument to work, you only need f(x)≀f(a) for all x’s close to a, not necessarily for all x’s in the whole world. (In the above inequalities, we only used f(a+h) with h small.) Since we care only about f(x) for x near a, we can refine the above statement.
  • If f(a) is a local maximum for f(x) and f is differentiable at a, then fβ€²(a)=0.
Precisely the same reasoning applies to minima.
  • If f(a) is a local minimum for f(x) and f is differentiable at a, then fβ€²(a)=0.
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 f(x,y) is defined for all (x,y) in some subset R of R2, that (a,b) is a point of R that is not on the boundary of R, and that f has a local maximum at (a,b). See the figure below.
Then the function f(x,y) must decrease in value as (x,y) moves away from (a,b) in any direction. No matter which direction d we choose, the directional derivative of f at (a,b) in direction d must be zero or smaller. Writing this in mathematical symbols, we get
Dd|d|f(a,b)=βˆ‡βˆ‡f(a,b)β‹…d|d|≀0
And the directional derivative of f at (a,b) in the direction βˆ’d also must be zero or negative.
Dβˆ’d|d|f(a,b)=βˆ‡βˆ‡f(a,b)β‹…βˆ’d|d|≀0which implies thatβˆ‡βˆ‡f(a,b)β‹…d|d|β‰₯0
As βˆ‡βˆ‡f(a,b)β‹…d|d| must be both positive (or zero) and negative (or zero) at the same time, it must be zero. In particular, choosing d=Δ±Δ±^ forces the x component of βˆ‡βˆ‡f(a,b) to be zero, and choosing d=Θ·Θ·^ forces the y component of βˆ‡βˆ‡f(a,b) to be zero. We have thus shown that βˆ‡βˆ‡f(a,b)=0. The same argument shows that βˆ‡βˆ‡f(a,b)=0 when (a,b) is a local minimum too. This is an important and useful result, so let’s theoremise it.

Definition 2.9.3.

Let f(x,y) be a function and let (a,b) be a point in its domain. Then
  • if βˆ‡βˆ‡f(a,b) exists and is zero we call (a,b) a critical point (or a stationary point) of the function, and
  • if βˆ‡βˆ‡f(a,b) does not exist then we call (a,b) a singular point of the function.

Warning 2.9.4.

Note that some people (and texts) combine both of these cases and call (a,b) a critical point when either the gradient is zero or does not exist.

Warning 2.9.5.

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 
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.
tell us that every critical point is either a local maximum or a local minimum.
In fact, we shall see later
 5 
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.
, 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.

Example 2.9.6. f(x,y)=x2βˆ’2xy+2y2+2xβˆ’6y+12.

Find all critical points of f(x,y)=x2βˆ’2xy+2y2+2xβˆ’6y+12.
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 f(x,y).
fx(x,y)=2xβˆ’2y+2fy(x,y)=βˆ’2x+4yβˆ’6
So the critical points are the solutions of the pair of equations
2xβˆ’2y+2=0βˆ’2x+4yβˆ’6=0
or equivalently (dividing by two and moving the constants to the right hand side)
(E1)xβˆ’y=βˆ’1(E2)βˆ’x+2y=3
This is a system of two equations in two unknowns (x and y). One strategy for a solving system like this is to
  • 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 y=x+1. This expresses y in terms of x. We say that we have solved for y in terms of x.
  • Then substitute the result, y=x+1 in our case, into the other equation, (E2). In our case, this gives
    βˆ’x+2(x+1)=3⟺x+2=3⟺x=1
  • We have now found that x=1, y=x+1=2 is the only solution. So the only critical point is (1,2). Of course it only takes a moment to verify that βˆ‡βˆ‡f(1,2)=⟨0,0⟩. 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
    (E1)+(E2):  (1βˆ’1)x+(βˆ’1+2)y=βˆ’1+3⟺y=2
    The point here is that adding equations (E1) and (E2) together eliminates the unknown x, leaving us with one equation in the unknown y, 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 y=2. Substituting it into (E1) gives us
    xβˆ’2=βˆ’1⟹x=1
  • Once again (thankfully) we have found that the only critical point is (1,2).
This was pretty easy because we only had to solve linear equations, which in turn was a consequence of the fact that f(x,y) was a polynomial of degree two. Here is an example with some slightly more challenging algebra.

Example 2.9.7. f(x,y)=2x3βˆ’6xy+y2+4y.

Find all critical points of f(x,y)=2x3βˆ’6xy+y2+4y.
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.
fx=6x2βˆ’6yfy=βˆ’6x+2y+4
So the critical points are the solutions of
6x2βˆ’6y=0βˆ’6x+2y+4=0
We can rewrite the first equation as y=x2, which expresses y as a function of x. We can then substitute y=x2 into the second equation, giving
βˆ’6x+2y+4=0βŸΊβˆ’6x+2x2+4=0⟺x2βˆ’3x+2=0⟺(xβˆ’1)(xβˆ’2)=0⟺x=1 or 2
When x=1, y=12=1 and when x=2, y=22=4. So, there are two critical points: (1,1), (2,4).
Alternatively, we could have also used the second equation to write y=3xβˆ’2, and then substituted that into the first equation to get
6x2βˆ’6(3xβˆ’2)=0⟺x2βˆ’3x+2=0
just as above.
And here is an example for which the algebra requires a bit more thought.

Example 2.9.8. f(x,y)=xy(5x+yβˆ’15).

Find all critical points of f(x,y)=xy(5x+yβˆ’15).
Solution.
The first order partial derivatives of f(x,y)=xy(5x+yβˆ’15) are
fx(x,y) = y(5x+yβˆ’15)+xy(5) = y(5x+yβˆ’15)+y(5x) = y(10x+yβˆ’15)fy(x,y) = x(5x+yβˆ’15)+xy(1) = x(5x+yβˆ’15)+x(y) = x(5x+2yβˆ’15)
The critical points are the solutions of fx(x,y)=fy(x,y)=0. That is, we need to find all x,y that satisfy the pair of equations
(E1)y(10x+yβˆ’15)=0(E2)x(5x+2yβˆ’15)=0
The first equation, y(10x+yβˆ’15)=0, is satisfied if at least one of the two factors y, (10x+yβˆ’15) is zero. So the first equation is satisfied if at least one of the two equations
(E1a)y=0(E1b)10x+y=15
is satisfied. The second equation, x(5x+2yβˆ’15)=0, is satisfied if at least one of the two factors x, (5x+2yβˆ’15) is zero. So the second equation is satisfied if at least one of the two equations
(E2a)x=0(E2b)5x+2y=15
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 x=y=0
  • (E1a) and (E2b) are satisfied if and only if y=0, 5x+2y=15⟺y=0, 5x=15
  • (E1b) and (E2a) are satisfied if and only if 10x+y=15, x=0⟺y=15, x=0
  • (E1b) and (E2b) are satisfied if and only if 10x+y=15, 5x+2y=15. We can use, for example, the second of these equations to solve for x in terms of y: x=15(15βˆ’2y). When we substitute this into the first equation we get 2(15βˆ’2y)+y=15, which we can solve for y. This gives βˆ’3y=15βˆ’30 or y=5 and then x=15(15βˆ’2Γ—5)=1.
In conclusion, the critical points are (0,0), (3,0), (0,15) and (1,5).
A more compact way to write what we have just done is
fx(x,y)=0andfy(x,y)=0⟺y(10x+yβˆ’15)=0andx(5x+2yβˆ’15)=0⟺{y=0 or 10x+y=15}and{x=0 or 5x+2y=15}⟺{y=0, x=0} or {y=0, 5x+2y=15} or {10x+y=15, x=0} or {10x+y=15, 5x+2y=15}⟺{x=y=0} or {y=0, x=3} or {x=0, y=15} or {x=1, y=5}
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.

Example 2.9.9.

In a certain community, there are two breweries in competition
 6 
We have both types of music here β€” country and western.
, so that sales of each negatively affect the profits of the other. If brewery A produces x litres of beer per month and brewery B produces y litres per month, then the profits of the two breweries are given by
P=2xβˆ’2x2+y2106Q=2yβˆ’4y2+x22Γ—106
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 
This sort of thing is generally illegal.
.
Solution.
If A adjusts x to maximize P (for y held fixed) and B adjusts y to maximize Q (for x held fixed) then x and y are determined by the equations
(E1)Px=2βˆ’4x106=0(E2)Qy=2βˆ’8y2Γ—106=0
Equation (E1) yields x=12106 and equation (E2) yields y=12106. Knowing x and y we can determine P, Q and the total profit
P+Q=2(x+y)βˆ’1106(52x2+3y2)=106(1+1βˆ’58βˆ’34)=58106
On the other hand if (A,B) adjust (x,y) to maximize P+Q=2(x+y)βˆ’1106(52x2+3y2), then x and y are determined by
(E1)(P+Q)x=2βˆ’5x106=0(E2)(P+Q)y=2βˆ’6y106=0
Equation (E1) yields x=25106 and equation (E2) yields y=13106. Again knowing x and y we can determine the total profit
P+Q=2(x+y)βˆ’1106(52x2+3y2)=106(45+23βˆ’25βˆ’13)=1115106
So cooperating really does help their profits. Unfortunately, like a very small tea-pot, consumers will be a little poorer
 8 
Sorry about the pun.
.
Moving swiftly away from the last pun, let’s do something a little more geometric.

Example 2.9.10.

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.
A(x,ΞΈ)=(100βˆ’2x)xsin⁑θ+2β‹…12β‹…xsin⁑θ⋅xcos⁑θ=(100xβˆ’2x2)sin⁑θ+x2sin⁑θ cos⁑θ
To maximize the area, we need to solve
0=βˆ‚Aβˆ‚x=(100βˆ’4x)sin⁑θ+2xsin⁑θcos⁑θ0=βˆ‚Aβˆ‚ΞΈ=(100xβˆ’2x2)cos⁑θ+x2{cos2β‘ΞΈβˆ’sin2⁑θ}
Note that both terms in the first equation contain the factor sin⁑θ and all terms in the second equation contain the factor x. If either sin⁑θ or x are zero the area A(x,θ) will also be zero, and so will certainly not be maximal. So we may divide the first equation by sin⁑θ and the second equation by x, giving
(E1)(100βˆ’4x)+2xcos⁑θ=0(E2)(100βˆ’2x)cos⁑θ+x{cos2β‘ΞΈβˆ’sin2⁑θ}=0
These equations might look a little scary. But there is no need to panic. They are not as bad as they look because ΞΈ enters only through cos⁑θ and sin2⁑θ, which we can easily write in terms of cos⁑θ. Furthermore we can eliminate cos⁑θ by observing that the first equation forces cos⁑θ=βˆ’100βˆ’4x2x and hence sin2⁑θ=1βˆ’cos2⁑θ=1βˆ’(100βˆ’4x)24x2. Substituting these into the second equation gives
βˆ’(100βˆ’2x)100βˆ’4x2x+x[(100βˆ’4x)22x2βˆ’1]=0βŸΉβˆ’(100βˆ’2x)(100βˆ’4x)+(100βˆ’4x)2βˆ’2x2=0⟹6x2βˆ’200x=0⟹x=1003cos⁑θ=βˆ’βˆ’100/3200/3=12ΞΈ=60∘
and the maximum area enclosed is
A=(1001003βˆ’2100232)32 + 1210023232 = 25003
Now here is a very useful (even practical!) statistical example β€” finding the line that best fits a given collection of points.

Example 2.9.11. Linear regression.

An experiment yields n data points  (xi,yi), i=1,2,β‹―,n. We wish to find the straight line  y=mx+b  which β€œbest” fits the data.
The definition of β€œbest” is β€œminimizes the root mean square error”, i.e. minimizes
E(m,b)=βˆ‘i=1n(mxi+bβˆ’yi)2
Note that
  • term number i in E(m,b) is the square of the difference between yi, which is the ith measured value of y, and [mx+b]x=xi, which is the approximation to yi given by the line y=mx+b.
  • All terms in the sum are positive, regardless of whether the points (xi,yi) are above or below the line.
Our problem is to find the m and b that minimizes E(m,b). This technique for drawing a line through a bunch of data points is called β€œlinear regression”. It is used a lot
 9 
Proof by search engine.
 10 
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.
. Even in the real world β€” and not just the real world that you find in mathematics problems. The actual real world that involves jobs.
Solution.
We wish to choose m and b so as to minimize E(m,b). So we need to determine where the partial derivatives of E are zero.
0=βˆ‚Eβˆ‚m=βˆ‘i=1n2(mxi+bβˆ’yi)xi=m[βˆ‘i=1n⁑2xi2]+b[βˆ‘i=1n⁑2xi]βˆ’[βˆ‘i=1n⁑2xiyi]0=βˆ‚Eβˆ‚b=βˆ‘i=1n2(mxi+bβˆ’yi)=m[βˆ‘i=1n⁑2xi]+b[βˆ‘i=1n⁑2]βˆ’[βˆ‘i=1n⁑2yi]
There are a lot of symbols here. But remember that all of the xi’s and yi’s are given constants. They come from, for example, experimental data. The only unknowns are m and b. To emphasize this, and to save some writing, define the constants
Sx=βˆ‘i=1n⁑xiSy=βˆ‘i=1n⁑yiSx2=βˆ‘i=1n⁑xi2Sxy=βˆ‘i=1n⁑xiyi
The equations which determine the critical points are (after dividing by two)
(E1)Sx2m+Sxb=Sxy(E2)Sxm+nb=Sy
These are two linear equations on the unknowns m and b. They may be solved in any of the usual ways. One is to use (E2) to solve for b in terms of m
(E3)b=1n(Syβˆ’Sxm)
and then substitute this into (E1) to get the equation
Sx2m+1nSx(Syβˆ’Sxm)=Sxy⟹(nSx2βˆ’Sx2)m=nSxyβˆ’SxSy
for m. We can then solve this equation for m and substitute back into (E3) to get b. This gives
m=nSxyβˆ’SxSynSx2βˆ’Sx2b=SynnSx2βˆ’Sx2nSx2βˆ’Sx2βˆ’SxnnSxyβˆ’SxSynSx2βˆ’Sx2=nSySx2βˆ’nSxSxyn(nSx2βˆ’Sx2)=βˆ’SxSxyβˆ’SySx2nSx2βˆ’Sx2
Another way to solve the system of equations is
n(E1)βˆ’Sx(E2):[nSx2βˆ’Sx2]m=nSxyβˆ’SxSyβˆ’Sx(E1)+Sx2(E2):[nSx2βˆ’Sx2]b=βˆ’SxSxy+SySx2
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.

Subsection 2.9.2 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 x=a is a critical point of the function f(x). Any (sufficiently smooth) function is well approximated, when x is close to a, by the first few terms of its Taylor expansion
f(x)=f(a)+fβ€²(a)(xβˆ’a)+12fβ€³(a)(xβˆ’a)2+13!f(3)(a)(xβˆ’a)3+β‹―
As a is a critical point, we know that fβ€²(a)=0 and
f(x)=f(a)+12fβ€³(a)(xβˆ’a)2+13!f(3)(a)(xβˆ’a)3+β‹―
If fβ€³(a)β‰ 0, f(x) is going to look a lot like f(a)+12fβ€³(a)(xβˆ’a)2 when x is really close to a. In particular
  • if fβ€³(a)>0, then we will have f(x)>f(a) when x is close to (but not equal to) a, so that a will be a local minimum and
  • if fβ€³(a)<0, then we will have f(x)<f(a) when x is close to (but not equal to) a, so that a will be a local maximum, but
  • if fβ€³(a)=0, 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.

Example 2.9.12. f(x,y)=x2+3xy+3y2βˆ’6xβˆ’3yβˆ’6.

Consider f(x,y)=x2+3xy+3y2βˆ’6xβˆ’3yβˆ’6. The gradient of f is
βˆ‡βˆ‡f(x,y)=(2x+3yβˆ’6)Δ±Δ±^+(3x+6yβˆ’3)Θ·Θ·^
So (x,y) is a critical point of f if and only if
(E1)2x+3y=6(E2)3x+6y=3
Multiplying the first equation by 2 and subtracting the second equation gives
(2(E1) - (E2))x=9
Then substituting x=9 back into the first equation gives
2Γ—9+3y=6⟹y=βˆ’4
So f(x,y) has precisely one critical point, namely (9,βˆ’4).
Now let’s try to determine if f(x,y) has a local minimum, or a local maximum, or neither, at (9,βˆ’4). A good way to determine the behaviour of f(x,y) for (x,y) near (9,βˆ’4) is to make the change of variables
 11 
This is equivalent to translating the graph so that the critical point lies at (0,0).
x=9+Ξ”xy=βˆ’4+Ξ”y
and study the behaviour of f for Ξ”x and Ξ”y near zero.
f(9+Ξ”x,βˆ’4+Ξ”y)=(9+Ξ”x)2+3(9+Ξ”x)(βˆ’4+Ξ”y)+3(βˆ’4+Ξ”y)2βˆ’6(9+Ξ”x)βˆ’3(βˆ’4+Ξ”y)βˆ’6=(Ξ”x)2+3Ξ”xΞ”y+3(Ξ”y)2βˆ’27
And a good way to study the sign of quadratic expressions like (Ξ”x)2+3Ξ”xΞ”y+3(Ξ”y)2 is to complete the square. So far you have probably just completed the square for quadratic expressions that involve only a single variable. For example
x2+3x+3=(x+32)2βˆ’94+3
When there are two variables around, like Ξ”x and Ξ”y, you can just pretend that one of them is a constant and complete the square as before. For example, if you pretend that Ξ”y is a constant,
(Ξ”x)2+3Ξ”xΞ”y+3(Ξ”y)2=(Ξ”x+32Ξ”y)2+(3βˆ’94)(Ξ”y)2=(Ξ”x+32Ξ”y)2+34(Ξ”y)2
To this point, we have expressed
f(9+Ξ”x,βˆ’4+Ξ”y)=(Ξ”x+32Ξ”y)2+34(Ξ”y)2βˆ’27
As the smallest values of (Ξ”x+32Ξ”y)2 and 34(Ξ”y)2 are both zero, we have that
f(x,y)=f(9+Ξ”x,βˆ’4+Ξ”y)β‰₯βˆ’27=f(9,βˆ’4)
for all (x,y) so that (9,βˆ’4) is both a local minimum and a global minimum for f.
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.

Example 2.9.13. f(x,y)=x2βˆ’y2.

The first partial derivatives of f(x,y)=x2βˆ’y2 are fx(x,y)=2x and fy(x,y)=βˆ’2y. So the only critical point of this function is (0,0). Is this a local minimum or maximum? Well let’s start with (x,y) at (0,0) and then move (x,y) away from (0,0) and see if f(x,y) gets bigger or smaller. At the origin f(0,0)=0. Of course we can move (x,y) away from (0,0) in many different directions.
  • First consider moving (x,y) along the x-axis. Then (x,y)=(x,0) and f(x,y)=f(x,0)=x2. So when we start with x=0 and then increase x, the value of the function f increases β€” which means that (0,0) cannot be a local maximum for f.
  • Next let’s move (x,y) away from (0,0) along the y-axis. Then (x,y)=(0,y) and f(x,y)=f(0,y)=βˆ’y2. So when we start with y=0 and then increase y, the value of the function f decreases β€” which means that (0,0) cannot be a local minimum for f.
So moving away from (0,0) in one direction causes the value of f to increase, while moving away from (0,0) in a second direction causes the value of f to decrease. Consequently (0,0) is neither a local minimum or maximum for f. It is called a saddle point, because the graph of f looks like a saddle. (The full definition of β€œsaddle point” is given immediately after this example.) Here are some figures showing the graph of f.
The figure below show some level curves of f. Observe from the level curves that
  • f increases as you leave (0,0) walking along the x axis
  • f decreases as you leave (0,0) walking along the y axis
Approximately speaking, if a critical point (a,b) is neither a local minimum nor a local maximum, then it is a saddle point. For (a,b) to not be a local minimum, f has to take values bigger than f(a,b) at some points nearby (a,b). For (a,b) to not be a local maximum, f has to take values smaller than f(a,b) at some points nearby (a,b). Writing this more mathematically we get the following definition.

Definition 2.9.14.

The critical point (a,b) is called a saddle point for the function f(x,y) if, for each r>0,
  • there is at least one point (x,y), within a distance r of (a,b), for which f(x,y)>f(a,b) and
  • there is at least one point (x,y), within a distance r of (a,b), for which f(x,y)<f(a,b).
Here is another example of a saddle point. This time we have to work a bit to see it.

Example 2.9.15. f(x,y)=x2βˆ’2xyβˆ’y2+4yβˆ’2.

Consider f(x,y)=x2βˆ’2xyβˆ’y2+4yβˆ’2. The gradient of f is
βˆ‡βˆ‡f(x,y)=(2xβˆ’2y)Δ±Δ±^+(βˆ’2xβˆ’2y+4)Θ·Θ·^
So (x,y) is a critical point of f if and only if
2xβˆ’2y=0βˆ’2xβˆ’2y=βˆ’4
The first equation gives that x=y. Substituting y=x into the second equation gives
βˆ’2yβˆ’2y=βˆ’4⟹x=y=1
So f(x,y) has precisely one critical point, namely (1,1).
To determine if f(x,y) has a local minimum, or a local maximum, or neither, at (1,1), we proceed as in Example 2.9.12. We make the change of variables
x=1+Ξ”xy=1+Ξ”y
to give
f(1+Ξ”x,1+Ξ”y)=(1+Ξ”x)2βˆ’2(1+Ξ”x)(1+Ξ”y)βˆ’(1+Ξ”y)2+4(1+Ξ”y)βˆ’2=(Ξ”x)2βˆ’2Ξ”xΞ”yβˆ’(Ξ”y)2
Completing the square,
f(1+Ξ”x,1+Ξ”y)=(Ξ”x)2βˆ’2Ξ”xΞ”yβˆ’(Ξ”y)2=(Ξ”xβˆ’Ξ”y)2βˆ’2(Ξ”y)2
Notice that f has now been written as the difference of two squares, much like the f in the saddle point Example 2.9.13.
  • If Ξ”x and Ξ”y are such that the first square (Ξ”xβˆ’Ξ”y)2 is nonzero, but the second square (Ξ”y)2 is zero, then f(1+Ξ”x,1+Ξ”y)=(Ξ”xβˆ’Ξ”y)2>0=f(1,1). That is, whenever Ξ”y=0 and Ξ”xβ‰ Ξ”y, then f(1+Ξ”x,1+Ξ”y)=(Ξ”xβˆ’Ξ”y)2>0=f(1,1).
  • On the other hand, if Ξ”x and Ξ”y are such that the first square (Ξ”xβˆ’Ξ”y)2 is zero but the second square (Ξ”y)2 is nonzero, then f(1+Ξ”x,1+Ξ”y)=βˆ’2(Ξ”y)2<0=f(1,1). That is, whenever Ξ”x=Ξ”yβ‰ 0, then f(1+Ξ”x,1+Ξ”y)=βˆ’2(Ξ”y)2<0=f(1,1).
So
  • f(x,y)>f(1,1) at all points on the blue line in the figure above, and
  • f(x,y)<f(1,1) at all point on the red line.
We conclude that (1,1) is the only critical point for f(x,y), and furthermore that it is a saddle point.
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 (a,b) is a critical point of some function f(x,y). For Ξ”x and Ξ”y small, the quadratic approximation 2.6.12 gives
(βˆ—)f(a+Ξ”x,b+Ξ”y)β‰ˆf(a,b)+fx(a,b)Ξ”x+fy(a,b)Ξ”y+12{fxx(a,b)Ξ”x2+2fxy(a,b)Ξ”xΞ”y+fyy(a,b)Ξ”y2}=f(a,b)+12{fxx(a,b)Ξ”x2+2fxy(a,b)Ξ”xΞ”y+fyy(a,b)Ξ”y2}
since (a,b) is a critical point so that fx(a,b)=fy(a,b)=0. Then using the technique of Examples 2.9.12 and 2.9.15, we get
 12 
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.
(details below).

Proof.

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 (a,b). If fxx(a,b)β‰ 0, then by completing the square we can write
fxxΞ”x2+2fxyΞ”xΞ”y+fyyΞ”y2=fxx(Ξ”x+fxyfxxΞ”y)2+(fyyβˆ’fxy2fxx)Ξ”y2=1fxx{(fxxΞ”x+fxyΞ”y)2+(fxxfyyβˆ’fxy2)Ξ”y2}
Similarly, if fyy(a,b)β‰ 0,
fxxΞ”x2+2fxyΞ”xΞ”y+fyyΞ”y2=1fyy{(fxyΞ”x+fyyΞ”y)2+(fxxfyyβˆ’fxy2)Ξ”x2}
Note that this algebra breaks down if fxx(a,b)=fyy(a,b)=0. We’ll deal with that case shortly. More importantly, note that
  • if (fxxfyyβˆ’fxy2)>0 then both fxx and fyy must be nonzero and of the same sign and furthermore, whenever Ξ”x or Ξ”y are nonzero,
    {(fxxΞ”x+fxyΞ”y)2+(fxxfyyβˆ’fxy2)Ξ”y2}>0and{(fxyΞ”x+fyyΞ”y)2+(fxxfyyβˆ’fxy2)Ξ”x2}>0
    so that, recalling (βˆ—),
    • if fxx(a,b)>0, then (a,b) is a local minimum and
    • if fxx(a,b)<0, then (a,b) is a local maximum.
  • If (fxxfyyβˆ’fxy2)<0 and fxx is nonzero then
    {(fxxΞ”x+fxyΞ”y)2+(fxxfyyβˆ’fxy2)Ξ”y2}
    is strictly positive whenever Ξ”xβ‰ 0, Ξ”y=0 and is strictly negative whenever fxxΞ”x+fxyΞ”y=0, Ξ”yβ‰ 0, so that (a,b) is a saddle point. Similarly, (a,b) is also a saddle point if (fxxfyyβˆ’fxy2)<0 and fyy is nonzero.
  • Finally, if fxyβ‰ 0 and fxx=fyy=0, then
    fxxΞ”x2+2fxyΞ”xΞ”y+fyyΞ”y2=2fxyΞ”xΞ”y
    is strictly positive for one sign of Ξ”xΞ”y and is strictly negative for the other sign of Ξ”xΞ”y. So (a,b) is again a saddle point.
You might wonder why, in the local maximum/local minimum cases of Theorem 2.9.16, fxx(a,b) appears rather than fyy(a,b). The answer is only that x is before y in the alphabet
 13 
The shackles of convention are not limited to mathematics. Election ballots often have the candidates listed in alphabetic order.
. You can use fyy(a,b) just as well as fxx(a,b). The reason is that if D(a,b)>0 (as in the first two bullets of the theorem), then because D(a,b)=fxx(a,b)fyy(a,b)βˆ’fxy(a,b)2>0, we necessarily have fxx(a,b)fyy(a,b)>0 so that fxx(a,b) and fyy(a,b) must have the same sign β€” either both are positive or both are negative.
You might also wonder why we cannot draw any conclusions when D(a,b)=0 and what happens then. The second derivative test for functions of two variables was derived in precisely the same way as the second derivative test for functions of one variable is derived β€” you approximate the function by a polynomial that is of degree two in (xβˆ’a), (yβˆ’b) and then you analyze the behaviour of the quadratic polynomial near (a,b). For this to work, the contributions to f(x,y) from terms that are of degree two in (xβˆ’a), (yβˆ’b) had better be bigger than the contributions to f(x,y) from terms that are of degree three and higher in (xβˆ’a), (yβˆ’b) when (xβˆ’a), (yβˆ’b) are really small. If this is not the case, for example when the terms in f(x,y) that are of degree two in (xβˆ’a), (yβˆ’b) all have coefficients that are exactly zero, the analysis will certainly break down. That’s exactly what happens when D(a,b)=0. Here are some examples. The functions
f1(x,y)=x4+y4f2(x,y)=βˆ’x4βˆ’y4f3(x,y)=x3+y3f4(x,y)=x4βˆ’y4
all have (0,0) as the only critical point and all have D(0,0)=0. The first, f1 has its minimum there. The second, f2, has its maximum there. The third and fourth have a saddle point there.
Here are sketches of some level curves for each of these four functions (with all renamed to simply f).

Example 2.9.17. f(x,y)=2x3βˆ’6xy+y2+4y.

Find and classify all critical points of f(x,y)=2x3βˆ’6xy+y2+4y.
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.
f=2x3βˆ’6xy+y2+4yfx=6x2βˆ’6yfxx=12xfxy=βˆ’6fy=βˆ’6x+2y+4fyy=2fyx=βˆ’6
(Of course, fxy and fyx have to be the same. It is still useful to compute both, as a way to catch some mechanical errors.)
We have already found, in Example 2.9.7, that the critical points are (1,1), (2,4). The classification is
criticalpoint fxxfyyβˆ’fxy2 fxx type
(1,1) 12Γ—2βˆ’(βˆ’6)2<0 saddle point
(2,4) 24Γ—2βˆ’(βˆ’6)2>0 24 local min
We were able to leave the fxx entry in the top row blank, because
  • we knew that fxx(1,1)fyy(1,1)βˆ’fxy2(1,1)<0, and
  • we knew, from Theorem 2.9.16, that fxx(1,1)fyy(1,1)βˆ’fxy2(1,1)<0, by itself, was enough to ensure that (1,1) was a saddle point.
Here is a sketch of some level curves of our f(x,y).
They are not needed to answer this question, but can give you some idea as to what the graph of f looks like.

Example 2.9.18. f(x,y)=xy(5x+yβˆ’15).

Find and classify all critical points of f(x,y)=xy(5x+yβˆ’15).
Solution.
We have already computed the first order partial derivatives
fx(x,y)=y(10x+yβˆ’15)fy(x,y)=x(5x+2yβˆ’15)
of f(x,y) in Example 2.9.8. Again, to classify the critical points we need the second order partial derivatives. They are
fxx(x,y)=10yfyy(x,y)=2xfxy(x,y)=(1)(10x+yβˆ’15)+y(1)=10x+2yβˆ’15fyx(x,y)=(1)(5x+2yβˆ’15)+x(5)=10x+2yβˆ’15
(Once again, we have computed both fxy and fyx to guard against mechanical errors.) We have already found, in Example 2.9.8, that the critical points are (0,0), (0,15), (3,0) and (1,5). The classification is
criticalpoint fxxfyyβˆ’fxy2 fxx type
(0,0) 0Γ—0βˆ’(βˆ’15)2<0 saddle point
(0,15) 150Γ—0βˆ’152<0 saddle point
(3,0) 0Γ—6βˆ’152<0 saddle point
(1,5) 50Γ—2βˆ’52>0 75 local min
Here is a sketch of some level curves of our f(x,y). f is negative in the shaded regions and f is positive in the unshaded regions.
Again this is not needed to answer this question, but can give you some idea as to what the graph of f looks like.

Example 2.9.19.

Find and classify all of the critical points of f(x,y)=x3+xy2βˆ’3x2βˆ’4y2+4.
Solution.
We know the drill now. We start by computing all of the partial derivatives of f up to order 2.
f=x3+xy2βˆ’3x2βˆ’4y2+4fx=3x2+y2βˆ’6xfxx=6xβˆ’6fxy=2yfy=2xyβˆ’8yfyy=2xβˆ’8fyx=2y
The critical points are then the solutions of fx=0, fy=0. That is
(E1)fx=3x2+y2βˆ’6x=0(E2)fy=2y(xβˆ’4)=0
The second equation, 2y(xβˆ’4)=0, is satisfied if and only if at least one of the two equations y=0 and x=4 is satisfied.
  • When y=0, equation (E1) forces x to obey
    0=3x2+02βˆ’6x=3x(xβˆ’2)
    so that x=0 or x=2.
  • When x=4, equation (E1) forces y to obey
    0=3Γ—42+y2βˆ’6Γ—4=24+y2
    which is impossible.
So, there are two critical points: (0,0), (2,0). Here is a table that classifies the critical points.
criticalpoint fxxfyyβˆ’fxy2 fxx type
(0,0) (βˆ’6)Γ—(βˆ’8)βˆ’02>0 βˆ’6<0 local max
(2,0) 6Γ—(βˆ’4)βˆ’02<0 saddle point

Example 2.9.20.

A manufacturer wishes to make an open rectangular box of given volume V using the least possible material. Find the design specifications.
Solution.
Denote by x, y and z, the length, width and height, respectively, of the box.
The box has two sides of area xz, two sides of area yz and a bottom of area xy. So the total surface area of material used is
S=2xz+2yz+xy
However the three dimensions x, y and z are not independent. The requirement that the box have volume V imposes the constraint
xyz=V
We can use this constraint to eliminate one variable. Since z is at the end of the alphabet (poor z), we eliminate z by substituting z=Vxy. So we have find the values of x and y that minimize the function
S(x,y)=2Vy+2Vx+xy
Let’s start by finding the critical points of S. Since
Sx(x,y)=βˆ’2Vx2+ySy(x,y)=βˆ’2Vy2+x
(x,y) is a critical point if and only if
(E1)x2y=2V(E2)xy2=2V
Solving (E1) for y gives y=2Vx2. Substituting this into (E2) gives
x4V2x4=2V⟹x3=2V⟹x=2V3andy=2V(2V)2/3=2V3
As there is only one critical point, we would expect it to give the minimum
 14 
Indeed one can use the facts that 0<x<∞, that 0<y<∞, and that Sβ†’βˆž as xβ†’0 and as yβ†’0 and as xβ†’βˆž and as yβ†’βˆž to prove that the single critical point gives the global minimum.
. 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
Sxx(x,y)=4Vx3Sxx(2V3,2V3)=2Sxy(x,y)=1Sxy(2V3,2V3)=1Syy(x,y)=4Vy3Syy(2V3,2V3)=2
So
Sxx(2V3,2V3) Syy(2V3,2V3)βˆ’Sxy(2V3,2V3)2=3>0Sxx(2V3,2V3)=2>0
and, by Theorem 2.9.16.b, (2V3,2V3) is a local minimum and the desired dimensions are
x=y=2V3z=V43
Note that our solution has x=y. That’s a good thing β€” the function S(x,y) is symmetric in x and y. Because the box has no top, the symmetry does not extend to z.

Subsection 2.9.3 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 
Recall that β€œextremal value” means β€œeither maximum value or minimum value”.
values of a function f(x) on the interval 0≀x≀1. If an extremal value is attained at some x=a which is in the interior of the interval, i.e. if 0<a<1, then a is also a local maximum or minimum and so has to be a critical point of f. But if an extremal value is attained at a boundary point a of the interval, i.e. if a=0 or a=1, then a need not be a critical point of f. This happens, for example, when f(x)=x. The largest value of f(x) on the interval 0≀x≀1 is 1 and is attained at x=1, but fβ€²(x)=1 is never zero, so that f has no critical points.
So to find the maximum and minimum of the function f(x) on the interval [0,1], you
  1. build up a list of all candidate points 0≀a≀1 at which the maximum or minimum could be attained, by finding all a’s for which either
    1. 0<a<1 and fβ€²(a)=0 or
    2. 0<a<1 and fβ€²(a) does not exist
       16 
      Recall that if fβ€²(a) does not exist, then a is called a singular point of f.
      or
    3. a is a boundary point, i.e. a=0 or a=1,
  2. and then you evaluate f(a) at each a on the list of candidates. The biggest of these candidate values of f(a) 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, f(x,y) in a set like, for example, the unit disk x2+y2≀1, is similar. You again
  1. build up a list of all candidate points (a,b) in the set at which the maximum or minimum could be attained, by finding all (a,b)’s for which either
     17 
    This is probably a good time to review the statement of Theorem 2.9.2.
    1. (a,b) is in the interior of the set (for our example, a2+b2<1) and fx(a,b)=fy(a,b)=0 or
    2. (a,b) is in the interior of the set and fx(a,b) or fy(a,b) does not exist or
    3. (a,b) is a boundary
       18 
      It should intuitively obvious from a sketch that the boundary of the disk x2+y2≀1 is the circle x2+y2=1. But if you really need a formal definition, here it is. A point (a,b) is on the boundary of a set S if there is a sequence of points in S that converges to (a,b) and there is also a sequence of points in the complement of S that converges to (a,b).
      point, (for our example, a2+b2=1), and could give the maximum or minimum on the boundary β€” more about this shortly β€”
  2. and then you evaluate f(a,b) at each (a,b) on the list of candidates. The biggest of these candidate values of f(a,b) is the absolute maximum and the smallest of these candidate values is the absolute minimum.
The boundary of a set, like x2+y2≀1, in R2 is a curve, like x2+y2=1. This curve is a one dimensional set, meaning that it is like a deformed x-axis. We can find the maximum and minimum of f(x,y) on this curve by converting f(x,y) into a function of one variable (on the curve) and using the standard function of one variable techniques. This is best explained by some examples.

Example 2.9.21.

Find the maximum and minimum of T(x,y)=(x+y)eβˆ’x2βˆ’y2 on the region defined by x2+y2≀1 (i.e. on the unit disk).
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 T takes its maximum or minimum value at a point in the interior, x2+y2<1, then that point must be either a critical point of T or a singular point of T. To find the critical points we compute the first order derivatives.
Tx(x,y)=(1βˆ’2x2βˆ’2xy)eβˆ’x2βˆ’y2Ty(x,y)=(1βˆ’2xyβˆ’2y2)eβˆ’x2βˆ’y2
Because the exponential eβˆ’x2βˆ’y2 is never zero, the critical points are the solutions of
Tx=0⟺2x(x+y)=1Ty=0⟺2y(x+y)=1
  • As both 2x(x+y) and 2y(x+y) are nonzero, we may divide the two equations, which gives xy=1, forcing x=y.
  • Substituting this into either equation gives 2x(2x)=1 so that x=y=Β±12.
So the only critical points are (12,12) and (βˆ’12,βˆ’12). Both are in x2+y2<1.
Singular points: In this problem, there are no singular points.
Boundary: Points on the boundary satisfy x2+y2=1. That is they lie on a circle. We may use the figure below to express x=cos⁑t and y=sin⁑t, in terms of the angle t. This will make the formula for T on the boundary quite a bit easier to deal with. On the boundary,
T=(cos⁑t+sin⁑t)eβˆ’cos2⁑tβˆ’sin2⁑t=(cos⁑t+sin⁑t)eβˆ’1
As all t’s are allowed, this function takes its max and min at zeroes of
dTdt=(βˆ’sin⁑t+cos⁑t)eβˆ’1
That is, (cos⁑t+sin⁑t)eβˆ’1 takes its max and min
  • when sin⁑t=cos⁑t,
  • that is, when x=y and x2+y2=1,
  • which forces x2+x2=1 and hence x=y=Β±12.
All together, we have the following candidates for max and min, with the max and min indicated.
point (12,12) (βˆ’12,βˆ’12) (12,12) (βˆ’12,βˆ’12)
value of T 1eβ‰ˆ0.61 βˆ’1e 2eβ‰ˆ0.52 βˆ’2e
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 f on the boundary of the region of interest by using the parametrization x=cos⁑t, y=sin⁑t of the circle x2+y2=1. Sometimes using this parametrization is not so clean. And worse, some curves don’t have such a simple parametrization. In the next problem we’ll look at the boundary a little differently.

Example 2.9.22.

Find the maximum and minimum values of f(x,y)=x3+xy2βˆ’3x2βˆ’4y2+4 on the disk x2+y2≀1.
Solution.
Again, we first find all critical points, then find all singular points and, finally, analyze the boundary.
Interior Critical Points: If f takes its maximum or minimum value at a point in the interior, x2+y2<1, then that point must be either a critical point of f or a singular point of f. To find the critical points
 19 
We actually found the critical points in Example 2.9.19. But, for the convenience of the reader, we’ll repeat that here.
we compute the first order derivatives.
fx=3x2+y2βˆ’6xfy=2xyβˆ’8y
The critical points are the solutions of
(E1)fx=3x2+y2βˆ’6x=0(E2)fy=2y(xβˆ’4)=0
The second equation, 2y(xβˆ’4)=0, is satisfied if and only if at least one of the two equations y=0 and x=4 is satisfied.
  • When y=0, equation (E1) forces x to obey
    0=3x2+02βˆ’6x=3x(xβˆ’2)
    so that x=0 or x=2.
  • When x=4, equation (E1) forces y to obey
    0=3Γ—42+y2βˆ’6Γ—4=24+y2
    which is impossible.
So, there are only two critical points: (0,0), (2,0).
Singular points: In this problem, there are no singular points.
Boundary: On the boundary, x2+y2=1, we could again take advantage of having a circle and write x=cos⁑t and y=sin⁑t. But, for practice, we’ll use another method
 20 
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.
. We know that (x,y) satisfies x2+y2=1, and hence y2=1βˆ’x2. Examining the formula for f(x,y), we see that it contains only even
 21 
If it contained odd powers too, we could consider the cases yβ‰₯0 and y≀0 separately and substitute y=1βˆ’x2 in the former case and y=βˆ’1βˆ’x2 in the latter case.
powers of y, so we can eliminate y by substituting y2=1βˆ’x2 into the formula.
f=x3+x(1βˆ’x2)βˆ’3x2βˆ’4(1βˆ’x2)+4=x+x2
The max and min of x+x2 for βˆ’1≀x≀1 must occur either
  • when x=βˆ’1 (β‡’y=f=0) or
  • when x=+1 (β‡’y=0, f=2) or
  • when 0=ddx(x+x2)=1+2x (β‡’x=βˆ’12, y=Β±34, f=βˆ’14).
Here is a sketch showing all of the points that we have identified.
Note that the point (2,0) is outside the allowed region
 22 
We found (2,0) 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 x2+y2≀1.
. So all together, we have the following candidates for max and min, with the max and min indicated.
point (0,0) (βˆ’1,0) (1,0) (βˆ’12,Β±32)
value of f 4 0 2 βˆ’14
max min

Example 2.9.23.

Find the maximum and minimum values of f(x,y)=xyβˆ’x3y2 when (x,y) runs over the square 0≀x≀1, 0≀y≀1.
Solution.
As usual, let’s examine the critical points, singular points and boundary in turn.
Interior Critical Points: If f takes its maximum or minimum value at a point in the interior, 0<x<1, 0<y<1, then that point must be either a critical point of f or a singular point of f. To find the critical points we compute the first order derivatives.
fx(x,y)=yβˆ’3x2y2fy(x,y)=xβˆ’2x3y
The critical points are the solutions of
fx=0⟺y(1βˆ’3x2y)=0⟺y=0  or  3x2y=1fy=0⟺x(1βˆ’2x2y)=0⟺x=0  or  2x2y=1
  • If y=0, we cannot have 2x2y=1, so we must have x=0.
  • If 3x2y=1, we cannot have x=0, so we must have 2x2y=1. Dividing gives 1=3x2y2x2y=32 which is impossible.
So the only critical point in the square is (0,0). There f=0.
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 x=0. On that entire side f=0.
  • Next, we look at the part of the boundary with y=0. On that entire side f=0.
  • Next, we look at the part of the boundary with y=1. There f=f(x,1)=xβˆ’x3. To find the maximum and minimum of f(x,y) on the part of the boundary with y=1, we must find the maximum and minimum of xβˆ’x3 when 0≀x≀1.
    Recall that, in general, the maximum and minimum of a function h(x) on the interval a≀x≀b, must occur either at x=a or at x=b or at an x for which either hβ€²(x)=0 or hβ€²(x) does not exist. In this case, ddx(xβˆ’x3)=1βˆ’3x2, so the max and min of xβˆ’x3 for 0≀x≀1 must occur
    • either at x=0, where f=0,
    • or at x=13, where f=233,
    • or at x=1, where f=0.
  • Finally, we look at the part of the boundary with x=1. There f=f(1,y)=yβˆ’y2. As ddy(yβˆ’y2)=1βˆ’2y, the only critical point of yβˆ’y2 is at y=12. So the max and min of yβˆ’y2 for 0≀y≀1 must occur
    • either at y=0, where f=0,
    • or at y=12, where f=14,
    • or at y=1, where f=0.
All together, we have the following candidates for max and min, with the max and min indicated.
point (0,0) (0,0≀y≀1) (0≀x≀1,0) (1,0) (1,12) (1,1) (0,1) (13,1)
value of f 0 0 0 0 14 0 0 233β‰ˆ0.385
min min min min min min max

Example 2.9.24.

Find the maximum and minimum values of f(x,y)=xy+2x+y when (x,y) runs over the triangular region with vertices (0,0), (1,0) and (0,2). The triangular region is sketched in
Solution.
As usual, let’s examine the critical points, singular points and boundary in turn.
Interior Critical Points: If f takes its maximum or minimum value at a point in the interior, then that point must be either a critical point of f or a singular point of f. The critical points are the solutions of
fx(x,y)=y+2=0fy(x,y)=x+1=0
So there is exactly one critical point, namely (βˆ’1,βˆ’2). This is well outside the triangle and so is not a candidate for the location of the max and min.
Singular points: Yet again there are no singular points for this f.
Boundary: The region is a triangle, so its boundary consists of its three sides.
  • First, we look at the side that runs from (0,0) to (0,2). On that entire side x=0, so that f(0,y)=y. The smallest value of f on that side is f=0 at (0,0) and the largest value of f on that side is f=2 at (0,2).
  • Next, we look at the side that runs from (0,0) to (1,0). On that entire side y=0, so that f(x,0)=2x. The smallest value of f on that side is f=0 at (0,0) and the largest value of f on that side is f=2 at (1,0).
  • Finally, we look at the side that runs from (0,2) to (1,0). Or first job is to find the equation of the line that contains (0,2) and (1,0). 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 xy-plane
       23 
      To be picky, any line the xy-plane that is not parallel to the y axis.
      has equation y=mx+b where b is the y intercept and m is the slope. In this case, the line crosses the y axis at y=2 and so has y intercept b=2. The line passes through (0,2) and (1,0) and so, as we see in the figure below, has slope m=Ξ”yΞ”x=0βˆ’21βˆ’0=βˆ’2. Thus the side of the triangle that runs from (0,2) to (1,0) is y=2βˆ’2x with 0≀x≀1.
    • Method 2: Every line in the xy-plane has an equation of the form ax+by=c. In this case (0,0) is not on the line so that cβ‰ 0 and we can divide the equation by c, giving acx+bcy=1. Rename ac=A and bc=B. Thus, because the line does not pass through the origin, it has an equation of the form Ax+By=1, for some constants A and B. In order for (0,2) to lie on the line, x=0, y=2 has to be a solution of Ax+By=1. That is, Ax|x=0+By|y=2=1, so that B=12. In order for (1,0) to lie on the line, x=1, y=0 has to be a solution of Ax+By=1. That is Ax|x=1+By|y=0=1, so that A=1. Thus the line has equation x+12y=1, or equivalently, y=2βˆ’2x.
    • Method 3: The vector from (0,2) to (1,0) is ⟨1βˆ’0,0βˆ’2⟩=⟨1,βˆ’2⟩. As we see from the figure above, it is a direction vector for the line. One point on the line is (0,2). So a parametric equation for the line (see Equation 1.3.1) is
      ⟨xβˆ’0,yβˆ’2⟩=t⟨1,βˆ’2⟩orx=t, y=2βˆ’2t
    By any of these three methods
     24 
    In the third method, x has just be renamed to t.
    , we have that the side of the triangle that runs from (0,2) to (1,0) is y=2βˆ’2x with 0≀x≀1. On that side of the triangle
    f(x,2βˆ’2x)=x(2βˆ’2x)+2x+(2βˆ’2x)=βˆ’2x2+2x+2
    Write g(x)=βˆ’2x2+2x+2. The maximum and minimum of g(x) for 0≀x≀1, and hence the maximum and minimum values of f on the hypotenuse of the triangle, must be achieved either at
    • x=0, where f(0,2)=g(0)=2, or at
    • x=1, where f(1,0)=g(1)=2, or when
    • 0=gβ€²(x)=βˆ’4x+2 so that x=12, y=2βˆ’22=1 and
      f(12,1)=g(12)=βˆ’24+22+2=52
All together, we have the following candidates for max and min, with the max and min indicated.
point (0,0) (0,2) (1,0) (12,1)
value of f 0 2 2 52
min max

Example 2.9.25.

Find the high and low points of the surface  z=x2+y2  with (x,y) varying over the square  |x|≀1, |y|≀1 .
Solution.
The function  f(x,y)=x2+y2  has a particularly simple geometric interpretation β€” it is the distance from the point (x,y) to the origin. So
  • the minimum of f(x,y) is achieved at the point in the square that is nearest the origin β€” namely the origin itself. So (0,0,0) is the lowest point on the surface and is at height 0.
  • The maximum of f(x,y) is achieved at the points in the square that are farthest from the origin β€” namely the four corners of the square (Β±1,Β±1). At those four points z=2. So the highest points on the surface are (Β±1,Β±1,2).
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 f(x,y)=x2+y2 are defined for (x,y)β‰ (0,0) and are
fx(x,y)=xx2+y2fy(x,y)=yx2+y2
  • There are no critical points because
    • fx=0 only for x=0, and
    • fy=0 only for y=0, but
    • (0,0) is not a critical point because fx and fy are not defined there.
  • There is one singular point β€” namely (0,0). The minimum value of f is achieved at the singular point.
  • The boundary of the square consists of its four sides. One side is
    { (x,y) | x=1, βˆ’1≀y≀1 }
    On this side f=1+y2. As 1+y2 increases with |y|, the smallest value of f on that side is 1 (when y=0) and the largest value of f is 2 (when y=Β±1). The same thing happens on the other three sides. The maximum value of f is achieved at the four corners. Note that fx and fy are both nonzero at all four corners.

Exercises 2.9.4 Exercises

Exercise Group.

Exercises β€” Stage 1
1. (✳).
  1. Some level curves of a function f(x,y) are plotted in the xy–plane below.
    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 y–axis”, you would circle both P and U, but none of the other letters. You may assume that a local maximum occurs at point T.
    (i) βˆ‡βˆ‡f is zeroP Q R S T U(ii) f has a saddle pointP Q R S T U(iii)  the partial derivative fy is positiveP Q R S T U(iv)  the directional derivative of f in theP Q R S T U direction βŸ¨0,βˆ’1⟩ is negative
  2. The diagram below shows three β€œy traces” of a graph z=F(x,y) plotted on xz–axes. (Namely the intersections of the surface z=F(x,y) with the three planes (y=1.9, y=2, y=2.1). For each statement below, circle the correct word.
    (i)  the first order partial derivative Fx(1,2) ispositive/negative/zero(ii) F has a critical point at (2,2)true/false(iii)  the second order partial derivative Fxy(1,2) ispositive/negative/zero
2.
Find the high and low points of the surface  z=x2+y2  with (x,y) varying over the square  |x|≀1, |y|≀1 . Discuss the values of  zx, zy  there. Do not evaluate any derivatives in answering this question.
3.
If t0 is a local minimum or maximum of the smooth function  f(t)  of one variable (t runs over all real numbers) then  fβ€²(t0)=0. Derive an analogous necessary condition for x0 to be a local minimum or maximium of the smooth function  g(x)  restricted to points on the line  x=a+td . The test should involve the gradient of g(x).

Exercise Group.

Exercises β€” Stage 2
4. (✳).
Let z=f(x,y)=(y2βˆ’x2)2.
  1. Make a reasonably accurate sketch of the level curves in the xy–plane of z=f(x,y) for z=0, 1 and 16. Be sure to show the units on the coordinate axes.
  2. Verify that (0,0) is a critical point for z=f(x,y), and determine from part (a) or directly from the formula for f(x,y) whether (0,0) is a local minimum, a local maximum or a saddle point.
  3. Can you use the Second Derivative Test to determine whether the critical point (0,0) is a local minimum, a local maximum or a saddle point? Give reasons for your answer.
5. (✳).
Use the Second Derivative Test to find all values of the constant c for which the function z=x2+cxy+y2 has a saddle point at (0,0).
6. (✳).
Find and classify all critical points of the function
f(x,y)=x3βˆ’y3βˆ’2xy+6.
7. (✳).
Find all critical points for f(x,y)=x(x2+xy+y2βˆ’9). Also find out which of these points give local maximum values for f(x,y), which give local minimum values, and which give saddle points.
8. (✳).
Find the largest and smallest values of x2y2z in the part of the plane 2x+y+z=5 where xβ‰₯0, yβ‰₯0 and zβ‰₯0. Also find all points where those extreme values occur.
9.
Find and classify all the critical points of f(x,y)=x2+y2+x2y+4.
10. (✳).
Find all saddle points, local minima and local maxima of the function
f(x,y)=x3+x2βˆ’2xy+y2βˆ’x.
11. (✳).
For the surface
z=f(x,y)=x3+xy2βˆ’3x2βˆ’4y2+4
Find and classify [as local maxima, local minima, or saddle points] all critical points of f(x,y).
12.
Find the maximum and minimum values of f(x,y)=xyβˆ’x3y2 when (x,y) runs over the square 0≀x≀1, 0≀y≀1.
13.
The temperature at all points in the disc x2+y2≀1 is given by T(x,y)=(x+y)eβˆ’x2βˆ’y2. Find the maximum and minimum temperatures at points of the disc.
14. (✳).
The images below depict level sets f(x,y)=c of the functions in the list at heights c=0,0.1,0.2,…,1.9,2. 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.)
  1. f(x,y)=(x2+y2βˆ’1)(xβˆ’y)+1
  2. f(x,y)=x2+y2
  3. f(x,y)=y(x+y)(xβˆ’y)+1
  4. f(x,y)=x2+y2
15. (✳).
Let the function
f(x,y)=x3+3xy+3y2βˆ’6xβˆ’3yβˆ’6
Classify as [local maxima, minima or saddle points] all critical points of f(x,y).
16. (✳).
Let h(x,y)=y(4βˆ’x2βˆ’y2).
  1. Find and classify the critical points of h(x,y) as local maxima, local minima or saddle points.
  2. Find the maximum and minimum values of h(x,y) on the disk x2+y2≀1.
17. (✳).
Find the absolute maximum and minimum values of the function f(x,y)=5+2xβˆ’x2βˆ’4y2 on the rectangular region
R={ (x,y) | βˆ’1≀x≀3, βˆ’1≀y≀1 }
18. (✳).
Find the minimum of the function h(x,y)=βˆ’4xβˆ’2y+6 on the closed bounded domain defined by x2+y2≀1.
19. (✳).
Let f(x,y)=xy(x+yβˆ’3).
  1. Find all critical points of f, and classify each one as a local maximum, a local minimum, or saddle point.
  2. Find the location and value of the absolute maximum and minimum of f on the triangular region xβ‰₯0, yβ‰₯0, x+y≀8.
20. (✳).
Find and classify the critical points of f(x,y)=3x2y+y3βˆ’3x2βˆ’3y2+4.
21. (✳).
Consider the function
f(x,y)=2x3βˆ’6xy+y2+4y
  1. Find and classify all of the critical points of f(x,y).
  2. Find the maximum and minimum values of f(x,y) in the triangle with vertices (1,0), (0,1) and (1,1).
22. (✳).
Find all critical points of the function f(x,y)=x4+y4βˆ’4xy+2, and for each determine whether it is a local minimum, maximum or saddle point.
23. (✳).
f(x,y)=xy(x+2yβˆ’6)
  1. Find every critical point of f(x,y) and classify each one.
  2. Let D be the region in the plane between the hyperbola xy=4 and the line x+2yβˆ’6=0. Find the maximum and minimum values of f(x,y) on D.
24. (✳).
Find all the critical points of the function
f(x,y)=x4+y4βˆ’4xy
defined in the xy-plane. Classify each critical point as a local minimum, maximum or saddle point.
25. (✳).
A metal plate is in the form of a semi-circular disc bounded by the x-axis and the upper half of x2+y2=4. The temperature at the point (x,y) is given by T(x,y)=ln⁑(1+x2+y2)βˆ’y. Find the coldest point on the plate, explaining your steps carefully. (Note: ln⁑2β‰ˆ0.693, ln⁑5β‰ˆ1.609)
26. (✳).
Find all the critical points of the function
f(x,y)=x3+xy2βˆ’x
defined in the xy-plane. Classify each critical point as a local minimum, maximum or saddle point. Explain your reasoning.
27. (✳).
Consider the function g(x,y)=x2βˆ’10yβˆ’y2.
  1. Find and classify all critical points of g.
  2. Find the absolute extrema of g on the bounded region given by
    x2+4y2≀16, y≀0
29. (✳).
Find the maximum value of
f(x,y)=xyeβˆ’(x2+y2)/2
on the quarter-circle D={ (x,y) | x2+y2≀4, xβ‰₯0, yβ‰₯0 }.
30.
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?
31.
Find the most economical shape of a rectangular box that has a fixed volume V and that has no top.

Exercise Group.

Exercises β€” Stage 3
32. (✳).
The temperature T(x,y) at a point of the xy--plane is given by
T(x,y)=20βˆ’4x2βˆ’y2
  1. Find the maximum and minimum values of T(x,y) on the disk D defined by x2+y2≀4.
  2. Suppose an ant lives on the disk D. If the ant is initially at point (1,1), in which direction should it move so as to increase its temperature as quickly as possible?
  3. Suppose that the ant moves at a velocity v=βŸ¨βˆ’2,βˆ’1⟩. What is its rate of increase of temperature as it passes through (1,1)?
  4. Suppose the ant is constrained to stay on the curve y=2βˆ’x2. Where should the ant go if it wants to be as warm as possible?
33. (✳).
Consider the function
f(x,y)=3kx2y+y3βˆ’3x2βˆ’3y2+4
where k>0 is a constant. Find and classify all critical points of f(x,y) as local minima, local maxima, saddle points or points of indeterminate type. Carefully distinguish the cases k<12, k=12 and k>12.
34. (✳).
  1. Show that the function f(x,y)=2x+4y+1xy has exactly one critical point in the first quadrant x>0, y>0, and find its value at that point.
  2. Use the second derivative test to classify the critical point in part (a).
  3. Hence explain why the inequality 2x+4y+1xyβ‰₯6 is valid for all positive real numbers x and y.
35.
An experiment yields data points  (xi,yi), i=1,2,β‹―,n. We wish to find the straight line  y=mx+b  which β€œbest” fits the data. The definition of β€œbest” is β€œminimizes the root mean square error”, i.e. minimizes  βˆ‘i=1n(mxi+bβˆ’yi)2. Find m and b.