Tutorials › Calculus III › Why the Two-Variable Determinant Test Works

Critical Points and Local Extrema · Tutorial 408 of 999

Why the Two-Variable Determinant Test Works

Learn how orthogonal diagonalization turns the Hessian determinant test into a statement about the signs of the quadratic term’s eigenvalues.

Intermediate 9 min read

What You'll Learn

  • Derive the eigenvalues of a symmetric two-by-two Hessian.
  • Explain why its determinant is the product of its eigenvalues.
  • Use orthonormal eigenvector coordinates to express the quadratic form.
  • Connect the signs of the eigenvalues to the local second-order behavior.
  • Apply the determinant test and identify what a positive determinant alone does not tell you.

Why the Determinant Appears in the Test

A second-derivative test for a function of two variables uses a short calculation involving the Hessian determinant. The calculation is useful, but its meaning is easier to remember when we see what the Hessian does to directions near a critical point.

The key idea is to choose orthonormal directions in which the Hessian’s quadratic form has no mixed term. In those coordinates, the form is a sum of two squares, each multiplied by an eigenvalue. The signs of those eigenvalues tell us whether the second-order change is positive, negative, or of both signs.

Core idea: For a symmetric two-by-two Hessian, the determinant is the product of its two eigenvalues. A positive product means the eigenvalues have the same sign; a negative product means they have opposite signs.

The Hessian and Its Quadratic Form

Let \(f\) have continuous second partial derivatives near a critical point \((a,b)\), so that \(\nabla f(a,b)=\mathbf{0}\). Its Hessian at that point is the symmetric matrix

$$ \mathbf{H} = \begin{pmatrix} A & B\\ B & C \end{pmatrix} = \begin{pmatrix} f_{xx}(a,b) & f_{xy}(a,b)\\ f_{xy}(a,b) & f_{yy}(a,b) \end{pmatrix}. $$

The equality of the mixed partials follows from their continuity. For a displacement \(\mathbf{h}=(h_1,h_2)\), the Hessian’s quadratic form is

$$ Q(\mathbf{h})=\mathbf{h}^{\top}\mathbf{H}\mathbf{h} =Ah_1^2+2Bh_1h_2+Ch_2^2. $$

The second-order Taylor expansion at the critical point is

$$ f\bigl((a,b)+\mathbf{h}\bigr) = f(a,b)+\frac12 Q(\mathbf{h})+o(\|\mathbf{h}\|^2) \quad\text{as }\mathbf{h}\to\mathbf{0}. $$

The linear term is absent because the gradient is zero. Thus, when the quadratic form is strictly positive in every nonzero direction, the leading change in \(f\) is positive; when it is strictly negative in every nonzero direction, the leading change is negative.

Definition: The Hessian determinant at \((a,b)\) is \(D=AC-B^2\). It is the determinant of \(\mathbf{H}\), not a separate derivative.

Diagonalizing a Symmetric Two-by-Two Matrix

We now show why orthonormal coordinates remove the mixed term. The eigenvalues of \(\mathbf{H}\) satisfy its characteristic equation:

$$ \det(\mathbf{H}-\lambda\mathbf{I}) = \begin{vmatrix} A-\lambda & B\\ B & C-\lambda \end{vmatrix} = \lambda^2-(A+C)\lambda+(AC-B^2)=0. $$

The discriminant of this quadratic is \((A-C)^2+4B^2\), which is nonnegative. Therefore its eigenvalues are real. If they are distinct, corresponding eigenvectors are orthogonal: if \(\mathbf{H}\mathbf{e}_1=\lambda_1\mathbf{e}_1\) and \(\mathbf{H}\mathbf{e}_2=\lambda_2\mathbf{e}_2\), symmetry gives

$$ \lambda_1\mathbf{e}_1^{\top}\mathbf{e}_2 =(\mathbf{H}\mathbf{e}_1)^{\top}\mathbf{e}_2 =\mathbf{e}_1^{\top}\mathbf{H}\mathbf{e}_2 =\lambda_2\mathbf{e}_1^{\top}\mathbf{e}_2. $$

Since \(\lambda_1\ne\lambda_2\), this implies \(\mathbf{e}_1^{\top}\mathbf{e}_2=0\). Normalize the eigenvectors to unit length. If the eigenvalues are repeated, the discriminant is zero, so \(A=C\) and \(B=0\); in that case \(\mathbf{H}=A\mathbf{I}\), and any orthonormal pair of directions works.

Let \(\mathbf{e}_1,\mathbf{e}_2\) be an orthonormal eigenvector pair with eigenvalues \(\lambda_1,\lambda_2\). Write a displacement in these directions as \(\mathbf{h}=u\mathbf{e}_1+v\mathbf{e}_2\). Orthogonality and the eigenvector equations give the diagonal form:

$$ Q(\mathbf{h}) =\lambda_1u^2+\lambda_2v^2. $$

This expression reveals the directional behavior directly. If both eigenvalues are positive, every nonzero displacement has \(Q>0\). If both are negative, every nonzero displacement has \(Q<0\). If they have opposite signs, the form takes both positive and negative values along its eigenvector directions.

Deriving the Determinant Test

The characteristic polynomial also shows that the product of the eigenvalues is the constant term:

$$ \lambda_1\lambda_2=AC-B^2=D. $$

So the sign of \(D\) tells us whether the eigenvalues have the same sign or opposite signs, provided \(D\ne 0\). When \(D>0\), they have the same sign. In that case, \(A\) has that sign too: if \(\mathbf{w}\) is the unit vector in the first coordinate direction, then \(A=\mathbf{w}^{\top}\mathbf{H}\mathbf{w}\). Expressing \(\mathbf{w}\) in the orthonormal eigenvector directions makes this a sum of the eigenvalues weighted by nonnegative squared coordinates. If both eigenvalues are positive, this sum is positive; if both are negative, it is negative.

Theorem: Suppose \(f\) has continuous second partial derivatives near a critical point \((a,b)\). Let \(D=f_{xx}(a,b)f_{yy}(a,b)-[f_{xy}(a,b)]^2\). If \(D>0\), then \(f_{xx}(a,b)>0\) gives a strict local minimum, while \(f_{xx}(a,b)<0\) gives a strict local maximum. If \(D<0\), the Hessian quadratic form takes both positive and negative values.

For the strict-extremum conclusions, the Taylor remainder matters as well as the quadratic form. For example, if both eigenvalues are positive, let \(m=\min(\lambda_1,\lambda_2)>0\). Then \(Q(\mathbf{h})\ge m\|\mathbf{h}\|^2\). The remainder is \(o(\|\mathbf{h}\|^2)\), so sufficiently close to \(\mathbf{0}\) its magnitude is less than \(\frac{m}{4}\|\mathbf{h}\|^2\). Consequently, the change in \(f\) is at least \(\frac{m}{2}\|\mathbf{h}\|^2-\frac{m}{4}\|\mathbf{h}\|^2>0\) for nonzero sufficiently small \(\mathbf{h}\). This proves a strict local minimum. Reversing the signs proves the strict local maximum case.

1
Find the Hessian at the critical point.
Use the second partial derivatives, with the two mixed entries equal under the stated continuity assumption.
2
Compute \(D=AC-B^2\).
This is the product of the eigenvalues, so it determines whether their signs agree or differ when \(D\ne 0\).
3
If \(D>0\), check \(A=f_{xx}(a,b)\).
Its sign identifies whether both eigenvalues are positive or both are negative.
4
Relate the quadratic form to nearby function values.
The Taylor expansion at a critical point makes the second-order term govern the local change when the eigenvalues are nonzero.

Worked Examples

Worked Example: A Positive-Definite Hessian

Consider \(f(x,y)=\frac12(3x^2+4xy+3y^2)\) at \((0,0)\). Its first partial derivatives are \(f_x=3x+2y\) and \(f_y=2x+3y\), so the origin is critical. The Hessian and its determinant are

$$ \mathbf{H}= \begin{pmatrix}3&2\\2&3\end{pmatrix}, \qquad D=3\cdot3-2\cdot2=9-4=5. $$

The characteristic equation is \(\lambda^2-6\lambda+5=0=(\lambda-5)(\lambda-1)\), so the eigenvalues are \(5\) and \(1\). Unit eigenvectors are \(\mathbf{e}_1=(1,1)/\sqrt2\) and \(\mathbf{e}_2=(1,-1)/\sqrt2\). Define \(u=(x+y)/\sqrt2\) and \(v=(x-y)/\sqrt2\). Then \(x^2+y^2=u^2+v^2\) and \(xy=(u^2-v^2)/2\), giving

$$ f(x,y) =\frac12\left(3(x^2+y^2)+4xy\right) =\frac12(5u^2+v^2). $$

Both eigenvalues are positive, and \(D>0\) with \(f_{xx}(0,0)=3>0\), so the test gives a strict local minimum. In fact, the diagonal form is positive for every \((u,v)\ne(0,0)\). Substitution checks the coordinate expression at \((x,y)=(1,0)\): there \(u=v=1/\sqrt2\), so the diagonal form gives \(\frac12(5/2+1/2)=3/2\), matching \(f(1,0)=3/2\).

Worked Example: A Negative-Definite Hessian

Let \(g(x,y)=-\frac12(3x^2+4xy+3y^2)\). Its gradient is \(\nabla g=(-3x-2y,-2x-3y)\), so the origin is critical. Here

$$ \mathbf{H}= \begin{pmatrix}-3&-2\\-2&-3\end{pmatrix}, \qquad D=(-3)(-3)-(-2)^2=9-4=5. $$

The characteristic equation is \(\lambda^2+6\lambda+5=0=(\lambda+5)(\lambda+1)\), with eigenvalues \(-5\) and \(-1\). The same unit vectors \((1,1)/\sqrt2\) and \((1,-1)/\sqrt2\) are eigenvectors, and the same coordinates \(u=(x+y)/\sqrt2,\;v=(x-y)/\sqrt2\) give

$$ g(x,y)=-\frac12(5u^2+v^2). $$

Both eigenvalues are negative. Equivalently, \(D>0\) and \(g_{xx}(0,0)=-3<0\), so the origin is a strict local maximum. As a check, at \((1,0)\) the diagonal expression is \(-\frac12(5/2+1/2)=-3/2\), which agrees with the original formula.

Worked Example: Eigenvalues of Opposite Signs

Consider \(h(x,y)=\frac12(x^2+4xy+y^2)\). Its gradient is \((x+2y,2x+y)\), so \((0,0)\) is critical. Its Hessian and determinant are

$$ \mathbf{H}= \begin{pmatrix}1&2\\2&1\end{pmatrix}, \qquad D=1\cdot1-2\cdot2=1-4=-3. $$

The characteristic equation is \(\lambda^2-2\lambda-3=0=(\lambda-3)(\lambda+1)\), so the eigenvalues are \(3\) and \(-1\). The associated unit eigenvectors are \((1,1)/\sqrt2\) and \((1,-1)/\sqrt2\). With \(u=(x+y)/\sqrt2,\;v=(x-y)/\sqrt2\), we obtain

$$ h(x,y)=\frac12(3u^2-v^2). $$

The determinant is negative, matching the opposite signs of the eigenvalues. Along the first eigenvector direction, \((x,y)=(t/\sqrt2,t/\sqrt2)\), we have \(u=t,\;v=0\), so \(h=3t^2/2>0\) for \(t\ne0\). Along the second, \((x,y)=(t/\sqrt2,-t/\sqrt2)\), we have \(u=0,\;v=t\), so \(h=-t^2/2<0\). Direct substitution gives the same results: the first point has \(x^2+4xy+y^2=3t^2\), and the second has \(x^2+4xy+y^2=-t^2\). The quadratic term therefore changes sign across directions near the critical point.

A Common Mistake: Using \(D>0\) Alone

A positive determinant does not, by itself, distinguish a minimum from a maximum. For example, let \(r(x,y)=-\frac12(3x^2+2y^2)\). At the origin its Hessian is \(\begin{pmatrix}-3&0\\0&-2\end{pmatrix}\), and \(D=(-3)(-2)-0=6>0\). A mistaken conclusion would be: “The determinant is positive, so the origin is a minimum.” But the Hessian entries give \(r(x,y)=-\frac32x^2-y^2<0=r(0,0)\) for every nonzero \((x,y)\). The origin is a strict maximum. The correction is to use \(f_{xx}\) as well as \(D\): here \(r_{xx}(0,0)=-3<0\), which identifies the maximum case.

What the Test Does—and Does Not—Say

The determinant test is a compact way to read the eigenvalue signs without calculating eigenvectors in every application. For \(D>0\), the two eigenvalues have the same sign, and \(f_{xx}\) tells which sign. For \(D<0\), they have opposite signs, so the quadratic form has directions of positive and negative second-order change. If \(D=0\), at least one eigenvalue is zero, and this second-order argument does not settle the local behavior; higher-order information may matter.

The assumptions are important. The test applies at a critical point, requires continuous second partial derivatives near that point, and yields the strict-extremum conclusions when \(D>0\). It is the Taylor expansion, together with the eigenvalue signs, that connects the matrix calculation to the behavior of the function itself.

Check Your Understanding

Use the connection between eigenvalues, the quadratic form, and the Hessian determinant to answer these questions.

  1. For \(\mathbf{H}=\begin{pmatrix}A&B\\B&C\end{pmatrix}\), what are the sum and product of its eigenvalues?
  2. Why can eigenvectors for distinct eigenvalues of a symmetric matrix be chosen orthogonal?
  3. If \(D>0\) and \(f_{xx}(a,b)<0\), what does the test conclude, and why?
  4. For what reason does \(D<0\) imply that the Hessian quadratic form takes both positive and negative values?
  5. Why does a zero determinant prevent this second-order test from deciding the local behavior?