Tutorials › Linear Algebra › Common Errors With Quadratic Forms

Quadratic Forms and Definiteness · Tutorial 775 of 1000

Common Errors With Quadratic Forms

Diagnose common quadratic-form mistakes by checking the matrix representation, the coordinate transformation, and the precise hypotheses of definiteness tests.

Advanced 11 min read

What You'll Learn

  • Convert mixed-term coefficients into the correct symmetric matrix entries.
  • Recover the quadratic form represented by a nonsymmetric matrix.
  • Distinguish a change of variables by congruence from a similarity transformation.
  • Apply leading principal minor tests only under their stated hypotheses.
  • Recognize why nonnegative leading principal minors do not establish positive semidefiniteness.

Why Small Notational Errors Change the Answer

A quadratic form can be written as a polynomial or as a matrix expression, and moving between those representations requires care. A missing factor of two can change a positive definite form into an indefinite one. A nonsymmetric matrix can represent a quadratic form, but its eigenvalues do not in general classify that form. And a test using leading principal minors answers a specific question only when its hypotheses are met.

Throughout, the scalars are real. A quadratic form on \(\mathbb{R}^n\) is a function \(q:\mathbb{R}^n\to\mathbb{R}\) expressible as \(q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) for some real \(n\times n\) matrix \(\mathbf{A}\). A form is positive definite if \(q(\mathbf{x})>0\) for every \(\mathbf{x}\ne\mathbf{0}\); it is positive semidefinite if \(q(\mathbf{x})\ge0\) for every \(\mathbf{x}\). Negative definite and negative semidefinite are defined by reversing the inequalities. A form is indefinite if it takes both positive and negative values.

When the matrix is symmetric, its entries have a direct polynomial interpretation: diagonal entries give square-term coefficients, and each off-diagonal entry contributes twice to the corresponding mixed term. That factor of two is the source of the first common error.

Mixed Terms and the Correct Matrix

Definition: For a real symmetric matrix \(\mathbf{A}\), the quadratic form it represents is \(q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\). If \(\mathbf{A}=(a_{ij})\), then \(q(\mathbf{x})=\sum_i a_{ii}x_i^2+2\sum_{i<j}a_{ij}x_ix_j\). Thus, the coefficient of \(x_ix_j\) in the polynomial is \(2a_{ij}\), not \(a_{ij}\).

Worked Example: Recovering the Matrix from a Mixed Term

Write \(q(x,y)=x^2+2xy+2y^2\) as \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) with \(\mathbf{A}\) symmetric, and determine whether the form is positive definite.

Let \(\mathbf{x}=\begin{bmatrix}x\\y\end{bmatrix}\) and \(\mathbf{A}=\begin{bmatrix}a&b\\b&c\end{bmatrix}\). Multiplying gives \(x^2a+2xyb+y^2c\). Matching coefficients gives \(a=1\), \(2b=2\), and \(c=2\), so \(b=1\) and

$$ \mathbf{A}=\begin{bmatrix}1&1\\1&2\end{bmatrix}, \qquad \mathbf{x}^{\top}\mathbf{A}\mathbf{x} =x(x+y)+y(x+2y) =x^2+2xy+2y^2. $$

Completing the square gives \(q(x,y)=(x+y)^2+y^2\). If this sum is zero, then both \(y=0\) and \(x+y=0\), so \(x=0\). Thus \(q(x,y)>0\) whenever \((x,y)\ne(0,0)\). The form is positive definite.

Check: the matrix product reproduces the coefficient \(2\) on \(xy\), and the completed-square expression is positive for every nonzero pair.

The check is not merely cosmetic: using \(2\) rather than \(1\) in both off-diagonal entries would produce a coefficient of \(4\) on \(xy\), not \(2\). The resulting form would be different and could have a different definiteness classification.

What a Nonsymmetric Matrix Represents

A quadratic form may be presented using a nonsymmetric matrix, but its skew-symmetric part contributes nothing. The relevant matrix for classifying the form is the symmetric part \(\tfrac12(\mathbf{A}+\mathbf{A}^{\top})\).

Theorem: For every real square matrix \(\mathbf{A}\) and every \(\mathbf{x}\in\mathbb{R}^n\), \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\mathbf{x}^{\top}\left(\tfrac12(\mathbf{A}+\mathbf{A}^{\top})\right)\mathbf{x}\).

Proof. The scalar \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) equals its transpose. Transposing this \(1\times1\) matrix gives \((\mathbf{x}^{\top}\mathbf{A}\mathbf{x})^{\top}=\mathbf{x}^{\top}\mathbf{A}^{\top}\mathbf{x}\). Therefore \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\mathbf{x}^{\top}\mathbf{A}^{\top}\mathbf{x}\). Adding these equal expressions and dividing by \(2\) proves the identity. \(\square\)

Worked Example: Symmetrizing a Matrix Representation

Find the quadratic polynomial represented by \(\mathbf{A}=\begin{bmatrix}2&5\\1&3\end{bmatrix}\), then identify the symmetric matrix representing the same form.

With \(\mathbf{x}=\begin{bmatrix}x\\y\end{bmatrix}\), first calculate \(\mathbf{A}\mathbf{x}=\begin{bmatrix}2x+5y\\x+3y\end{bmatrix}\). Hence

$$ \mathbf{x}^{\top}\mathbf{A}\mathbf{x} =x(2x+5y)+y(x+3y) =2x^2+6xy+3y^2. $$

The symmetric part is

$$ \frac12(\mathbf{A}+\mathbf{A}^{\top}) = \frac12\begin{bmatrix}4&6\\6&6\end{bmatrix} = \begin{bmatrix}2&3\\3&3\end{bmatrix}. $$

Multiplication confirms that this symmetric matrix gives \(2x^2+6xy+3y^2\): its two off-diagonal entries contribute \(3xy+3xy=6xy\).

Check: directly, \(x(2x+5y)+y(x+3y)=2x^2+6xy+3y^2\), while the symmetric representation gives \(2x^2+2(3)xy+3y^2\), the same polynomial.

A common mistake is to classify a quadratic form by looking at the eigenvalues of the nonsymmetric matrix used to write it. The theorem shows why that is unsafe: the form is determined by the symmetric part, not by the full nonsymmetric matrix. The next example makes the distinction concrete.

Congruence Is Not Similarity

Changing variables in a quadratic form has a specific matrix rule. If \(\mathbf{x}=\mathbf{P}\mathbf{y}\), then

$$ q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x} =(\mathbf{P}\mathbf{y})^{\top}\mathbf{A}(\mathbf{P}\mathbf{y}) =\mathbf{y}^{\top}(\mathbf{P}^{\top}\mathbf{A}\mathbf{P})\mathbf{y}. $$

The matrix \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\) is obtained by congruence. In contrast, a similarity transformation has the form \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) and describes a change of basis for a linear map. These formulas are generally different. They coincide in the orthogonal change of variables used in orthogonal diagonalization, because an orthogonal matrix satisfies \(\mathbf{P}^{-1}=\mathbf{P}^{\top}\); for a general invertible \(\mathbf{P}\), that equality does not hold.

Theorem: If \(\mathbf{A}\) is a real symmetric matrix and \(\mathbf{P}\) is an invertible real matrix, then the form with matrix \(\mathbf{A}\) is positive definite if and only if the form with matrix \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\) is positive definite. The same equivalence holds for positive semidefinite, negative definite, and negative semidefinite forms.

Proof. For every \(\mathbf{y}\), the transformed form has value \(\mathbf{y}^{\top}\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\mathbf{y}=(\mathbf{P}\mathbf{y})^{\top}\mathbf{A}(\mathbf{P}\mathbf{y})\). Because \(\mathbf{P}\) is invertible, \(\mathbf{P}\mathbf{y}\ne\mathbf{0}\) whenever \(\mathbf{y}\ne\mathbf{0}\), and every nonzero \(\mathbf{x}\) equals \(\mathbf{P}\mathbf{y}\) for the nonzero vector \(\mathbf{y}=\mathbf{P}^{-1}\mathbf{x}\). Thus the two forms have the same sign on corresponding nonzero vectors, in both directions. Replacing “positive” by “nonnegative,” “negative,” or “nonpositive” gives the other stated conclusions. \(\square\)

Worked Example: A Similar Matrix Can Give a Different Quadratic Form

Take \(\mathbf{A}=\begin{bmatrix}1&0\\0&4\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\). Compare the congruence and similarity transformations.

First, \(\mathbf{P}^{\top}=\begin{bmatrix}1&0\\2&1\end{bmatrix}\). Multiplying gives

$$ \mathbf{A}\mathbf{P} =\begin{bmatrix}1&2\\0&4\end{bmatrix}, \qquad \mathbf{P}^{\top}\mathbf{A}\mathbf{P} =\begin{bmatrix}1&2\\2&8\end{bmatrix}. $$

The congruence matrix represents \(x^2+4xy+8y^2\). In fact, substituting \(\mathbf{x}=\mathbf{P}\mathbf{y}\), so \(x=y_1+2y_2\) and \(y=y_2\), into the original form \(x^2+4y^2\) gives \((y_1+2y_2)^2+4y_2^2=y_1^2+4y_1y_2+8y_2^2\), as required.

Now \(\mathbf{P}^{-1}=\begin{bmatrix}1&-2\\0&1\end{bmatrix}\), so the similarity transformation gives

$$ \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \begin{bmatrix}1&-6\\0&4\end{bmatrix}. $$

If this last matrix is used in a quadratic expression, it gives \(u^2-6uv+4v^2\). At \((u,v)=(3,1)\), this value is \(9-18+4=-5\). Thus the expression is not positive definite, even though the original form \(x^2+4y^2\) is positive definite.

Check: multiplying \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) gives \(\begin{bmatrix}1&-6\\0&4\end{bmatrix}\); its quadratic expression at \((3,1)\) is indeed \(-5\). It is the congruence matrix, not the similar matrix, that represents the form after the stated variable substitution.

Leading Principal Minors: Check the Hypotheses

For an \(n\times n\) matrix \(\mathbf{A}\), its \(k\)th leading principal minor is \(\Delta_k\), the determinant of the submatrix in the first \(k\) rows and first \(k\) columns. For a real symmetric matrix, Sylvester’s criterion says that the form is positive definite if and only if \(\Delta_k>0\) for every \(k=1,\dots,n\). The symmetry hypothesis and the strict inequalities both matter. The criterion is not a test for positive semidefiniteness, and merely checking one leading minor cannot establish positive definiteness.

Worked Example: Nonnegative Leading Minors Do Not Prove Positive Semidefiniteness

Consider the symmetric matrix \(\mathbf{A}=\begin{bmatrix}0&0&1\\0&0&0\\1&0&0\end{bmatrix}\). Its leading principal minors are \(\Delta_1=0\), \(\Delta_2=0\), and \(\Delta_3=0\). Thus they are all nonnegative, but that does not establish that the form is positive semidefinite.

Indeed, its quadratic form is \(q(x,y,z)=2xz\). At \(\mathbf{x}=\begin{bmatrix}1\\0\\-1\end{bmatrix}\), the value is \(-2\), so the form is not positive semidefinite. At \(\begin{bmatrix}1\\0\\1\end{bmatrix}\), the value is \(2\), so it is indefinite.

Check: multiplying \(\mathbf{A}\mathbf{x}\) for \(\mathbf{x}=(1,0,-1)^{\top}\) gives \((-1,0,1)^{\top}\), and \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=-1-1=-2\). This directly verifies the negative value.

The opposite error is to apply the positive-definite test to a matrix that is not symmetric, even when the question concerns the quadratic form it represents. First replace that matrix by its symmetric part; then use a definiteness criterion with the correct hypotheses. For positive definiteness, the leading principal minors must all be strictly positive. For positive semidefiniteness, nonnegative leading principal minors alone are not enough, as the example shows.

A Reliable Diagnostic Routine

When a quadratic-form calculation seems inconsistent, separate the representation from the classification. Use this sequence of checks:

1
Match coefficients.
For a symmetric matrix, verify that an off-diagonal entry is half the coefficient of the associated mixed term.
2
Symmetrize if needed.
Replace a nonsymmetric matrix \(\mathbf{A}\) by \(\tfrac12(\mathbf{A}+\mathbf{A}^{\top})\) when classifying the form \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\).
3
Identify the transformation.
A variable substitution \(\mathbf{x}=\mathbf{P}\mathbf{y}\) gives the congruence matrix \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\), not generally the similar matrix \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).
4
Check the test’s assumptions.
Use Sylvester’s criterion for positive definiteness only with a symmetric matrix and all leading principal minors strictly positive.

The safest final check is to evaluate the polynomial and the matrix expression on the same vector, or to substitute the proposed change of variables directly. A single carefully chosen vector can expose a false definiteness claim: if a purportedly positive semidefinite form takes a negative value, the claim is disproved. Conversely, one positive value does not prove positive definiteness; that requires a valid argument covering every nonzero vector.

Check Your Understanding

For each question, state the relevant hypothesis or calculation that decides the issue.

  1. What symmetric matrix represents \(3x^2-8xy+5y^2\)?
  2. For \(\mathbf{A}=\begin{bmatrix}2&7\\1&4\end{bmatrix}\), find the symmetric matrix representing \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\).
  3. If \(\mathbf{x}=\mathbf{P}\mathbf{y}\), which matrix represents the transformed quadratic form, and why is it not generally a similarity transformation?
  4. Why do nonnegative leading principal minors alone fail to prove positive semidefiniteness? Give a vector witnessing the failure for the three-by-three example above.
  5. State the symmetry and minor conditions required to use Sylvester’s criterion for positive definiteness.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon