Multivariable Calculus • Optimization in Several Variables

Second Derivative Test & Hessian — Classify critical points using second derivative test/Hessian (intro)

Learn how the Hessian matrix reveals whether a critical point is a peak, a valley, or a saddle.

Multivariable Calculus emblem with three-dimensional axes, a function, and an orbiting path.
Inside this lesson 10 sections 5 questions 7 figures

SECTION 1

Historical Context & Motivation

In single-variable calculus, you learned that the second derivative tells you whether a critical point is a maximum or a minimum. But what happens when a function depends on two or more variables? A hilltop curves downward in every direction, a bowl curves upward, and a saddle curves up in one direction while curving down in another. Mathematicians needed a systematic tool to handle all of these cases, and that tool turned out to be a matrix called the Hessian.

1760s • Lagrange's Early Work

Joseph-Louis Lagrange studied optimization problems in mechanics, developing methods to find extrema of functions of several variables using partial derivatives.

1844 • Ludwig Otto Hesse Introduces the Hessian

The German mathematician Ludwig Otto Hesse organized all second-order partial derivatives into a square matrix, now called the Hessian matrix, giving mathematicians a compact way to classify critical points.

1850s • Sylvester's Criterion

James Joseph Sylvester developed criteria involving the determinant and leading principal minors of the Hessian, which streamlined the classification of critical points into maxima, minima, and saddle points.

20th Century • Modern Applications

The Hessian became a cornerstone tool in economics (profit optimization), machine learning (training neural networks), and engineering (structural analysis), wherever finding peaks and valleys of multivariable functions matters.

The central question this lesson addresses is: once you find a critical point of a function f(x, y), how do you determine whether it corresponds to a local maximum, a local minimum, or a saddle point? The Hessian matrix and its determinant give you a clean, systematic answer.

SECTION 2

Core Principles & Definitions

Before diving into the Hessian, let's review a few essential ideas. A critical point of a function f(x, y) is a point where both first-order partial derivatives equal zero: fx = 0 and fy = 0. At such a point, the surface is momentarily flat — no slope in any direction. But "flat" doesn't automatically mean "highest" or "lowest." The second derivatives tell us about the curvature at that point.

1

Critical Point

A point (a, b) where fx(a, b) = 0 and fy(a, b) = 0. The tangent plane is perfectly horizontal here.
2

Second Partial Derivatives

The four second-order partials — fxx, fyy, fxy, and fyx — measure how the surface bends in different directions.
3

Hessian Matrix

A 2×2 matrix that packages all four second partial derivatives into one object. Its determinant, D, is the key to classifying critical points.
4

Determinant D

D = fxx · fyy − (fxy)². If D > 0, curvature is consistent; if D < 0, you have a saddle.
✦

KEY TAKEAWAY

Think of standing at the peak of a hill and checking two directions. If the ground curves downward in every direction, you're at a maximum. If it curves upward in every direction, you're at a minimum. But if the ground curves down along one direction and up along another — like sitting in a horse saddle — you have a saddle point. The Hessian determinant D checks whether the curvatures agree (D > 0) or conflict (D < 0).

SECTION 3

Visual Explanation — Surfaces & Critical Points

Three Types of Critical Points on a SurfaceLOCAL MINIMUMD > 0, f_xx > 0Bowl shape — curvesupward in all directionsLOCAL MAXIMUMD > 0, f_xx < 0Dome shape — curvesdownward in all directionsSADDLE POINTD < 0up along xdown along ySaddle shape — curves upone way, down the otherContour lines (level curves) shown as ellipses for min/max; cross-hatched curves for saddle
This diagram shows the three possible outcomes at a critical point. A local minimum looks like a bowl, a local maximum looks like an upside-down bowl, and a saddle point curves upward in one direction and downward in another, like a mountain pass.

Notice the key visual difference: at a minimum or maximum, the contour lines form closed loops (like circles or ellipses) around the critical point. At a saddle point, the contours cross through the critical point in a hyperbolic pattern. The Hessian determinant D captures exactly this geometric distinction. When D > 0, the curvature is consistent in all directions, so the contours close. When D < 0, the curvature conflicts, producing the characteristic saddle shape.

SECTION 4

Mathematical Framework

Let f(x, y) be a function with continuous second partial derivatives. Suppose (a, b) is a critical point, meaning fx(a, b) = 0 and fy(a, b) = 0. The Hessian matrix at that point collects all four second partial derivatives into a 2×2 matrix.

HESSIAN MATRIX

H=[fxxfxy][fyxfyy]H = [ f_xx f_xy ] [ f_yx f_yy ]

fxx = ∂²f/∂x², the second partial with respect to x. fyy = ∂²f/∂y². fxy = ∂²f/∂x∂y (the mixed partial). By Clairaut's theorem, fxy = fyx when the second partials are continuous.

HESSIAN DETERMINANT

D=fxx⋅fyy−(fxy)2D = f_xx · f_yy − (f_xy)²

D is the determinant of the Hessian matrix. This single number is the key to the second derivative test for functions of two variables.

The Second Derivative Test for f(x, y)

Evaluate D and fxx at the critical point (a, b). There are four possible outcomes:

  • If D > 0 and f_xx > 0, then (a, b) is a local minimum.
  • If D > 0 and f_xx < 0, then (a, b) is a local maximum.
  • If D < 0, then (a, b) is a saddle point.
  • If D = 0, the test is inconclusive — you need other methods to classify the point.
💡

Why f_xx and not f_yy?

When D > 0, the signs of fxx and fyy must agree (both positive or both negative) because D = fxx · fyy − (fxy)² > 0 forces their product to be positive. So checking fxx alone is enough to determine the sign of both.

SECTION 5

Classification Flowchart & Summary Table

Second Derivative Test — Decision FlowchartFind critical point (a, b)Compute f_xx, f_yy, f_xy at (a,b)Compute D = f_xx·f_yy − (f_xy)²D < 0D = 0D > 0Saddle PointInconclusiveCheck f_xxf_xx > 0f_xx < 0Local MinimumLocal MaximumFollow the branches: compute D first, then check the sign of f_xx when D > 0.
Follow the flowchart from top to bottom. After computing D, the sign of D tells you which branch to follow. When D > 0, the sign of fxx distinguishes between a local minimum (positive curvature) and a local maximum (negative curvature).
ConditionClassificationSurface Shape
D > 0 and fxx > 0Local MinimumBowl (concave up)
D > 0 and fxx < 0Local MaximumDome (concave down)
D < 0Saddle PointHorse saddle
D = 0InconclusiveNeed further analysis

Summary of the Second Derivative Test for f(x, y)

SECTION 6

Worked Example

Let's classify the critical points of the function f(x, y) = x³ − 3x + y² using the second derivative test.

Classify the critical points of f(x, y) = x³ − 3x + y²

  1. 1

    Step 1 — Find the first partial derivatives

    Compute fx = 3x² − 3 and fy = 2y.
  2. 2

    Step 2 — Set both partial derivatives equal to zero

    From fx = 0: 3x² − 3 = 0, so x² = 1, giving x = 1 or x = −1. From fy = 0: 2y = 0, so y = 0.
    Critical points: (1, 0) and (−1, 0)
  3. 3

    Step 3 — Compute the second partial derivatives

    fxx = 6x, fyy = 2, and fxy = 0.
  4. 4

    Step 4 — Evaluate D at (1, 0)

    At (1, 0): fxx = 6(1) = 6, fyy = 2, fxy = 0. So D = (6)(2) − (0)² = 12.
    D = 12 > 0 and fxx = 6 > 0, so (1, 0) is a local minimum.
  5. 5

    Step 5 — Evaluate D at (−1, 0)

    At (−1, 0): fxx = 6(−1) = −6, fyy = 2, fxy = 0. So D = (−6)(2) − (0)² = −12.
    D = −12 < 0, so (−1, 0) is a saddle point.

SECTION 7

Strengths & Limitations of the Second Derivative Test

StrengthsLimitations
Provides a quick, formulaic classification — just compute D and check the sign of f_xx.Fails when D = 0 (the inconclusive case). You may need to analyze higher-order derivatives or use other methods.
Works for any function with continuous second partial derivatives, which covers most functions you'll encounter.Only classifies critical points — it does not find them. You still need to solve fxf_x = 0 and fyf_y = 0 first.
Extends naturally to functions of more variables using the full Hessian matrix and eigenvalue analysis.For functions of three or more variables, computing the full Hessian determinant by hand can get algebraically messy.

Strengths vs. Limitations of the Second Derivative Test

✦

KEY TAKEAWAY

The second derivative test is like a quick diagnostic tool — it gives you a definitive answer most of the time, but occasionally the test comes back "inconclusive" and you need a more advanced scan. In practice, the D = 0 case is relatively rare, so this test handles the vast majority of optimization problems efficiently.

SECTION 8

Connection to the Full Hessian in Higher Dimensions

Everything we've done so far applies to functions of two variables. But what if your function depends on three, four, or more variables? The Hessian matrix generalizes naturally: for a function of n variables, the Hessian is an n×n matrix of all second partial derivatives. The classification then depends on the eigenvalues of this matrix (or equivalently, on the signs of the leading principal minors).

FeatureTwo-Variable CaseGeneral n-Variable Case
Hessian size2 × 2 matrixn × n matrix
Classification toolDeterminant D and sign of fxxEigenvalues of H, or Sylvester's criterion (leading principal minors)
Local minimumD > 0, fxx > 0All eigenvalues positive (H is positive definite)
Local maximumD > 0, fxx < 0All eigenvalues negative (H is negative definite)
Saddle pointD < 0Eigenvalues have mixed signs (H is indefinite)

Two-Variable Test vs. General Hessian Analysis

You don't need to master eigenvalue methods right now. The important takeaway is that the 2×2 determinant test you learned today is a special case of a broader, powerful framework. As you continue in mathematics or take a linear algebra course, you'll see how the Hessian connects optimization, matrix theory, and geometry in a beautiful way.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

If the Hessian determinant D is negative at a critical point, what kind of critical point is it? Explain in your own words why D < 0 rules out a local minimum or local maximum.
Show answer
When D < 0, the critical point is a saddle point. Recall that D = fxx · fyy − (fxy)². If D < 0, then fxx and fyy must have opposite signs (or the mixed partial is large enough to overwhelm their product). This means the surface curves upward in one direction and downward in another, which is exactly the behavior of a saddle — it can't be a pure max or min.

Question 2: BASIC CALCULATION

Find and classify all critical points of f(x, y) = x² + y² − 4x − 6y + 13.
Show answer
First, find the partials: fx = 2x − 4 and fy = 2y − 6. Setting both to zero gives x = 2, y = 3, so the only critical point is (2, 3). The second partials are fxx = 2, fyy = 2, and fxy = 0. Therefore D = (2)(2) − 0² = 4 > 0, and fxx = 2 > 0, so (2, 3) is a local minimum.

Question 3: INTERMEDIATE

Find and classify all critical points of f(x, y) = x³ + y³ − 3xy.
Show answer
Compute fx = 3x² − 3y and fy = 3y² − 3x. Setting fx = 0 gives y = x². Substituting into fy = 0: 3x⁴ − 3x = 0, so x(x³ − 1) = 0, yielding x = 0 (y = 0) and x = 1 (y = 1). The second partials are fxx = 6x, fyy = 6y, fxy = −3. At (0, 0): D = (0)(0) − (−3)² = −9 < 0, so it is a saddle point. At (1, 1): D = (6)(6) − (−3)² = 36 − 9 = 27 > 0, and fxx = 6 > 0, so it is a local minimum.

Question 4: APPLIED

A company's profit (in thousands of dollars) from producing x units of product A and y units of product B is modeled by P(x, y) = −2x² − y² + 4x + 6y − 10xy + 20. There is a critical point at (−1, 8). Compute D at this point and classify it. What does this mean for the company?
Show answer
First compute the second partials: Pxx = −4, Pyy = −2, Pxy = −10 (these are constants, so they're the same at every point). Then D = (−4)(−2) − (−10)² = 8 − 100 = −92 < 0. Since D < 0, the critical point (−1, 8) is a saddle point. This means (−1, 8) is not a profit maximum — the company should not produce at these levels. The profit function has no local maximum, suggesting the model may need constraints (like budget limits) to find an optimal production plan.

Question 5: CRITICAL THINKING

Consider f(x, y) = x⁴ + y⁴. Show that (0, 0) is a critical point and compute D there. The test is inconclusive — but can you argue directly that (0, 0) is actually a local minimum? Why does the second derivative test fail here?
Show answer
We have fx = 4x³ and fy = 4y³. At (0, 0), both are zero, so it is a critical point. The second partials are fxx = 12x², fyy = 12y², and fxy = 0. At (0, 0), all second partials are zero, so D = 0 · 0 − 0² = 0. The test is inconclusive. However, f(x, y) = x⁴ + y⁴ ≥ 0 for all (x, y), and f(0, 0) = 0. Since the function value at the origin is the smallest possible value, (0, 0) is clearly a local (and global) minimum. The test fails because the curvature at the origin is "too flat" — the second derivatives are all zero, so the Hessian has no curvature information. The function's behavior is controlled by fourth-order terms, which the second derivative test doesn't examine.

SUMMARY

Lesson Summary

Summary

To classify critical points of a function f(x, y), you build the Hessian matrix from the four second partial derivatives and compute its determinant D = f_xx · f_yy − (f_xy)². When D > 0 and f_xx > 0, the critical point is a local minimum; when D > 0 and f_xx < 0, it is a local maximum; when D < 0, it is a saddle point; and when D = 0, the test is inconclusive.

This two-variable test is a special case of a broader framework using the full n × n Hessian matrix and its eigenvalues. Mastering the 2 × 2 case gives you a strong foundation for optimization in any number of dimensions.

Varsity Tutors • Multivariable Calculus • Second Derivative Test & Hessian