Critical Points and the Second-Derivative Test
Learning Objectives
- Define local and absolute extrema and critical points of a function of two variables, and state Fermat's theorem with its hypotheses.
- Compute the Hessian matrix and the discriminant , and apply the second-derivative test with every hypothesis checked.
- Recognize a saddle point, compute its Hessian, and explain why the test says nothing when .
- Find absolute extrema of a continuous function on a closed, bounded region by comparing interior critical points with the boundary.
- Use the Hessian to confirm that the solution of the least-squares equations is a minimum.
Context & Motivation
Optimization asks for the largest or smallest value of a quantity, and the first move in several variables is the one that gradients-extending-derivatives-to-several-variables describes: set . That lesson also warns, correctly, that a vanishing gradient only produces a candidate, which may be a minimum, a maximum or a saddle, and it leaves the distinguishing test out of scope. This lesson supplies it. In one variable the tool is the second-derivative test from extrema-concavity-and-optimization: at a flat point means a bowl. With two variables, curvature depends on direction, so a single number becomes a matrix of second partials, the Hessian, and the test reads its sign pattern.
This is also the language of machine learning, where the loss is a function of many parameters. A flat point of the loss with curvature of both signs is a saddle, where the gradient is small and gradient descent slows. Whether a model's loss has a single bottom, as in least squares with independent columns, or a landscape of competing valleys is a question about the Hessian.
Core Theory
Critical points and Fermat's theorem
has a local minimum at if for all near , and an absolute minimum if this holds on the whole domain. Maxima are the reverse.
Fermat's theorem. If has a local extremum at an interior point and and exist there, then . The proof is one line: has a local extremum at , so its derivative must vanish, and the same holds in .
A critical point is an interior point where both partials are zero or at least one does not exist. Extrema occur only at critical points (or on the boundary), but the converse is false. The origin is critical for and is neither a maximum nor a minimum. And points where partials fail to exist count: has its minimum at the origin, where no partial derivative exists.
The Hessian and what it measures
When the second partials are continuous, Clairaut's theorem makes the Hessian symmetric:
The reason it matters is the second-order Taylor expansion at a critical point. For a displacement , with the gradient term zero,
So near a critical point, . When the sign of this quadratic form decides the behavior; when is degenerate (Example 2 has ) it says too little. The form is positive for every exactly when both eigenvalues of are positive (a bowl), negative for every when both are negative (a dome), and takes both signs when the eigenvalues have opposite signs (a saddle). Since is the product of the eigenvalues and their sum, this is a sign test.
The second-derivative test
Theorem. Suppose has continuous second partials on a disk around and . Then:
- if and , has a local minimum at ;
- if and , a local maximum;
- if , a saddle point: rises in some directions and falls in others;
- if , the test gives no information.
For the eigenvalues share a sign, and tells which. For they have opposite signs. In variables the same logic applies to the eigenvalues of the Hessian: all positive means a local minimum, all negative a local maximum, eigenvalues of both signs a saddle (even if another eigenvalue is zero), and a zero eigenvalue is inconclusive only when the nonzero ones share one sign.
Absolute extrema on a closed region
Extreme Value Theorem. If is continuous on a closed and bounded set , it attains an absolute maximum and an absolute minimum on . Then find them by: (1) listing the interior critical points; (2) examining on the boundary, usually by parametrizing it and using one-variable calculus including the endpoints; (3) comparing all the values. Both hypotheses matter. On the open unit disk, has supremum that is never attained, and on the whole plane has no maximum or minimum at all.
Worked Examples
Example 1: a saddle and a minimum
Let . Then and . Setting both to zero gives and , so , whose real solutions are and . The critical points are and . The Hessian is
At : , , a saddle. The eigenvalues are along and along . This predicts what happens: on , falls, while on , rises. The numbers agree:
textstep e f(e, e) f(e, -e) 0.1 -0.0280 0.0300 0.01 -0.000298 0.000300
At : , and , a local minimum with and eigenvalues and . It is not an absolute minimum: , and is unbounded below. The test is a local statement.
The saddle also shows up in the contour picture. The level set is , the folium of Descartes: a loop plus two unbounded branches, crossing itself at the origin. This is the situation from directional-derivatives-and-the-direction-of-steepest-ascent in which and the level set has no single tangent.
Example 2: when decides nothing
At the origin, , and all have and . The first has a minimum, the second a maximum, the third a saddle (it rises along the -axis and falls along the -axis). The same test result covers three different behaviors, so a degenerate Hessian needs higher-order terms or a direct argument, for instance restricting to lines and curves through the point and comparing signs, as the -axis and -axis do for the third function. Even , with , has though it has a minimum.
Example 3: least squares has one bottom
Fit a line to the points , , by minimizing the squared error
Setting and (the normal equations of least-squares-via-linear-algebra) gives and . The Hessian is , with and , so it is a local minimum, with eigenvalues about and . The columns of the design matrix are independent because the are not all equal, which is what makes . Because is quadratic its Hessian is the same at every point and the second-order expansion is exact: . This is an absolute minimum, with .
Example 4: absolute extrema on a disk
Find the extrema of on , a closed bounded disk, so the Extreme Value Theorem applies.
Interior. and give , inside the disk, with .
Boundary. Let , and . Since ,
Its derivative vanishes at (value ), and the endpoints give at and at . The interval endpoints must be tested too.
Compare. The values are , , , . The absolute minimum is at and the absolute maximum is at , since means and . A brute-force grid over the disk finds the same extremes.
Common Misconceptions & Pitfalls
- " means an extremum." Example 1 has a saddle with zero gradient. Check the sign pattern of the Hessian.
- " means a minimum." Maxima also have . The sign of separates them.
- " means a saddle." It means the test fails, and Example 2 shows all three outcomes.
- "A local minimum is the minimum." The local minimum at in Example 1 has value , yet takes values as low as .
- "Optimizing on a region means solving ." The absolute extremum often sits on the boundary, as the maximum in Example 4 does.
- "Critical points are only where the gradient vanishes." They include points where a partial derivative fails to exist, like the tip of a cone.
- "Saddles are exotic." Any critical point whose curvature has both signs is one, and gradient descent moves slowly near it because the gradient is small there.
Summary
A critical point of is an interior point where the gradient vanishes or does not exist, and by Fermat's theorem every interior local extremum is critical, but not every critical point is an extremum. At a critical point where has continuous second partials, the Hessian decides in the usual case: with gives a local minimum, with a local maximum, a saddle, and no conclusion. The reason is that near the point is approximately the quadratic form , whose shape is read from the eigenvalues when . The test is local, so absolute extrema on a closed bounded region come from the Extreme Value Theorem: compare interior critical points with the values on the boundary. With this the multivariable unit of derivatives is complete, and double-integrals-cartesian-and-polar moves on to integration over regions.