MAT1052 · Week 11 · Maximum and Minimum Problems

Local extrema and the second derivative test

You learn to find the critical points of a function of two variables, to classify them as local maximum, local minimum and saddle point with the second derivative test (the discriminant D), and to reduce application problems to a single variable.

critical pointlocal maximumlocal minimumsaddle pointsecond derivative testdiscriminantHessianinconclusiveoptimization

In single-variable calculus you found the points where f′(x)=0f'(x) = 0 and looked at the sign of f′′f''. In two variables the idea is the same but with two differences: to find critical points you solve two equations at once, and the second derivative test is done not with a single number but with the discriminant DD, which combines the second derivatives. A new type of point also appears: the saddle point, which behaves like a minimum in one direction and a maximum in another. In the exam this topic almost always comes as a “find and classify all critical points” question; the real points come from solving the system of equations completely.

Golden rules:

  1. Critical point: fx=0f_x = 0 and fy=0f_y = 0. When solving the system, factor; do not lose roots by dividing.
  2. Compute D=fxxfyy−fxy2D = f_{xx}f_{yy}-f_{xy}^2 separately at each critical point.
  3. If D<0D<0 it is a saddle; if D>0D>0 look at the sign of fxxf_{xx}. If D=0D = 0 the test is silent.
  4. In the answer write the point, its type and the function value.

Definitions

If ff satisfies f(x,y)≤f(a,b)f(x,y)\le f(a,b) at all points around (a,b)(a,b), then (a,b)(a,b) is a local maximum; if it satisfies f(x,y)≥f(a,b)f(x,y)\ge f(a,b), it is a local minimum.

Theorem (first derivative). If ff has a local extremum at (a,b)(a,b) and the partial derivatives exist, then fx(a,b)=0f_x(a,b) = 0 and fy(a,b)=0f_y(a,b) = 0. That is, ∇f=0\nabla f = \mathbf 0 and the tangent plane is horizontal.

Points where ∇f=0\nabla f = \mathbf 0 (or where one of the partial derivatives is undefined) are called critical points. Every extremum is a critical point, but not every critical point is an extremum.

Saddle point. A critical point that is not an extremum. The classic example is z=y2−x2z = y^2-x^2 (hyperbolic paraboloid): at the origin a maximum along the xx axis and a minimum along the yy axis. Like the middle of a horse saddle.

The second derivative test

Let (a,b)(a,b) be a critical point and the second derivatives be continuous.

D=fxx(a,b) fyy(a,b)−[fxy(a,b)]2=∣fxxfxyfxyfyy∣D = f_{xx}(a,b)\,f_{yy}(a,b)-\big[f_{xy}(a,b)\big]^2 = \begin{vmatrix}f_{xx}&f_{xy}\\f_{xy}&f_{yy}\end{vmatrix}

DDfxxf_{xx}Result
>0>0>0>0local minimum
>0>0<0<0local maximum
<0<0anysaddle point
=0=0anythe test is inconclusive

Intuition. D>0D>0 means the surface bends to the same side in all directions at the critical point; either a bowl (min) or an upside-down bowl (max). The curvature in any direction, for example fxxf_{xx}, tells which. D<0D<0 means that it bends up in some directions and down in others: a saddle. The fxyf_{xy} term accounts for curvature in mixed directions; even if fxxf_{xx} and fyyf_{yy} are both positive, if fxyf_{xy} is large the point can be a saddle.

PITFALL · saying min/max just because fxxf_{xx} and fyyf_{yy} have the same sign. f=x2+4xy+y2f = x^2+4xy+y^2: fxx=2>0f_{xx} = 2>0, fyy=2>0f_{yy} = 2>0, but fxy=4f_{xy} = 4 and D=4−16=−12<0D = 4-16 = -12<0. The origin is a saddle. Along the line y=−xy = -x, f=−2x2f = -2x^2, going down. Do not decide without computing DD.

Solved examples

Example 1 (a single critical point). f(x,y)=x2+2y2−4x+4y+1f(x,y) = x^2+2y^2-4x+4y+1.

f_x = 2x - 4 = 0    →  x = 2
f_y = 4y + 4 = 0    →  y = -1
f_xx = 2, f_yy = 4, f_xy = 0,  D = 8 > 0, f_xx > 0  →  local min
f(2,-1) = 4 + 2 - 8 - 4 + 1 = -5

Example 2 (two critical points). f(x,y)=xy−x33−y22f(x,y) = xy-\dfrac{x^3}{3}-\dfrac{y^2}{2}.

fx=y−x2=0f_x = y-x^2 = 0 and fy=x−y=0f_y = x-y = 0. From the second, y=xy = x; plug into the first: x−x2=x(1−x)=0x-x^2 = x(1-x) = 0. The points are (0,0)(0,0) and (1,1)(1,1).

Second derivatives: fxx=−2xf_{xx} = -2x, fyy=−1f_{yy} = -1, fxy=1f_{xy} = 1, D=2x−1D = 2x-1.

PointDDfxxf_{xx}Typeff
(0,0)(0,0)−1-100saddle00
(1,1)(1,1)11−2-2local max1−13−12=161-\frac13-\frac12 = \frac16

TIP · do not lose roots. If you divide the equation x−x2=0x-x^2 = 0 by xx and write x=1x = 1, you lose (0,0)(0,0). Always factor: x(1−x)=0x(1-x) = 0. The equations x4=xx^4 = x, x9=xx^9 = x in Q4 and Q6 are the same trap.

Strategies for solving systems

Type of systemStrategy
Both linearSubstitution or elimination
One is easily put in the form y=g(x)y = g(x)Plug into the other, a single-variable equation
Symmetric (the same when x↔yx\leftrightarrow y)Try the cases y=xy = x and y=−xy = -x, but also look for other solutions
In product form (x(…)=0x(\ldots) = 0)Set each factor to zero separately, combine the cases

Example 3 (D=0D = 0). f=x4−y4f = x^4-y^4, at the origin all second derivatives are 00, D=0D = 0. The test is silent. Look at paths: on the xx axis f=x4≥0f = x^4\ge0, on the yy axis f=−y4≤0f = -y^4\le0. In every neighborhood of the origin there are both positive and negative values: a saddle. In the same situation x4+y4x^4+y^4 is a minimum and −(x4+y4)-(x^4+y^4) a maximum. So when D=0D = 0 anything can happen.

Application problems

Optimization problems usually have three variables and one constraint. Use the constraint to eliminate a variable, reduce to a two-variable function, then apply the test on this page.

1) What are you optimizing? (area, volume, distance, cost) → formula
2) Constraint: xyz = V, x + y + z = k, the point is on a plane ...  → pull out z
3) Build the two-variable function, find the critical point
4) Confirm with D that it is a min/max (or physically it is the only candidate)
5) Compute the third variable and the requested value

The distance trick. When looking for the closest point to a point, minimize the square of the distance, not …\sqrt{\ldots}. Since the root is an increasing function, the minimum is at the same point and the derivatives come out much cleaner.

Next week we will see how to solve the same problems without eliminating variables, with Lagrange multipliers, and how to find absolute extrema on closed regions.

Common mistakes

WrongCorrect
Dividing by xx while solving the systemFactor, keep the solution x=0x=0
Computing DD once and applying it to every pointSeparately at each critical point
If D>0D>0 it is always a minimumLook at the sign of fxxf_{xx}
If D=0D = 0 it is a saddleNo result; examine directly
Not taking fxyf_{xy} twice in the DD formulafxxfyy−fxy2f_{xx}f_{yy}-f_{xy}^2
Writing only the pointThe type and the ff value are also asked
Forgetting the third dimension in an applicationCompute zz back from the constraint
Differentiating the distance with the rootMinimize its square

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

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

Show answer
Local min at (2,−3)(2,-3), f=−13f=-13

fx=2x−4=0f_x = 2x-4 = 0, fy=2y+6=0f_y = 2y+6 = 0: (2,−3)(2,-3).fxx=2f_{xx} = 2, fyy=2f_{yy} = 2, fxy=0f_{xy} = 0, D=4>0D = 4>0, fxx>0f_{xx}>0: local minimum.f(2,−3)=4+9−8−18=−13f(2,-3) = 4+9-8-18 = -13. (If you complete the square you get (x−2)2+(y+3)2−13(x-2)^2+(y+3)^2-13, the same result.)

Question 2easy

Classify the critical point of f(x,y)=x2−y2f(x,y) = x^2-y^2.

Show answer
Saddle point at (0,0)(0,0)

fx=2xf_x = 2x, fy=−2yf_y = -2y, the only critical point is (0,0)(0,0).D=(2)(−2)−0=−4<0D = (2)(-2)-0 = -4<0: a saddle point. It behaves like a minimum in the xx direction and a maximum in the yy direction.

Question 3medium

Find and classify all critical points of f(x,y)=x3−3x+y2f(x,y) = x^3-3x+y^2.

Show answer
(1,0)(1,0) local min (f=−2f=-2), (−1,0)(-1,0) saddle

fx=3x2−3=0⇒x=±1f_x = 3x^2-3 = 0\Rightarrow x = \pm1; fy=2y=0⇒y=0f_y = 2y = 0\Rightarrow y = 0.fxx=6xf_{xx} = 6x, fyy=2f_{yy} = 2, fxy=0f_{xy} = 0, D=12xD = 12x.(1,0)(1,0): D=12>0D = 12>0, fxx=6>0f_{xx} = 6>0, local min, f=1−3=−2f = 1-3 = -2.(−1,0)(-1,0): D=−12<0D = -12<0, saddle.

Question 4medium

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

Show answer
(0,0)(0,0) saddle; (1,1)(1,1) local min, f=−1f=-1

fx=3x2−3y=0⇒y=x2f_x = 3x^2-3y = 0\Rightarrow y = x^2. fy=3y2−3x=0⇒x=y2=x4f_y = 3y^2-3x = 0\Rightarrow x = y^2 = x^4.x(x3−1)=0x(x^3-1) = 0: x=0x = 0 or x=1x = 1. The points are (0,0)(0,0), (1,1)(1,1).fxx=6xf_{xx} = 6x, fyy=6yf_{yy} = 6y, fxy=−3f_{xy} = -3, D=36xy−9D = 36xy-9.(0,0)(0,0): D=−9<0D = -9<0, saddle. (1,1)(1,1): D=27>0D = 27>0, fxx=6>0f_{xx} = 6>0, local min, f=1+1−3=−1f = 1+1-3 = -1.

Question 5medium

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

Show answer
Local max at (1,2)(1,2), f=3f = 3

fx=y−2x=0f_x = y-2x = 0, fy=x−2y+3=0f_y = x-2y+3 = 0. From the first, y=2xy = 2x; plug into the second: x−4x+3=0x-4x+3 = 0, x=1x = 1, y=2y = 2.fxx=−2f_{xx} = -2, fyy=−2f_{yy} = -2, fxy=1f_{xy} = 1, D=4−1=3>0D = 4-1 = 3>0, fxx<0f_{xx}<0: local maximum.f(1,2)=2−1−4+6=3f(1,2) = 2-1-4+6 = 3.

Question 6hard

Find and classify all critical points of f(x,y)=x4+y4−4xyf(x,y) = x^4+y^4-4xy.

Show answer
(0,0)(0,0) saddle; (1,1)(1,1) and (−1,−1)(-1,-1) local min, f=−2f=-2

fx=4x3−4y=0⇒y=x3f_x = 4x^3-4y = 0\Rightarrow y = x^3. fy=4y3−4x=0⇒x=y3=x9f_y = 4y^3-4x = 0\Rightarrow x = y^3 = x^9.x9−x=x(x8−1)=0x^9-x = x(x^8-1) = 0: x=0,±1x = 0,\pm1. The points are (0,0)(0,0), (1,1)(1,1), (−1,−1)(-1,-1).fxx=12x2f_{xx} = 12x^2, fyy=12y2f_{yy} = 12y^2, fxy=−4f_{xy} = -4, D=144x2y2−16D = 144x^2y^2-16.(0,0)(0,0): D=−16D = -16, saddle. (±1,±1)(\pm1,\pm1): D=128>0D = 128>0, fxx=12>0f_{xx} = 12>0, local min, f=1+1−4=−2f = 1+1-4 = -2.

Question 7medium

For f(x,y)=x4+y4f(x,y) = x^4+y^4, what does the second derivative test say at (0,0)(0,0), and what is the actual nature of the point?

Show answer
Test inconclusive (D=0D=0); actually a local (absolute) min

fxx=12x2f_{xx} = 12x^2, fyy=12y2f_{yy} = 12y^2, fxy=0f_{xy} = 0; at the origin all are 00, D=0D = 0: the test gives no result.
Look directly: f≥0f\ge0 everywhere and f(0,0)=0f(0,0) = 0. So the origin is a minimum.

Question 8medium

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

Show answer
Local min at (1,−1)(1,-1), f=−1f = -1

fx=4x+2y−2=0f_x = 4x+2y-2 = 0, fy=2y+2x=0⇒y=−xf_y = 2y+2x = 0\Rightarrow y = -x. Plug into the first: 4x−2x−2=04x-2x-2 = 0, x=1x = 1, y=−1y = -1.fxx=4f_{xx} = 4, fyy=2f_{yy} = 2, fxy=2f_{xy} = 2, D=8−4=4>0D = 8-4 = 4>0, fxx>0f_{xx}>0: local min.f(1,−1)=2+1−2−2=−1f(1,-1) = 2+1-2-2 = -1.

Question 9hard

Find the point on the plane x+2y+z=6x+2y+z = 6 closest to the origin, using the second derivative test.

Show answer
(1,2,1)(1,2,1), distance 6\sqrt6

z=6−x−2yz = 6-x-2y. Minimize the square of the distance: g(x,y)=x2+y2+(6−x−2y)2g(x,y) = x^2+y^2+(6-x-2y)^2.gx=2x−2(6−x−2y)=0⇒4x+4y=12g_x = 2x-2(6-x-2y) = 0\Rightarrow 4x+4y = 12. gy=2y−4(6−x−2y)=0⇒4x+10y=24g_y = 2y-4(6-x-2y) = 0\Rightarrow 4x+10y = 24.
Subtract: 6y=126y = 12, y=2y = 2, x=1x = 1, z=1z = 1. gxx=4g_{xx} = 4, gyy=10g_{yy} = 10, gxy=4g_{xy} = 4, D=24>0D = 24>0: min.
The distance is 1+4+1=6\sqrt{1+4+1} = \sqrt6.

Question 10hard

An open-top rectangular box must have volume 3232 cm3^3. Find the dimensions that minimize the surface area.

Show answer
4×4×24\times4\times2 cm, area 4848 cm2^2

xyz=32xyz = 32, z=32xyz = \frac{32}{xy}. Area (no top): S=xy+2xz+2yz=xy+64y+64xS = xy+2xz+2yz = xy+\dfrac{64}{y}+\dfrac{64}{x}.Sx=y−64x2=0S_x = y-\dfrac{64}{x^2} = 0, Sy=x−64y2=0S_y = x-\dfrac{64}{y^2} = 0. By symmetry x=yx = y, x3=64x^3 = 64, x=4x = 4.z=2z = 2. Sxx=128x3=2S_{xx} = \frac{128}{x^3} = 2, Syy=2S_{yy} = 2, Sxy=1S_{xy} = 1, D=3>0D = 3>0: min. S=16+16+16=48S = 16+16+16 = 48.

Question 11medium

Find and classify all critical points of f(x,y)=y3−3y+x2−2xf(x,y) = y^3-3y+x^2-2x.

Show answer
(1,1)(1,1) local min (f=−3f=-3), (1,−1)(1,-1) saddle

fx=2x−2=0⇒x=1f_x = 2x-2 = 0\Rightarrow x = 1. fy=3y2−3=0⇒y=±1f_y = 3y^2-3 = 0\Rightarrow y = \pm1.fxx=2f_{xx} = 2, fyy=6yf_{yy} = 6y, fxy=0f_{xy} = 0, D=12yD = 12y.(1,1)(1,1): D=12>0D = 12>0, min, f=1−3+1−2=−3f = 1-3+1-2 = -3. (1,−1)(1,-1): D=−12<0D = -12<0, saddle.

Question 12easy

At a critical point, fxx=2f_{xx} = 2, fyy=8f_{yy} = 8 and fxy=4f_{xy} = 4. What can you conclude?

Show answer
Nothing: D=0D = 0, the test is inconclusive

D=fxxfyy−fxy2=16−16=0D = f_{xx}f_{yy}-f_{xy}^2 = 16-16 = 0. The second derivative test gives no result.fxx>0f_{xx}>0 alone does NOT mean a minimum; the condition D>0D>0 is also needed.

Verification: At each critical point the gradient was verified to be zero with numerical derivatives, D and f_xx were computed with numerical second derivatives; the classification was also independently verified by scanning function values in 72 directions around the point (up/down), and the D=0 cases were also resolved with this scan (verify/MAT1052/11.mjs).

Review card

Critical point: f_x = 0 AND f_y = 0 (or the derivative does not exist) Solve the system: pull y out of one, plug into the other; FACTOR, do not lose roots D = f_xx·f_yy - (f_xy)² (compute separately at each critical point) D > 0, f_xx > 0 → local MIN D > 0, f_xx < 0 → local MAX D < 0 → SADDLE point D = 0 → the test is INCONCLUSIVE (look another way: the sign of f, paths) f_yy can be used instead of f_xx (when D>0 their signs are the same) Application: eliminate a variable with the constraint, build a two-variable function Distance: minimize the square (no root, same point) In the answer write both the point and the value of f