Chapter 4: Differentiation of Functions of Several Variables
4.7 Maxima and Minima Problems
Study guide for Calculus Volume 3 (Gilbert Strang, 2016 edition)
Independent study guide. Not affiliated with OpenStax or Rice University.
Big idea
Optimization was one of the payoffs of one-variable calculus, and the structure of the argument carries over intact. At an interior high point or low point the surface must be level, so both partials vanish, and those points are the only interior candidates. Finding them is a matter of solving two equations at once rather than one, which is the main new difficulty and usually the longest part of the work.
Classifying them is where the plane is genuinely different from the line. On a line a critical point could be a maximum, a minimum, or a rare flat inflection. On a surface there is a common new possibility: the point can be a minimum along one direction and a maximum along another, a saddle. Since a saddle has both partials zero, no amount of checking along the axes distinguishes it from an extremum, and a test that sees only $f_{xx}$ and $f_{yy}$ would call the saddle $z = x^2 - y^2$ inconclusive at best and wrong at worst.
The fix is the discriminant, a combination of all three second partials, $D = f_{xx}f_{yy} - (f_{xy})^2$. The mixed term is what detects twisting along the diagonals. When $D > 0$ the surface curves the same way in every direction and the sign of $f_{xx}$ tells you which, giving a local minimum or maximum. When $D < 0$ the curvature disagrees between directions and you have a saddle. When $D = 0$ the test says nothing, and you go back to examining the function directly.
Absolute extrema over a closed bounded region work the way they did on a closed interval, with one upgrade. There, you checked the interior critical points and the two endpoints. Here the boundary is a curve rather than two points, so checking it is a one-variable optimization problem in its own right, repeated once for each piece of the boundary, plus the corners where the pieces meet. Nothing can be skipped: a continuous function on a closed bounded region does attain its extreme values, but they are as likely to sit on the edge as in the middle.
Decoder
At a critical point where both partials vanish, let $D = f_{xx}f_{yy} - (f_{xy})^2$ evaluated at that point. A positive $D$ means a local extremum, a maximum if $f_{xx} < 0$ and a minimum if $f_{xx} > 0$; a negative $D$ means a saddle; and $D = 0$ decides nothing.
The subtraction is the whole test. The product $f_{xx}f_{yy}$ measures agreement between the two axis curvatures, and $(f_{xy})^2$ measures how much the surface twists. If the twist outweighs the agreement, some diagonal direction curves the opposite way from the axes and the point is a saddle. Since $(f_{xy})^2$ is never negative, a saddle can appear even when $f_{xx}$ and $f_{yy}$ are both positive.
Notice that when $D > 0$ the factors $f_{xx}$ and $f_{yy}$ must share a sign, so it does not matter which of the two you inspect. Use whichever is easier to evaluate.
The inconclusive case is real and not a formality. Both $f = x^4 + y^4$ and $f = x^4 - y^4$ give $D = 0$ at the origin, and the first has a strict minimum there while the second has a saddle. When $D = 0$, argue directly: look at the sign of $f - f(a,b)$ along a few paths through the point, and if two paths give opposite signs you have a saddle.
Definitions and results
Local extremum. $f$ has a local maximum at $(a,b)$ if $f(x,y) \le f(a,b)$ for all $(x,y)$ in some disk around $(a,b)$, and a local minimum if the inequality runs the other way.
Critical point. A point $(a,b)$ in the domain where $f_x(a,b) = 0$ and $f_y(a,b) = 0$, or where one of the partials fails to exist. Both conditions must be checked; a point where only $f_x$ vanishes is not a candidate.
Necessary condition. If $f$ has a local extremum at an interior point $(a,b)$ and both partials exist there, then $(a,b)$ is a critical point. The converse is false, which is the reason the second-derivative test exists.
Saddle point. A critical point that is not a local extremum: every disk around it contains points with larger values and points with smaller values.
Discriminant. With all second partials continuous near a critical point $(a,b)$, set
$$ D = f_{xx}(a,b)\, f_{yy}(a,b) - \big[f_{xy}(a,b)\big]^2 $$
Second-derivative test. If $D > 0$ and $f_{xx}(a,b) > 0$, there is a local minimum. If $D > 0$ and $f_{xx}(a,b) < 0$, there is a local maximum. If $D < 0$, there is a saddle point. If $D = 0$, the test gives no information.
Closed and bounded regions. A region is closed if it contains its boundary and bounded if it fits inside some disk. A function continuous on such a region attains both an absolute maximum and an absolute minimum somewhere on it.
Procedure for absolute extrema. Find the critical points in the interior and evaluate $f$ at each. Then optimize $f$ along each boundary piece by substituting the boundary’s equation to get a one-variable problem, and evaluate $f$ at the corners. The largest and smallest numbers in the resulting list are the absolute extrema.
Worked examples
A single critical point by completing the square
Classify the critical points of $f(x,y) = x^2 + y^2 - 4x + 6y + 5$.
Set the partials to zero: $f_x = 2x - 4 = 0$ gives $x = 2$, and $f_y = 2y + 6 = 0$ gives $y = -3$. The only critical point is $(2,-3)$, where $f = 4 + 9 - 8 - 18 + 5 = -8$.
Second partials are constant: $f_{xx} = 2$, $f_{yy} = 2$, $f_{xy} = 0$, so $D = 4 - 0 = 4 > 0$ and $f_{xx} > 0$. The point is a local minimum with value $-8$.
Check by completing the square: $f = (x-2)^2 + (y+3)^2 - 8$. Since squares are nonnegative, $f \ge -8$ everywhere with equality only at $(2,-3)$. The minimum is in fact global, which the second-derivative test alone never claims.
A saddle and a minimum together
Classify the critical points of $f(x,y) = x^3 - 3xy + y^3$.
The partials give the system $f_x = 3x^2 - 3y = 0$ and $f_y = -3x + 3y^2 = 0$, that is $y = x^2$ and $x = y^2$. Substituting the first into the second gives $x = x^4$, so $x(x^3 - 1) = 0$ and $x = 0$ or $x = 1$. The critical points are $(0,0)$ and $(1,1)$.
The second partials are $f_{xx} = 6x$, $f_{yy} = 6y$, $f_{xy} = -3$, so
$$ D = 36xy - 9 $$
At $(0,0)$, $D = -9 < 0$, a saddle point. At $(1,1)$, $D = 36 - 9 = 27 > 0$ and $f_{xx} = 6 > 0$, so a local minimum, with value $f(1,1) = 1 - 3 + 1 = -1$.
Confirm the saddle by hand. Along the $x$-axis, $f = x^3$, which is positive to the right of the origin and negative to the left, so both signs occur arbitrarily close to $(0,0)$ where $f = 0$. That is exactly what a saddle requires. Note also that this function has no absolute extrema: $f(t,t) = 2t^3 - 3t^2$ runs off to both infinities.
When the discriminant fails
For $f(x,y) = x^4 + y^4$, the partials $4x^3$ and $4y^3$ vanish only at the origin. All second partials are $f_{xx} = 12x^2$, $f_{yy} = 12y^2$, $f_{xy} = 0$, which are all zero at the origin, so $D = 0$ and the test is silent.
Direct inspection settles it: $x^4 + y^4 \ge 0$ with equality only at the origin, so there is a strict global minimum of $0$ there.
Now change one sign and take $g(x,y) = x^4 - y^4$. Again the only critical point is the origin and again $D = 0$. But $g(x, 0) = x^4 > 0$ for $x \ne 0$ while $g(0,y) = -y^4 < 0$ for $y \ne 0$, so both signs appear in every disk around the origin and the point is a saddle. Same discriminant, opposite conclusions, which is why $D = 0$ has to be treated as no information rather than as a hint.
Absolute extrema on a square
Find the absolute maximum and minimum of $f(x,y) = x^2 + y^2 - 2x - 4y$ on the square $0 \le x \le 3$, $0 \le y \le 3$.
Interior first. Setting $f_x = 2x - 2 = 0$ and $f_y = 2y - 4 = 0$ gives $(1,2)$, which is inside the square, and $f(1,2) = 1 + 4 - 2 - 8 = -5$.
Now the four edges, each a one-variable problem.
On $y = 0$: $f = x^2 - 2x$, with derivative $2x - 2$ zero at $x = 1$, giving $-1$. Endpoint values are $f(0,0) = 0$ and $f(3,0) = 3$.
On $y = 3$: $f = x^2 - 2x - 3$, minimized at $x = 1$ with value $-4$. Endpoints give $f(0,3) = -3$ and $f(3,3) = 0$.
On $x = 0$: $f = y^2 - 4y$, minimized at $y = 2$ with value $-4$. Endpoints are already listed.
On $x = 3$: $f = y^2 - 4y + 3$, minimized at $y = 2$ with value $-1$. Endpoints are already listed.
Collecting every value: $-5, -1, 0, 3, -4, -3, 0, -4, -1$. The absolute maximum is $3$ at the corner $(3,0)$ and the absolute minimum is $-5$ at the interior point $(1,2)$.
Check by completing the square: $f = (x-1)^2 + (y-2)^2 - 5$. So $f$ measures squared distance from $(1,2)$, shifted down by $5$. The minimum is at the center, value $-5$, and the maximum is at whichever corner is farthest from $(1,2)$. Squared distances to the corners are $5$, $8$, $2$ and $5$, so the winner is $(3,0)$ with $8 - 5 = 3$. The two routes agree.
Practice
Start by locating candidates. These ask you to solve the pair of equations $f_x = 0$ and $f_y = 0$ and report every critical point, including the cases where the system has several solutions.
Practice
Generated problems for this section, graded instantly.
Next, classify. Compute the three second partials, form the discriminant, and name each point a maximum, a minimum, or a saddle, treating $D = 0$ as a signal to look at the function directly.
Practice
Generated problems for this section, graded instantly.
Last, the global problem on a region. Interior candidates, then each boundary piece as a one-variable optimization, then the corners, then compare the whole list.
Practice
Generated problems for this section, graded instantly.
Quiz
Six items across critical points, the second-derivative test, saddle points, and absolute extrema on closed bounded regions.
Quiz
6 problems with a score at the end.