Calculus › Section N · Functions of several variables › Topic N.8
Extrema of functions of two variables
One-variable calculus hunts peaks and valleys with a sign chart. Surfaces have peaks, valleys and a third kind of point, the saddle, and a single discriminant sorts all three.
Peaks, valleys and saddles
For a function of one variable, relative maxima and minima sit where \(f'\) changes sign, and a sign chart sorts them out. A function \(f(x, y)\) of two variables also has relative maxima and minima, but it has something new as well: points that are a maximum in one direction and a minimum in another, like the middle of a horse's saddle. Before you can optimise anything in several variables, you need a way to find these points and tell them apart.
Relative extrema, defined
The function \(f\) has a relative minimum at \((a, b)\) if \(f(a, b) \le f(x, y)\) for every \((x, y)\) in some disk centred at \((a, b)\). A relative maximum reverses the inequality to \(\ge\). The disk is an open region: the comparison is against all nearby points, in every direction of the plane, not just left and right as in one variable. At a relative minimum the surface is the lowest point of some small bowl-shaped neighbourhood; at a relative maximum, the highest point of a small dome.
Critical points: where extrema can hide
Suppose \(f\) has a relative extremum at \((a, b)\) and both partial derivatives exist there. Slicing with the plane \(y = b\) leaves a one-variable function with an extremum at \(a\), so \(f_x(a, b) = 0\); slicing the other way gives \(f_y(a, b) = 0\). Geometrically, the tangent plane at a smooth extremum is horizontal. A critical point of \(f\) is a point where both partials are zero, or where at least one of them fails to exist. Every relative extremum is a critical point, so critical points are the complete list of candidates. For example, \(f(x, y) = \sqrt{x^2 + y^2}\) has a minimum at \((0, 0)\) even though its partials do not exist there.
Worked example: hunting critical points
Find all critical points of \(f(x, y) = x^3 + y^3 - 3x - 3y\). Set each partial to zero: \(f_x = 3x^2 - 3 = 3(x - 1)(x + 1)\) vanishes at \(x = 1\) and \(x = -1\), and independently \(f_y = 3y^2 - 3\) vanishes at \(y = 1\) and \(y = -1\). Every combination is a critical point, so there are four: \((1, 1)\), \((1, -1)\), \((-1, 1)\) and \((-1, -1)\). The function values there are \(-4\), \(0\), \(0\) and \(4\). But nothing yet says which are peaks, which are valleys and which are saddles. For that you need the second derivatives.
The second partials test
Assume the second partials of \(f\) are continuous near the critical point \((a, b)\). Compute
If \(d > 0\) and \(f_{xx} > 0\), the surface opens upward there and \(f(a, b)\) is a relative minimum. If \(d > 0\) and \(f_{xx} < 0\), it is a relative maximum. If \(d < 0\), the point is a saddle. If \(d = 0\), the test is silent: the point could be any of the three, and you must investigate it directly. When \(d > 0\) the two second partials must share a sign, so checking \(f_{xx}\) alone is enough to distinguish min from max.
Worked example: classifying the four points
For \(f(x, y) = x^3 + y^3 - 3x - 3y\), the second partials are \(f_{xx} = 6x\), \(f_{yy} = 6y\) and \(f_{xy} = 0\), so \(d = 36xy\). At \((1, 1)\): \(d = 36 > 0\) and \(f_{xx} = 6 > 0\), a relative minimum with \(f(1, 1) = -4\). At \((-1, -1)\): \(d = 36 > 0\) and \(f_{xx} = -6 < 0\), a relative maximum with value \(4\). At \((1, -1)\) and \((-1, 1)\): \(d = -36 < 0\), so both are saddle points. As a check on the minimum, slice the surface with the plane \(y = x\): the function becomes \(g(x) = 2x^3 - 6x\), and \(g''(1) = 12 > 0\) confirms the curve dips through the point.
Saddle points
A saddle point is a critical point that is not a relative extremum. The classic example is \(z = y^2 - x^2\) at the origin. Sliced with the x-axis \((y = 0)\) it becomes \(z = -x^2\), a downward parabola, so the origin is a maximum in that direction. Sliced with the y-axis it becomes \(z = y^2\), an upward parabola, so the origin is a minimum in that direction. The discriminant catches this: \(f_{xx} = -2\), \(f_{yy} = 2\) and \(f_{xy} = 0\) give \(d = -4 < 0\). Whenever \(d < 0\) the surface bends upward along some direction and downward along another.
Absolute extrema on a closed region
The extreme value theorem has a two-variable version: a continuous function on a closed, bounded region attains an absolute maximum and an absolute minimum somewhere on the region. Finding them takes two sweeps. First, find the critical points in the interior of the region and record their values. Second, restrict the function to the boundary. Each edge of a polygonal boundary is a one-variable problem: substitute the edge's equation, then optimise on that interval as in one-variable calculus. The corners count too. The absolute extrema are simply the largest and smallest of all the recorded values.
Worked example: scanning a square
Find the absolute extrema of \(f(x, y) = x^2 + y^2 - 4x - 2y\) on the square \(0 \le x \le 4\), \(0 \le y \le 4\). Interior: \(2x - 4 = 0\) gives \(x = 2\) and \(2y - 2 = 0\) gives \(y = 1\); the point \((2, 1)\) is inside, and \(f(2, 1) = -5\). Edges: on \(y = 0\) the function is \(x^2 - 4x\), minimum \(-4\) at \((2, 0)\). On \(y = 4\) it is \(x^2 - 4x + 8\), minimum \(4\). On \(x = 0\) and on \(x = 4\) it is \(y^2 - 2y\), minimum \(-1\) at \((0, 1)\) and \((4, 1)\). Corners: \(f(0, 0) = 0\), \(f(4, 0) = 0\), \(f(0, 4) = 8\), \(f(4, 4) = 8\). The absolute minimum is \(-5\) at the interior point \((2, 1)\), and the absolute maximum is \(8\), attained at two corners.
Common mistakes to avoid
The biggest misconception is that every critical point must be a peak or a valley; saddles are just as common, and the discriminant exists precisely to catch them. Second, when \(d > 0\) you must still check the sign of \(f_{xx}\) to tell a minimum from a maximum; \(d\) being positive says only that an extremum exists. Third, \(d\) subtracts the square of the mixed partial: writing \(f_{xx} f_{yy} + f_{xy}^2\) breaks the test. Fourth, \(d = 0\) does not mean "no extremum"; it means the test is inconclusive. Finally, in a closed-region problem, skipping the boundary sweep or the corners is the most common way to miss the true maximum.
Key takeaways
Relative extrema of \(f(x, y)\) compare values over a whole disk around the point, and can occur only at critical points, where both partials are zero or one fails to exist. The second partials test computes \(d = f_{xx} f_{yy} - (f_{xy})^2\): \(d > 0\) gives a minimum when \(f_{xx} > 0\) and a maximum when \(f_{xx} < 0\); \(d < 0\) gives a saddle point; \(d = 0\) says nothing. On a closed, bounded region, a continuous function attains absolute extrema, found by sweeping interior critical points and then the boundary, edges and corners included.
Flashcards
Flashcard
f(a, b) ≤ f(x, y) for all (x, y) in some disk centred at (a, b)
Test your understanding
Question 1 of 5
The point (0, 0) is a critical point of f(x, y) = y² - x². What does the second partials test conclude?
Question 2 of 5
Where does the relative minimum of f(x, y) = x² + y² - 2x - 4y + 5 occur?
Question 3 of 5
At a critical point, fxx = 2, fyy = 6 and fxy = 4. What does the second partials test conclude?
Question 4 of 5
A continuous function on a closed, bounded region attains an absolute maximum. Where do you look for candidates?
Question 5 of 5
f(x, y) = x³ + y³ - 3x - 3y has critical points (1, 1), (1, -1), (-1, 1) and (-1, -1). Which one is a relative maximum?
Standards: Beyond AP
