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.

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.

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).

Visual Explanation — Surfaces & Critical Points

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.

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 = [ 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 = 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.

Classification Flowchart & Summary Table

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).
Summary of the Second Derivative Test for f(x, y)
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

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
Step 1 — Find the first partial derivativesCompute fx = 3x² − 3 and fy = 2y.
2
Step 2 — Set both partial derivatives equal to zeroFrom 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
Step 3 — Compute the second partial derivativesfxx = 6x, fyy = 2, and fxy = 0.
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
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.

Strengths & Limitations of the Second Derivative Test

Strengths vs. 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 f_x = 0 and f_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.
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.

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).

Two-Variable Test vs. General Hessian Analysis
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)

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.

Practice Problems

PROBLEM 1CONCEPTUAL
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.
PROBLEM 2BASIC CALCULATION
Find and classify all critical points of f(x, y) = x² + y² − 4x − 6y + 13.
PROBLEM 3INTERMEDIATE
Find and classify all critical points of f(x, y) = x³ + y³ − 3xy.
PROBLEM 4APPLIED
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?
PROBLEM 5CRITICAL 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?

Lesson 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