Multivariable Calculus · Undergraduate

Maxima, Minima and Saddle Points

Quick answer

At a local maximum or minimum of a smooth function of two variables both partial derivatives are zero, so extremes lie among the critical points, where ∇f = 0. At a saddle point, though, the surface rises one way and falls another. The second derivative test sorts them with D = f_xx f_yy − f_xy²: D > 0 gives a minimum or maximum depending on the sign of f_xx, and D < 0 gives a saddle. On a closed, bounded region the absolute extremes also have to be sought on the boundary.

What you'll learn

  • Find the critical points of a function of two variables
  • Classify critical points with the second derivative test
  • Recognize saddle points
  • Find absolute extremes on a closed, bounded region

Where the surface levels out

At the top of a smooth hill, every slice through the summit also has a top there, so its slope is zero. In particular the slices in the xx and yy directions level out, and both partial derivatives vanish. Points where

∇f=0,that is,fx=0 and fy=0\nabla f = \mathbf{0}, \quad\text{that is,}\quad f_x = 0 \text{ and } f_y = 0

or where a partial derivative fails to exist, are the critical points. Every local maximum or minimum of a smooth function is one.

The converse fails. For f(x,y)=x2−y2f(x, y) = x^2 - y^2 the origin is a critical point, yet the slice along the xx-axis curves up and the slice along the yy-axis curves down. The origin is a saddle point: a low point in one direction and a high point in another.

Two slices of z = x² − y² through the origin The horizontal axis is the coordinate along each slice. Along the x-axis the surface is the upward parabola z = x², with a minimum at the origin. Along the y-axis it is the downward parabola z = −y², with a maximum at the origin. The origin is a saddle point. -2-112-4-224sz
  • slice y = 0: z = x²
  • slice x = 0: z = −y²
Two slices of z = x² − y² through the origin

The second derivative test

At a critical point (a,b)(a, b), compute

D=fxx(a,b) fyy(a,b)−(fxy(a,b))2D = f_{xx}(a, b)\,f_{yy}(a, b) - \bigl(f_{xy}(a, b)\bigr)^2
  • D>0D > 0 and fxx>0f_{xx} > 0: local minimum.
  • D>0D > 0 and fxx<0f_{xx} < 0: local maximum.
  • D<0D < 0: saddle point.
  • D=0D = 0: the test gives no answer.

Why D decides

Near a critical point the gradient term vanishes, so the second-order behavior takes over. Writing A=fxxA = f_{xx}, B=fxyB = f_{xy} and C=fyyC = f_{yy} at the point, a small step (h,k)(h, k) changes ff by about 12(Ah2+2Bhk+Ck2)\tfrac{1}{2}\left(Ah^2 + 2Bhk + Ck^2\right). Completing the square, as for a quadratic,

Ah2+2Bhk+Ck2=A(h+BAk)2+AC−B2A k2Ah^2 + 2Bhk + Ck^2 = A\left(h + \frac{B}{A}k\right)^2 + \frac{AC - B^2}{A}\,k^2

When D=AC−B2>0D = AC - B^2 > 0, both coefficients share the sign of AA, so every step changes ff the same way. If A>0A > 0 every step goes up, a minimum; if A<0A < 0 every step goes down, a maximum. When D<0D < 0 the two coefficients have opposite signs, and some steps raise ff while others lower it. The sign of DD says whether the surface curves the same way in every direction; the sign of fxxf_{xx} then says which way.

Worked examples

Common mistakes

Practice problems

  1. Find and classify the critical point of f(x,y)=x2+y2+4x−2yf(x, y) = x^2 + y^2 + 4x - 2y.

    Answer

    A local minimum at (−2,1)(-2, 1), with value −5-5

    Full solution

    fx=2x+4f_x = 2x + 4 and fy=2y−2f_y = 2y - 2 vanish at (−2,1)(-2, 1). D=4>0D = 4 > 0 and fxx=2>0f_{xx} = 2 > 0.

  2. Classify the critical point of f(x,y)=xyf(x, y) = xy.

    Answer

    A saddle at the origin

    Full solution

    fx=yf_x = y and fy=xf_y = x vanish only at (0,0)(0, 0). D=0⋅0−12=−1<0D = 0 \cdot 0 - 1^2 = -1 < 0. Along y=xy = x the function is x2x^2, and along y=−xy = -x it is −x2-x^2.

  3. Find and classify the critical point of f(x,y)=4−x2−y2+2xf(x, y) = 4 - x^2 - y^2 + 2x.

    Answer

    A local maximum at (1,0)(1, 0), with value 55

    Full solution

    fx=−2x+2f_x = -2x + 2 and fy=−2yf_y = -2y vanish at (1,0)(1, 0). D=4>0D = 4 > 0 and fxx=−2<0f_{xx} = -2 < 0.

  4. Find and classify the critical points of f(x,y)=x3−12x+y2−4yf(x, y) = x^3 - 12x + y^2 - 4y.

    Answer

    A local minimum at (2,2)(2, 2) with value −20-20, and a saddle at (−2,2)(-2, 2)

    Full solution

    fx=3x2−12=0f_x = 3x^2 - 12 = 0 gives x=±2x = \pm 2, and fy=2y−4=0f_y = 2y - 4 = 0 gives y=2y = 2. D=6x⋅2D = 6x \cdot 2, which is 2424 at x=2x = 2 and −24-24 at x=−2x = -2.

  5. Compute DD at the origin for f(x,y)=x4+y4f(x, y) = x^4 + y^4. What kind of point is it?

    Answer

    D=0D = 0; it is a minimum.

    Full solution

    All second partial derivatives vanish at the origin, so the test says nothing. But x4+y4>0x^4 + y^4 > 0 everywhere else, so the origin is the lowest point.

  6. Show that f(x,y)=x2+xy+y2f(x, y) = x^2 + xy + y^2 has a minimum at the origin.

    Answer

    D=2⋅2−1=3>0D = 2 \cdot 2 - 1 = 3 > 0 and fxx=2>0f_{xx} = 2 > 0.

    Full solution

    fx=2x+yf_x = 2x + y and fy=x+2yf_y = x + 2y both vanish only at (0,0)(0, 0), and the test gives a local minimum.

  7. At a critical point, fxx=−3f_{xx} = -3, fyy=−2f_{yy} = -2 and fxy=3f_{xy} = 3. Classify it.

    Answer

    A saddle point

    Full solution

    D=6−9=−3<0D = 6 - 9 = -3 < 0. Both fxxf_{xx} and fyyf_{yy} are negative, yet the mixed term is large enough to make some directions rise.

  8. A box with a lid has volume 88. Show that the cube, 22 by 22 by 22, has the least surface area.

    Answer

    S=2xy+16x+16yS = 2xy + \tfrac{16}{x} + \tfrac{16}{y} has its critical point at x=y=2x = y = 2.

    Full solution

    With z=8xyz = \tfrac{8}{xy}, S=2xy+2xz+2yz=2xy+16y+16xS = 2xy + 2xz + 2yz = 2xy + \tfrac{16}{y} + \tfrac{16}{x}. Sx=2y−16x2=0S_x = 2y - \tfrac{16}{x^2} = 0 and Sy=2x−16y2=0S_y = 2x - \tfrac{16}{y^2} = 0 give x=yx = y and x3=8x^3 = 8. The area is 2424.

  9. Why must a continuous function on the square 0≤x≤10 \le x \le 1, 0≤y≤10 \le y \le 1 have an absolute maximum?

    Answer

    The square is closed and bounded.

    Full solution

    The extreme value theorem guarantees both an absolute maximum and an absolute minimum for a continuous function on a closed, bounded region.

  10. A student finds the critical points of x2−2xy+2yx^2 - 2xy + 2y on the rectangle of Example 4, gets only (1,1)(1, 1), and reports 11 as both the maximum and the minimum. What went wrong?

    Hint

    Evaluate ff at the corner (3,0)(3, 0).

    Answer

    The boundary was skipped. The maximum is 99 at (3,0)(3, 0) and the minimum is 00.

    Full solution

    On a closed region, extremes often occur on the edge, where the gradient is not zero. Checking all four edges, as in Example 4, finds the true extremes.

Frequently asked questions

How do you find critical points of f(x, y)?

Solve f_x = 0 and f_y = 0 together. Points where a partial derivative does not exist are also critical points.

What is the second derivative test for two variables?

At a critical point, compute D = f_xx f_yy − (f_xy)². If D > 0 and f_xx > 0 it is a local minimum; if D > 0 and f_xx < 0, a local maximum; if D < 0, a saddle point; if D = 0 the test says nothing.

What is a saddle point?

A critical point where the function increases in some directions and decreases in others, like the middle of a horse's saddle or a mountain pass.

How do you find absolute extremes on a closed region?

Evaluate f at every critical point inside the region and find the extremes of f along the boundary. The largest and smallest of all those values are the absolute maximum and minimum.

What does D = 0 mean?

The test is inconclusive. x⁴ + y⁴ has D = 0 at the origin and a minimum there, while x³ + y³ has D = 0 and neither.

What to learn next