Math Core

Lesson 3.7 · Partial Derivatives

Maximum and minimum values

Optimization is one of the main reasons to learn calculus: the cheapest design, the strongest beam, the most profitable price. With two variables, the landscape is richer than in one variable. Besides peaks and valleys there are saddle points, which rise in one direction and fall in another. This lesson shows how to find candidate points with the gradient and how to sort them with a second derivative test.

Local extrema and critical points

Definition

Local maximum and minimum

f(x,y)f(x, y) has a local maximum at (a,b)(a, b) if f(x,y)≤f(a,b)f(x, y) \le f(a, b) for all (x,y)(x, y) in some disk around (a,b)(a, b), and a local minimum if f(x,y)≥f(a,b)f(x, y) \ge f(a, b) there. If the inequality holds for every (x,y)(x, y) in the domain, the extremum is absolute (or global).

At the top of a smooth hill, the ground is flat in every direction. In particular, the trace in the xx-direction has a horizontal tangent, so fx(a,b)=0f_x(a, b) = 0, and likewise fy(a,b)=0f_y(a, b) = 0. The tangent plane there is horizontal.

Critical points

If ff has a local extremum at (a,b)(a, b) and the first partials exist there, then fx(a,b)=0f_x(a, b) = 0 and fy(a,b)=0f_y(a, b) = 0, that is, ∇f(a,b)=0\nabla f(a, b) = \mathbf{0}. A point where ∇f=0\nabla f = \mathbf{0} or where a partial derivative does not exist is called a critical point.

Every local extremum is a critical point, but not every critical point is an extremum. The classic counterexample is f(x,y)=x2−y2f(x, y) = x^2 - y^2. At the origin both partials are 00, yet along the xx-axis the origin is a minimum of x2x^2 and along the yy-axis it is a maximum of −y2-y^2. The surface looks like a saddle or a mountain pass. Such a point is a saddle point.

Level curves of f = x² − y². Curves with f = 1, 4 open left and right; f = −1, −4 open up and down; f = 0 is the pair of lines y = ±x crossing at the saddle point.Open in grapher →

Level curves that cross, or hyperbolas that open in opposite directions around a point, are the contour-map signature of a saddle.

The second derivative test

To classify a critical point, look at the second partials. They combine into one number.

Second Derivative Test

Suppose the second partials of ff are continuous near (a,b)(a, b) and ∇f(a,b)=0\nabla f(a, b) = \mathbf{0}. Let

D=fxx(a,b) fyy(a,b)−[fxy(a,b)]2.D = f_{xx}(a, b)\,f_{yy}(a, b) - \left[f_{xy}(a, b)\right]^2.
  • If D>0D > 0 and fxx(a,b)>0f_{xx}(a, b) > 0, then f(a,b)f(a, b) is a local minimum.
  • If D>0D > 0 and fxx(a,b)<0f_{xx}(a, b) < 0, then f(a,b)f(a, b) is a local maximum.
  • If D<0D < 0, then (a,b)(a, b) is a saddle point.
  • If D=0D = 0, the test is inconclusive.

Why does this work? Near the critical point, ff behaves like the quadratic 12(fxxh2+2fxyhk+fyyk2)\tfrac{1}{2}\left(f_{xx}h^2 + 2f_{xy}hk + f_{yy}k^2\right) in the displacements h=x−ah = x - a, k=y−bk = y - b. When D>0D > 0 this quadratic has the same sign in every direction (the sign of fxxf_{xx}); when D<0D < 0 it takes both signs. DD is the determinant of the matrix of second partials, often called the Hessian.

Worked example: Completing the picture

Find and classify the critical points of f(x,y)=x3+y3−3xyf(x, y) = x^3 + y^3 - 3xy.

Set the partials to zero:

fx=3x2−3y=0,fy=3y2−3x=0.f_x = 3x^2 - 3y = 0, \qquad f_y = 3y^2 - 3x = 0.

The first equation gives y=x2y = x^2. Substituting into the second: x4−x=0x^4 - x = 0, so x(x3−1)=0x(x^3 - 1) = 0 and x=0x = 0 or x=1x = 1. The critical points are (0,0)(0, 0) and (1,1)(1, 1).

The second partials are fxx=6xf_{xx} = 6x, fyy=6yf_{yy} = 6y and fxy=−3f_{xy} = -3, so D=36xy−9D = 36xy - 9.

  • At (0,0)(0, 0): D=−9<0D = -9 < 0, a saddle point.
  • At (1,1)(1, 1): D=27>0D = 27 > 0 and fxx=6>0f_{xx} = 6 > 0, a local minimum, with value f(1,1)=1+1−3=−1f(1, 1) = 1 + 1 - 3 = -1.

Common mistake

When solving fx=0f_x = 0 and fy=0f_y = 0, do not divide by an expression that could be zero. From x(x3−1)=0x(x^3 - 1) = 0, dividing by xx would lose the critical point (0,0)(0, 0). Factor instead, and find every solution of the system before you start classifying.

Absolute extrema on closed, bounded regions

In one variable, a continuous function on a closed interval [a,b][a, b] attains an absolute maximum and minimum, either at a critical point or at an endpoint. The two-variable version replaces the interval with a region DD that is closed (contains its boundary) and bounded (fits inside some disk).

Closed Interval Method in two variables

If ff is continuous on a closed, bounded set DD, then ff attains an absolute maximum and minimum on DD. To find them:

  1. Find the values of ff at the critical points inside DD.
  2. Find the extreme values of ff on the boundary of DD.
  3. The largest value from steps 1 and 2 is the absolute maximum; the smallest is the absolute minimum.

The boundary step usually reduces to single-variable problems: parametrize each piece of the boundary and optimize.

Worked example: Absolute extrema on a disk

Find the absolute maximum and minimum of f(x,y)=x2+2y2−4xf(x, y) = x^2 + 2y^2 - 4x on the disk x2+y2≤9x^2 + y^2 \le 9.

Interior. fx=2x−4f_x = 2x - 4 and fy=4yf_y = 4y vanish at (2,0)(2, 0), which is inside the disk. f(2,0)=4−8=−4f(2, 0) = 4 - 8 = -4.

Boundary. On x2+y2=9x^2 + y^2 = 9, replace y2y^2 with 9−x29 - x^2:

g(x)=x2+2(9−x2)−4x=−x2−4x+18,−3≤x≤3.g(x) = x^2 + 2(9 - x^2) - 4x = -x^2 - 4x + 18, \qquad -3 \le x \le 3.

g′(x)=−2x−4=0g'(x) = -2x - 4 = 0 at x=−2x = -2, where g(−2)=22g(-2) = 22 (at the points (−2,±5)(-2, \pm\sqrt{5})). At the endpoints, g(3)=−3g(3) = -3 and g(−3)=21g(-3) = 21.

Compare. The candidates are −4,22,−3,21-4, 22, -3, 21. The absolute maximum is 2222 at (−2,±5)(-2, \pm\sqrt{5}), and the absolute minimum is −4-4 at (2,0)(2, 0).

Tip

In applied problems, you can often skip the second derivative test. If the physical situation guarantees a minimum exists (a box must have some least possible cost) and there is only one critical point in the sensible region, that point is the answer.

Practice

Practice 1

Find the critical point of f(x,y)=x2+3y2−6x+12y+1f(x, y) = x^2 + 3y^2 - 6x + 12y + 1.

Enter a point like (2, -3)

Practice 2

The function f(x,y)=x2+3y2−6x+12y+1f(x, y) = x^2 + 3y^2 - 6x + 12y + 1 has a local minimum at its critical point. What is the minimum value?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

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

Practice 4

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

Separate answers with commas, e.g. 2, -5

Practice 5

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

Practice 6

The function f(x,y)=2x3+6xy+3y2f(x, y) = 2x^3 + 6xy + 3y^2 has two critical points: one is a saddle point and the other is a local minimum. Find the local minimum value.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Find the absolute maximum value of f(x,y)=x2+y2−2x−2yf(x, y) = x^2 + y^2 - 2x - 2y on the closed square 0≤x≤30 \le x \le 3, 0≤y≤30 \le y \le 3.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Find the shortest distance from the origin to the plane x+2y+z=4x + 2y + z = 4 by minimizing the squared distance x2+y2+z2x^2 + y^2 + z^2 with z=4−x−2yz = 4 - x - 2y.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.