Tutorials › Calculus III › The Three-Variable Second Derivative Test

Critical Points and Local Extrema · Tutorial 415 of 999

The Three-Variable Second Derivative Test

Use the Hessian’s quadratic form and the second-order Taylor expansion to classify nondegenerate critical points in three variables.

Intermediate 10 min read

What You'll Learn

  • State the hypotheses and conclusions of the three-variable second derivative test
  • Relate the Hessian matrix to the quadratic term in Taylor expansion
  • Prove that positive definiteness yields a strict local minimum
  • Prove that negative definiteness yields a strict local maximum
  • Use directions of opposite signs to rule out extrema for an indefinite Hessian
  • Recognize why a semidefinite Hessian does not settle the classification

Why the Hessian classifies a critical point

At a critical point, the first-order change in a function vanishes. The next term in its local Taylor expansion is therefore the main candidate for determining whether nearby function values lie above or below the value at the point. In three variables, that second-order term is a quadratic form built from the Hessian matrix.

The three-variable second derivative test makes this idea precise. A positive definite Hessian gives a strict local minimum, and a negative definite Hessian gives a strict local maximum. If the Hessian is indefinite, changes in different directions have opposite signs, so the point is neither a local minimum nor a local maximum.

Definitions and hypotheses

Let \(f\) be a real-valued function defined on an open set containing a point \(\mathbf p=(p_1,p_2,p_3)\). Assume that \(f\) has continuous second partial derivatives near \(\mathbf p\), and that \(\mathbf p\) is a critical point: \(\nabla f(\mathbf p)=\mathbf 0\). Write \(\mathbf h=(h_1,h_2,h_3)^\top\) for a small displacement from \(\mathbf p\). The Hessian at \(\mathbf p\), denoted by \(\mathbf H_f(\mathbf p)\), is the matrix of second partial derivatives evaluated at that point.

Definition: For a symmetric matrix \(\mathbf H\), its associated quadratic form is \(Q(\mathbf h)=\mathbf h^\top\mathbf H\mathbf h\). The matrix is positive definite if \(Q(\mathbf h)>0\) for every nonzero \(\mathbf h\), negative definite if \(Q(\mathbf h)<0\) for every nonzero \(\mathbf h\), and indefinite if \(Q\) takes both positive and negative values.

The Hessian is symmetric under the stated continuity assumption on the second partial derivatives. Taylor’s theorem, in its second-order form, gives

$$ f(\mathbf p+\mathbf h) = f(\mathbf p) +\nabla f(\mathbf p)^\top\mathbf h +\frac12\mathbf h^\top\mathbf H_f(\mathbf p)\mathbf h +o(\|\mathbf h\|^2). $$

The notation \(o(\|\mathbf h\|^2)\) means that the remainder divided by \(\|\mathbf h\|^2\) tends to zero as \(\mathbf h\to\mathbf 0\), with \(\mathbf h\ne\mathbf 0\). Since \(\nabla f(\mathbf p)=\mathbf 0\), the linear term disappears. The change in \(f\) is governed by one-half of the Hessian’s quadratic form, together with a remainder that is smaller than the squared distance when \(\mathbf h\) is sufficiently small.

Theorem: Under these hypotheses, if \(\mathbf H_f(\mathbf p)\) is positive definite, then \(f\) has a strict local minimum at \(\mathbf p\). If it is negative definite, \(f\) has a strict local maximum there. If it is indefinite, \(f\) has neither a local minimum nor a local maximum there.

“Strict local minimum” means there is a radius \(\delta>0\) such that \(f(\mathbf p+\mathbf h)>f(\mathbf p)\) whenever \(0<\|\mathbf h\|<\delta\). For a strict local maximum, the inequality is reversed. These are local conclusions: the test does not claim that the function’s value at \(\mathbf p\) is an absolute extremum over its entire domain.

Why definiteness controls the Taylor expansion

The key point is that definiteness gives a uniform bound on the quadratic form in every direction, not merely a positive or negative value along selected lines. Here is a proof for positive definiteness.

1
Find a uniform positive bound.
Let \(\mathbf H=\mathbf H_f(\mathbf p)\) be positive definite. On the unit sphere, \(Q(\mathbf u)=\mathbf u^\top\mathbf H\mathbf u\) is continuous and positive. The unit sphere is compact, so \(Q\) attains a minimum \(m\), and positive definiteness ensures \(m>0\). For every nonzero \(\mathbf h\), set \(\mathbf u=\mathbf h/\|\mathbf h\|\). Then \(Q(\mathbf h)=\|\mathbf h\|^2Q(\mathbf u)\ge m\|\mathbf h\|^2\).
2
Control the Taylor remainder.
At the critical point, Taylor’s formula says \(f(\mathbf p+\mathbf h)-f(\mathbf p)=\frac12Q(\mathbf h)+R(\mathbf h)\), where \(R(\mathbf h)=o(\|\mathbf h\|^2)\). Because the remainder divided by \(\|\mathbf h\|^2\) tends to zero, there is a radius \(\delta>0\) such that \(|R(\mathbf h)|<\frac{m}{4}\|\mathbf h\|^2\) whenever \(0<\|\mathbf h\|<\delta\).
3
Conclude strict increase.
For such \(\mathbf h\), \(f(\mathbf p+\mathbf h)-f(\mathbf p)\ge\frac{m}{2}\|\mathbf h\|^2-|R(\mathbf h)|>\frac{m}{4}\|\mathbf h\|^2>0\). This is exactly the condition for a strict local minimum.

If \(\mathbf H\) is negative definite, then \(-\mathbf H\) is positive definite. Apply the preceding argument to the quadratic form with its sign reversed: the second-order term is uniformly negative, and the remainder is too small to change its sign close enough to \(\mathbf p\). Thus \(f(\mathbf p+\mathbf h)-f(\mathbf p)<0\) for all sufficiently small nonzero \(\mathbf h\), giving a strict local maximum.

For an indefinite Hessian, by definition there are vectors \(\mathbf v_+\) and \(\mathbf v_-\) such that \(Q(\mathbf v_+)>0\) and \(Q(\mathbf v_-)<0\). Along a fixed direction \(\mathbf v\), Taylor’s formula at a critical point gives

$$ f(\mathbf p+t\mathbf v)-f(\mathbf p) = \frac12t^2Q(\mathbf v)+o(t^2) \qquad (t\to 0). $$

For \(\mathbf v=\mathbf v_+\), the leading term is positive; the remainder divided by \(t^2\) tends to zero, so the whole difference is positive for all sufficiently small nonzero \(t\). For \(\mathbf v=\mathbf v_-\), the leading term is negative, and the whole difference is negative for all sufficiently small nonzero \(t\). These points approach \(\mathbf p\), so every neighborhood contains function values both above and below \(f(\mathbf p)\). That rules out both kinds of local extremum.

Worked examples

Worked Example: A strict local minimum

Consider \(f(x,y,z)=(x-1)^2+2(y+1)^2+3(z-2)^2+(x-1)^3\), and classify the critical point \(\mathbf p=(1,-1,2)\).

Set \(u=x-1\), \(v=y+1\), and \(w=z-2\). The function becomes \(f=u^2+2v^2+3w^2+u^3\). Its first partial derivatives in the original variables are \(f_x=2u+3u^2\), \(f_y=4v\), and \(f_z=6w\). At \(\mathbf p\), \(u=v=w=0\), so all three derivatives vanish.

The second partial derivatives at \(\mathbf p\) are \(f_{xx}=2\), \(f_{yy}=4\), \(f_{zz}=6\), with mixed partial derivatives equal to zero. Thus \(\mathbf H_f(\mathbf p)=\begin{pmatrix}2&0&0\\0&4&0\\0&0&6\end{pmatrix}\), and for \(\mathbf h=(u,v,w)^\top\), \(Q(\mathbf h)=2u^2+4v^2+6w^2>0\) whenever \(\mathbf h\ne\mathbf 0\).

The second derivative test therefore predicts a strict local minimum. Directly, let \(r=\|\mathbf h\|=\sqrt{u^2+v^2+w^2}\). Since \(u^2+2v^2+3w^2\ge r^2\) and \(|u^3|\le r^3\), for \(0<r<1\) we have \(f(\mathbf p+\mathbf h)-f(\mathbf p)\ge r^2-r^3=r^2(1-r)>0\). This verifies the classification. At \(\mathbf p\), \(f(\mathbf p)=0\), and the computed difference is exactly \(f(\mathbf p+\mathbf h)-f(\mathbf p)\).

Worked Example: A strict local maximum

Let \(g(x,y,z)=-x^2-2y^2-3z^2+z^3\). Classify its critical point at the origin.

The first partial derivatives are \(g_x=-2x\), \(g_y=-4y\), and \(g_z=-6z+3z^2\). Each equals zero at \((0,0,0)\). The Hessian at the origin is \(\mathbf H_g(\mathbf 0)=\begin{pmatrix}-2&0&0\\0&-4&0\\0&0&-6\end{pmatrix}\). Its quadratic form is \(Q(\mathbf h)=-2h_1^2-4h_2^2-6h_3^2<0\) for every nonzero \(\mathbf h\), so the Hessian is negative definite.

The test gives a strict local maximum. To check it directly, let \(r=\|\mathbf h\|\). Then \(g(\mathbf h)=-h_1^2-2h_2^2-3h_3^2+h_3^3\). The quadratic part is at most \(-r^2\), and \(|h_3^3|\le r^3\). Therefore, if \(0<r<1\), \(g(\mathbf h)\le-r^2+r^3=-r^2(1-r)<0=g(\mathbf 0)\). This confirms the strict local maximum.

Worked Example: An indefinite Hessian rules out an extremum

Consider \(k(x,y,z)=x^2+2xy-y^2+z^2\) at the origin. Its first partial derivatives are \(k_x=2x+2y\), \(k_y=2x-2y\), and \(k_z=2z\). They are all zero at the origin.

The Hessian there is \(\mathbf H_k(\mathbf 0)=\begin{pmatrix}2&2&0\\2&-2&0\\0&0&2\end{pmatrix}\). For \(\mathbf h=(a,b,c)^\top\), the quadratic form is \(Q(\mathbf h)=2a^2+4ab-2b^2+2c^2\). In the direction \((1,0,0)^\top\), \(Q=2>0\); in the direction \((0,1,0)^\top\), \(Q=-2<0\). Hence the Hessian is indefinite.

In fact, \(k(t,0,0)=t^2>0=k(0,0,0)\) for \(t\ne0\), whereas \(k(0,t,0)=-t^2<0=k(0,0,0)\). Both sets of points approach the origin as \(t\to0\), so every neighborhood contains values above and below the value at the origin. The point is neither a local minimum nor a local maximum.

When the test does not decide

Positive and negative definiteness give strict signs in every nonzero direction. An indefinite Hessian gives directions with both signs. A semidefinite Hessian, however, may have directions where its quadratic form is zero. In those directions the second-order term provides no sign, so higher-order terms may determine what happens. If the Hessian is only semidefinite, this test alone does not classify the point.

For example, \(q(x,y,z)=x^2+y^4+z^2\) has a critical point at the origin and a positive semidefinite Hessian there, but its behavior in the \(y\)-direction cannot be read from the quadratic term. This illustrates the limitation: the second derivative test gives a conclusion when its stated definiteness conditions hold, but failure to meet those conditions is not itself a classification.

A common mistake: using the determinant alone

In three variables, the sign of the Hessian determinant alone does not tell whether the Hessian is indefinite. For a concrete counterexample, take \(m(x,y,z)=-x^2-y^2-z^2\). Its critical point is the origin and its Hessian is \(\mathbf H_m(\mathbf 0)=-2\mathbf I\), so \(\det(\mathbf H_m(\mathbf 0))=(-2)^3=-8<0\).

A mistaken conclusion would be: “The determinant is negative, so the Hessian is indefinite and the point is a saddle.” But for every nonzero \(\mathbf h\), \(\mathbf h^\top\mathbf H_m(\mathbf 0)\mathbf h=-2\|\mathbf h\|^2<0\). The Hessian is negative definite, and \(m(\mathbf h)=-\|\mathbf h\|^2<0=m(\mathbf 0)\), so the origin is a strict local maximum. The correction is to test definiteness of the full quadratic form, rather than treating the determinant’s sign as a classification in three variables.

Using the test reliably

At a critical point, first confirm that the function has continuous second partial derivatives near the point and form its Hessian. Then determine whether the associated quadratic form is positive definite, negative definite, indefinite, or neither of the first three. The test’s conclusions follow from how that quadratic form controls the leading Taylor term:

  • Positive definite: strict local minimum.
  • Negative definite: strict local maximum.
  • Indefinite: neither local minimum nor local maximum.
  • Semidefinite: this test alone gives no classification.

The essential distinction is between what the test proves and what it leaves unresolved. Definite and indefinite Hessians settle the local classification under the stated hypotheses; a Hessian that is not in one of those categories requires additional analysis.

Check Your Understanding

Answer each question using the Taylor expansion and the definitions of definiteness.

  1. What assumptions on \(f\) and the point are required to apply the three-variable second derivative test?
  2. Why does a positive definite Hessian imply that the quadratic term has a uniform positive lower bound near the critical point?
  3. How do two directions with opposite signs of the Hessian’s quadratic form rule out a local extremum?
  4. What does a semidefinite Hessian allow the test to conclude?
  5. Why is the sign of the Hessian determinant alone insufficient to classify a three-variable critical point?