Tutorials › Real Analysis › Second Derivative Test

Multivariable Analysis · Tutorial 799 of 1000

Second Derivative Test

Use the Hessian quadratic form at a critical point to determine when second-order information guarantees a strict local extremum or rules one out.

Advanced 9 min read

What You'll Learn

  • State the second derivative test for a critical point in several variables.
  • Distinguish positive definite, negative definite, indefinite, and semidefinite Hessians.
  • Prove why definite Hessians guarantee strict local extrema.
  • Use the determinant test to classify nondegenerate critical points of functions of two variables.
  • Recognize when a degenerate Hessian makes the test inconclusive.
  • Compare functions with the same Hessian at a point but different local behavior.

Classifying Critical Points with Second-Order Information

At a critical point, the gradient vanishes, so the first-order approximation does not distinguish a local minimum from a local maximum or a saddle point. The Hessian supplies the next-order information: its quadratic form describes the leading change in the function along small displacements. The Second-Order Necessary Condition for a Local Extremum, introduced earlier in this course, says that the Hessian quadratic form must be nonnegative at a local minimum and nonpositive at a local maximum. The Second Derivative Test strengthens this observation when the quadratic form has a strict sign in every nonzero direction.

In this tutorial, assume that \(f:U\to\mathbb{R}\), where \(U\subseteq\mathbb{R}^n\) is open, has continuous second partial derivatives near a point \(a\in U\). This regularity ensures that the Hessian is symmetric and that the second-order Taylor formula applies. The test concerns critical points, meaning points where \(\nabla f(a)=0\).

Definiteness of the Hessian

The Hessian acts on a direction \(v\) through the scalar \(v^T H_f(a)v\). Its sign in every direction, rather than the sign of any one entry, determines whether the second-order change consistently points upward, downward, or in different directions.

Definition: A symmetric matrix \(H\) is positive definite if \(v^THv>0\) for every nonzero vector \(v\). It is negative definite if \(v^THv<0\) for every nonzero \(v\). It is indefinite if there are nonzero vectors \(u\) and \(v\) such that \(u^THu>0\) and \(v^THv<0\). A matrix is positive semidefinite if its quadratic form is nonnegative for every vector, and negative semidefinite if its quadratic form is nonpositive for every vector.

The word “definite” matters: positive definiteness excludes zero values in every nonzero direction, while positive semidefiniteness allows them. The same distinction applies to negative definite and negative semidefinite matrices. The strict classification in the test below relies on definiteness.

Theorem (Second Derivative Test): Suppose \(f\) has continuous second partial derivatives near \(a\), and \(\nabla f(a)=0\).
  • If \(H_f(a)\) is positive definite, then \(a\) is a strict local minimum.
  • If \(H_f(a)\) is negative definite, then \(a\) is a strict local maximum.
  • If \(H_f(a)\) is indefinite, then \(a\) is neither a local minimum nor a local maximum.
If \(H_f(a)\) is positive or negative semidefinite but not definite, the test may be inconclusive.

Proof. By the Taylor Formula with Peano Remainder from earlier in the course, and because \(\nabla f(a)=0\), for \(h\) sufficiently small we have

$$ f(a+h)-f(a)=\frac12 h^T H_f(a)h+r(h), \qquad \frac{r(h)}{\|h\|_2^2}\longrightarrow 0 \quad\text{as }h\to 0,\ h\ne 0. $$

First suppose \(H_f(a)\) is positive definite. On the unit sphere, \(u\mapsto u^TH_f(a)u\) is continuous and positive. There is a constant \(c>0\) such that \(u^TH_f(a)u\ge c\) for every unit vector \(u\). To see why the lower bound is strictly positive, if no such \(c\) existed, there would be unit vectors \(u_k\) with \(u_k^TH_f(a)u_k\to0\). The unit sphere is compact by the Heine–Borel Theorem, so a subsequence would converge to a unit vector \(u\). Continuity would give \(u^TH_f(a)u=0\), contradicting positive definiteness.

For any nonzero \(h\), apply this bound to \(u=h/\|h\|_2\). It follows that \(h^TH_f(a)h\ge c\|h\|_2^2\). Because \(r(h)=o(\|h\|_2^2)\), there is a radius \(\delta>0\) such that \(0<\|h\|_2<\delta\) implies \(|r(h)|<(c/4)\|h\|_2^2\). Therefore

$$ f(a+h)-f(a) \ge \frac{c}{2}\|h\|_2^2-|r(h)| > \frac{c}{4}\|h\|_2^2>0. $$

Thus \(f(a+h)>f(a)\) for all sufficiently small nonzero \(h\), proving that \(a\) is a strict local minimum. If \(H_f(a)\) is negative definite, apply the positive-definite argument to \(-f\), whose Hessian is \(-H_f(a)\). This proves that \(a\) is a strict local maximum of \(f\).

Finally, suppose \(H_f(a)\) is indefinite. Choose nonzero directions \(u\) and \(v\) with \(u^TH_f(a)u>0\) and \(v^TH_f(a)v<0\). Along the first line, Taylor’s formula gives

$$ f(a+tu)-f(a)=\frac{t^2}{2}u^TH_f(a)u+o(t^2)>0 $$

for all sufficiently small nonzero \(t\). Along the second line the corresponding expression is negative for all sufficiently small nonzero \(t\). Every neighborhood of \(a\) therefore contains points where \(f\) is above \(f(a)\) and points where it is below \(f(a)\). Hence \(a\) is neither a local minimum nor a local maximum. \(\square\)

Worked Examples in Two Variables

For \(f(x,y)\), write the symmetric Hessian at a critical point as \(H=\begin{pmatrix}A&B\\B&C\end{pmatrix}\), and let \(D=AC-B^2\). When \(A\ne0\), its quadratic form can be written as

$$ Ax^2+2Bxy+Cy^2 = A\left(x+\frac{B}{A}y\right)^2+\frac{D}{A}y^2. $$

This identity gives a useful two-variable version of the test. If \(D>0\), then \(A\ne0\), and both terms have the sign of \(A\), so the Hessian is positive definite when \(A>0\) and negative definite when \(A<0\). If \(D<0\) and \(A\ne0\), the two coefficients \(A\) and \(D/A\) have opposite signs, so the quadratic form takes both signs. If \(A=0\), then \(D=-B^2<0\) forces \(B\ne0\), and the form \(2Bxy+Cy^2\) takes both signs by setting \(y=1\) and taking \(x\) sufficiently large with either sign. Thus \(D<0\) gives an indefinite Hessian. When \(D=0\), this determinant test does not establish definiteness.

Worked Example: A Strict Local Minimum

Consider \(f(x,y)=2x^2+2xy+2y^2\). Its gradient is \(\nabla f(x,y)=(4x+2y,2x+4y)\), which vanishes at \((0,0)\). The Hessian is

$$ H_f(0,0)= \begin{pmatrix}4&2\\2&4\end{pmatrix}, \qquad D=4\cdot4-2^2=12>0. $$

Here \(A=4>0\), so the two-variable test says the Hessian is positive definite. Directly, its quadratic form is \(4x^2+4xy+4y^2=4(x+y/2)^2+3y^2\), which is strictly positive unless \(x=y=0\). The Second Derivative Test therefore gives a strict local minimum at \((0,0)\). In fact, the quadratic form equals \(2f(x,y)\), so this example also verifies directly that \(f(x,y)>f(0,0)=0\) whenever \((x,y)\ne(0,0)\).

Worked Example: A Strict Local Maximum

Let \(g(x,y)=-3x^2+2xy-2y^2\). Its gradient is \(\nabla g(x,y)=(-6x+2y,2x-4y)\), which vanishes at the origin. Its Hessian and determinant are

$$ H_g(0,0)= \begin{pmatrix}-6&2\\2&-4\end{pmatrix}, \qquad D=(-6)(-4)-2^2=20>0. $$

Since \(A=-6<0\), the Hessian is negative definite. The Second Derivative Test gives a strict local maximum at \((0,0)\). For a direct check, the quadratic form is \(-6x^2+4xy-4y^2=-6(x-y/3)^2-\frac{10}{3}y^2\), which is negative for every nonzero \((x,y)\). Thus \(g(x,y)<g(0,0)=0\) away from the origin.

Worked Example: A Saddle Point

Take \(q(x,y)=x^2-5y^2\). The gradient \(\nabla q(x,y)=(2x,-10y)\) vanishes at \((0,0)\), and

$$ H_q(0,0)= \begin{pmatrix}2&0\\0&-10\end{pmatrix}, \qquad D=2(-10)-0^2=-20<0. $$

The Hessian is indefinite. The function takes positive values along the \(x\)-axis, since \(q(t,0)=t^2>0\) for \(t\ne0\), and negative values along the \(y\)-axis, since \(q(0,t)=-5t^2<0\) for \(t\ne0\). The origin is therefore a saddle point: it is neither a local minimum nor a local maximum.

When the Test Is Inconclusive

A zero determinant in two variables does not mean that the point is not an extremum. It means that this second-order test has not decided the question. A direction in which the Hessian quadratic form is zero may leave the behavior to higher-order terms. The following functions have the same Hessian at the origin, yet behave differently there.

Worked Example: The Same Degenerate Hessian, Different Outcomes

First let \(p(x,y)=x^4+y^4\). Its gradient is \((4x^3,4y^3)\), which vanishes at the origin. Every entry of its Hessian at the origin is zero, so the Hessian is positive semidefinite but not positive definite. Nevertheless, \(p(x,y)>0=p(0,0)\) for every \((x,y)\ne(0,0)\). The origin is a strict local minimum (indeed, a global minimum), but the Second Derivative Test alone does not establish it.

Now let \(s(x,y)=x^4-y^4\). Its gradient also vanishes at the origin, and its Hessian there is again the zero matrix. Along the \(x\)-axis, \(s(t,0)=t^4>0\) for \(t\ne0\); along the \(y\)-axis, \(s(0,t)=-t^4<0\). The origin is neither a local minimum nor a local maximum. The Hessian at the origin is identical for \(p\) and \(s\), but it does not distinguish their different behavior. Higher-order terms do.

At a local minimum, the Second-Order Necessary Condition for a Local Extremum requires \(v^TH_f(a)v\ge0\) for every \(v\); at a local maximum, it requires \(v^TH_f(a)v\le0\) for every \(v\). Consequently, an indefinite Hessian rules out both kinds of local extremum, while a semidefinite Hessian is compatible with an extremum but does not guarantee one. Do not confuse these necessary conditions with the sufficient conclusions of the Second Derivative Test.

For a practical classification, first verify that the point is critical and that the regularity assumptions hold. Then evaluate the Hessian quadratic form, or in two variables use its determinant and the sign of \(f_{xx}\). A definite Hessian gives a strict extremum; an indefinite Hessian gives neither type of extremum; a degenerate, semidefinite case calls for further analysis, such as examining higher-order terms or comparing function values directly.

Check Your Understanding

Use the hypotheses and conclusions of the Second Derivative Test to answer the following questions.

  1. Why does positive definiteness of the Hessian at a critical point imply a strict local minimum rather than only a non-strict one?
  2. What does an indefinite Hessian establish about whether a critical point is a local minimum or local maximum?
  3. For a symmetric two-variable Hessian with \(D<0\), why must its quadratic form take both positive and negative values?
  4. What conclusion can be drawn from \(D>0\) and \(f_{xx}(a)<0\) at a critical point of a function of two variables?
  5. Why does a zero Hessian at a critical point fail to determine whether that point is a local extremum?
  6. What does the Second-Order Necessary Condition require of the Hessian at a local minimum?