Tutorials › Linear Algebra › The Unique Symmetric Matrix of a Quadratic Form

Quadratic Forms and Definiteness · Tutorial 757 of 1000

The Unique Symmetric Matrix of a Quadratic Form

Learn to symmetrize a matrix representing a quadratic form and prove that the resulting symmetric representation is unique.

Advanced 9 min read

What You'll Learn

  • Define real quadratic forms and symmetric matrix representations.
  • Prove that the skew-symmetric part of a matrix contributes zero to its quadratic form.
  • Construct the symmetric matrix associated with any real quadratic form.
  • Recover diagonal and off-diagonal entries from values of the form.
  • Identify and correct the factor-of-two error in cross terms.

Why a Quadratic Form Does Not Determine Every Matrix Entry

A quadratic form records the value of an expression \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\), not every entry of the matrix \(\mathbf{A}\) separately. In fact, different real matrices can give the same value for every vector \(\mathbf{x}\). Nevertheless, each real quadratic form has exactly one symmetric matrix that represents it. The key is that a quadratic expression combines the two entries on opposite sides of the diagonal: the entries \(a_{ij}\) and \(a_{ji}\) contribute together.

Throughout, \(\mathbf{x}\in\mathbb{R}^n\) is a column vector. A matrix \(\mathbf{S}\in\mathbb{R}^{n\times n}\) is symmetric if \(\mathbf{S}^{\top}=\mathbf{S}\), and a matrix \(\mathbf{K}\in\mathbb{R}^{n\times n}\) is skew-symmetric if \(\mathbf{K}^{\top}=-\mathbf{K}\). A real quadratic form is a function \(q:\mathbb{R}^n\to\mathbb{R}\) that is a homogeneous polynomial of degree two. Thus it can be written using terms \(x_i^2\) and \(x_ix_j\), with real coefficients.

Definition: A matrix \(\mathbf{A}\in\mathbb{R}^{n\times n}\) represents the quadratic form \(q\) if \(q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) for every \(\mathbf{x}\in\mathbb{R}^n\). The representation is a symmetric matrix representation when \(\mathbf{A}\) is symmetric.

Expanding the matrix product explains where the ambiguity occurs:

$$ \mathbf{x}^{\top}\mathbf{A}\mathbf{x} =\sum_{i=1}^{n}a_{ii}x_i^2+ \sum_{1\le i<j\le n}(a_{ij}+a_{ji})x_ix_j. $$

For each \(i<j\), the coefficient of \(x_ix_j\) is the sum \(a_{ij}+a_{ji}\). The quadratic form therefore cannot distinguish those entries individually. A symmetric representation assigns half of that combined coefficient to each of the two positions.

The Symmetric Part Preserves the Form

Every square real matrix can be separated into a symmetric part and a skew-symmetric part. The formula for the symmetric part is important because it works for any matrix that represents a quadratic form, even if the original matrix is not symmetric.

Theorem: Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\), and define \(\mathbf{S}=\tfrac12(\mathbf{A}+\mathbf{A}^{\top})\) and \(\mathbf{K}=\tfrac12(\mathbf{A}-\mathbf{A}^{\top})\). Then \(\mathbf{S}\) is symmetric, \(\mathbf{K}\) is skew-symmetric, \(\mathbf{A}=\mathbf{S}+\mathbf{K}\), and \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\mathbf{x}^{\top}\mathbf{S}\mathbf{x}\) for every \(\mathbf{x}\in\mathbb{R}^n\).

Proof. Taking transposes gives \(\mathbf{S}^{\top}=\tfrac12(\mathbf{A}^{\top}+\mathbf{A})=\mathbf{S}\), and \(\mathbf{K}^{\top}=\tfrac12(\mathbf{A}^{\top}-\mathbf{A})=-\mathbf{K}\). Adding their definitions gives \(\mathbf{S}+\mathbf{K}=\mathbf{A}\). It remains to show that \(\mathbf{x}^{\top}\mathbf{K}\mathbf{x}=0\). This expression is a scalar, so it equals its transpose. Therefore \((\mathbf{x}^{\top}\mathbf{K}\mathbf{x})^{\top}=\mathbf{x}^{\top}\mathbf{K}^{\top}\mathbf{x}=-\mathbf{x}^{\top}\mathbf{K}\mathbf{x}\). A real scalar equal to its own negative must be zero, so \(\mathbf{x}^{\top}\mathbf{K}\mathbf{x}=0\). Consequently \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\mathbf{x}^{\top}(\mathbf{S}+\mathbf{K})\mathbf{x}=\mathbf{x}^{\top}\mathbf{S}\mathbf{x}\) for every \(\mathbf{x}\). \(\square\)

This argument includes the case \(\mathbf{x}=\mathbf{0}\), for which both quadratic expressions are zero directly. It also shows precisely why the skew-symmetric part is invisible to a quadratic form: its contribution vanishes for every input vector, not merely for selected vectors.

Worked Example: Symmetrizing a Nonsymmetric Matrix

Let \(q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\), where \(\mathbf{x}=(x_1,x_2,x_3)^{\top}\) and

$$ \mathbf{A}= \begin{bmatrix} 2&1&4\\ 3&-1&0\\ 0&5&6 \end{bmatrix}. $$

First compute the transpose and average the two matrices:

$$ \mathbf{A}^{\top}= \begin{bmatrix} 2&3&0\\ 1&-1&5\\ 4&0&6 \end{bmatrix}, \qquad \frac{\mathbf{A}+\mathbf{A}^{\top}}{2} = \frac12 \begin{bmatrix} 4&4&4\\ 4&-2&5\\ 4&5&12 \end{bmatrix} = \begin{bmatrix} 2&2&2\\ 2&-1&\tfrac52\\ 2&\tfrac52&6 \end{bmatrix}. $$

The last matrix, \(\mathbf{S}\), is symmetric. Expanding the original product gives \(q(\mathbf{x})=2x_1^2-x_2^2+6x_3^2+4x_1x_2+4x_1x_3+5x_2x_3\). Expanding \(\mathbf{x}^{\top}\mathbf{S}\mathbf{x}\) gives the same diagonal terms and cross terms: for example, the two entries \(s_{12}=s_{21}=2\) contribute \(2x_1x_2+2x_2x_1=4x_1x_2\). The other pairs contribute \(4x_1x_3\) and \(5x_2x_3\), respectively.

Check: the skew-symmetric part is \(\mathbf{K}=\tfrac12(\mathbf{A}-\mathbf{A}^{\top})= \begin{bmatrix}0&-1&2\\1&0&-\tfrac52\\-2&\tfrac52&0\end{bmatrix}\). Its entries across the diagonal are opposites, and the cross terms cancel in \(\mathbf{x}^{\top}\mathbf{K}\mathbf{x}\). Thus \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\mathbf{x}^{\top}\mathbf{S}\mathbf{x}\), as required.

Existence and Uniqueness of the Symmetric Representation

The symmetrization theorem shows that whenever a form is already expressed as \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\), replacing \(\mathbf{A}\) by its symmetric part preserves its values. To establish the full result, we must also show that every quadratic form has a matrix representation and that no two different symmetric matrices can represent the same form.

Theorem: Every real quadratic form \(q:\mathbb{R}^n\to\mathbb{R}\) has exactly one symmetric matrix \(\mathbf{S}\in\mathbb{R}^{n\times n}\) such that \(q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{S}\mathbf{x}\) for every \(\mathbf{x}\in\mathbb{R}^n\).

Proof. Write the quadratic form by collecting its terms: \(q(\mathbf{x})=\sum_{i=1}^n c_{ii}x_i^2+\sum_{1\le i<j\le n}c_{ij}x_ix_j\). Define the entries of \(\mathbf{S}\) by \(s_{ii}=c_{ii}\) and \(s_{ij}=s_{ji}=c_{ij}/2\) when \(i<j\). These assignments make \(\mathbf{S}\) symmetric. In \(\mathbf{x}^{\top}\mathbf{S}\mathbf{x}\), the diagonal entries give \(\sum_i c_{ii}x_i^2\), and each pair of off-diagonal entries gives \(s_{ij}x_ix_j+s_{ji}x_jx_i=(c_{ij}/2)x_ix_j+(c_{ij}/2)x_ix_j=c_{ij}x_ix_j\). Thus \(\mathbf{x}^{\top}\mathbf{S}\mathbf{x}=q(\mathbf{x})\) for every \(\mathbf{x}\), proving existence.

For uniqueness, suppose symmetric matrices \(\mathbf{S}\) and \(\mathbf{T}\) represent the same form. Let \(\mathbf{e}_i\) be the vector with entry \(1\) in position \(i\) and \(0\) elsewhere. Evaluating at \(\mathbf{e}_i\) gives \(s_{ii}=q(\mathbf{e}_i)=t_{ii}\), so the diagonal entries agree. For \(i<j\), evaluate at \(\mathbf{e}_i+\mathbf{e}_j\). Symmetry gives \(q(\mathbf{e}_i+\mathbf{e}_j)=s_{ii}+2s_{ij}+s_{jj}\) and also \(q(\mathbf{e}_i+\mathbf{e}_j)=t_{ii}+2t_{ij}+t_{jj}\). Since the diagonal entries already agree, these equalities imply \(2s_{ij}=2t_{ij}\), hence \(s_{ij}=t_{ij}\). Symmetry then gives \(s_{ji}=t_{ji}\). Every entry agrees, so \(\mathbf{S}=\mathbf{T}\). This proves uniqueness. \(\square\)

The proof also gives a direct way to recover the entries of the unique symmetric matrix from values of \(q\): its diagonal entries are \(q(\mathbf{e}_i)\), and its off-diagonal entries are determined by the values at sums of two standard basis vectors.

Formula: If \(\mathbf{S}\) is the unique symmetric matrix of \(q\), then \(s_{ii}=q(\mathbf{e}_i)\) and, for \(i\ne j\), \(s_{ij}=\tfrac12\bigl(q(\mathbf{e}_i+\mathbf{e}_j)-q(\mathbf{e}_i)-q(\mathbf{e}_j)\bigr)\).

Indeed, for \(i\ne j\), symmetry gives \(q(\mathbf{e}_i+\mathbf{e}_j)=s_{ii}+2s_{ij}+s_{jj}\), while \(q(\mathbf{e}_i)=s_{ii}\) and \(q(\mathbf{e}_j)=s_{jj}\). Subtracting the last two equations and dividing by \(2\) yields the formula. This is also the coordinate form of the polarization identity: the symmetric expression \(\tfrac12(q(\mathbf{x}+\mathbf{y})-q(\mathbf{x})-q(\mathbf{y}))\) equals \(\mathbf{x}^{\top}\mathbf{S}\mathbf{y}\). To check it, expand \(q(\mathbf{x}+\mathbf{y})=(\mathbf{x}+\mathbf{y})^{\top}\mathbf{S}(\mathbf{x}+\mathbf{y})\); the two pure terms cancel on subtraction, and symmetry makes the two remaining terms equal.

Worked Example: Recovering the Matrix from the Form

Find the symmetric matrix representing \(q(\mathbf{x})=4x_1^2-6x_1x_2+2x_2^2+8x_1x_3+10x_2x_3+7x_3^2\).

Using the coefficient construction, put the coefficients of \(x_1^2,x_2^2,x_3^2\) on the diagonal. Split each cross-term coefficient equally between the two corresponding off-diagonal positions:

$$ \mathbf{S}= \begin{bmatrix} 4&-3&4\\ -3&2&5\\ 4&5&7 \end{bmatrix}. $$

For example, the coefficient \(-6\) of \(x_1x_2\) becomes the two entries \(-3\), while the coefficient \(10\) of \(x_2x_3\) becomes two entries \(5\). Expanding the matrix product gives \(4x_1^2+2x_2^2+7x_3^2+(-3-3)x_1x_2+(4+4)x_1x_3+(5+5)x_2x_3\), which is exactly the stated form.

Check by evaluations: \(q(\mathbf{e}_1)=4\), \(q(\mathbf{e}_2)=2\), and \(q(\mathbf{e}_3)=7\), agreeing with the diagonal. Also \(q(\mathbf{e}_1+\mathbf{e}_2)=4-6+2=0\), so the formula gives \(s_{12}=(0-4-2)/2=-3\). Likewise, \(q(\mathbf{e}_1+\mathbf{e}_3)=4+8+7=19\), giving \(s_{13}=(19-4-7)/2=4\), and \(q(\mathbf{e}_2+\mathbf{e}_3)=2+10+7=19\), giving \(s_{23}=(19-2-7)/2=5\). These checks recover every entry of \(\mathbf{S}\).

Different Matrices, the Same Quadratic Form

Uniqueness applies only among symmetric matrices. An arbitrary representing matrix need not be unique: adding any skew-symmetric matrix changes the matrix but leaves the form unchanged. Conversely, the symmetrization theorem shows that every matrix representing a given form has the same symmetric part, namely the unique symmetric matrix of that form.

Worked Example: A Family of Representing Matrices

Consider \(q(\mathbf{x})=x_1^2+4x_1x_2+3x_2^2\) on \(\mathbb{R}^2\). Its symmetric matrix is \(\mathbf{S}=\begin{bmatrix}1&2\\2&3\end{bmatrix}\), since the two off-diagonal entries contribute \(2x_1x_2+2x_2x_1=4x_1x_2\).

For any real number \(t\), define \(\mathbf{A}_t=\begin{bmatrix}1&2+t\\2-t&3\end{bmatrix}\). Its symmetric part is \(\tfrac12(\mathbf{A}_t+\mathbf{A}_t^{\top})=\begin{bmatrix}1&2\\2&3\end{bmatrix}=\mathbf{S}\). Direct expansion confirms the form is unchanged: \(\mathbf{x}^{\top}\mathbf{A}_t\mathbf{x}=x_1^2+((2+t)+(2-t))x_1x_2+3x_2^2=q(\mathbf{x})\).

Check: take \(t=5\) and \(\mathbf{x}=(1,-2)^{\top}\). Then \(\mathbf{A}_5=\begin{bmatrix}1&7\\-3&3\end{bmatrix}\) and \(\mathbf{A}_5\mathbf{x}=(-13,-9)^{\top}\), so \(\mathbf{x}^{\top}\mathbf{A}_5\mathbf{x}=-13+18=5\). For the symmetric matrix, \(\mathbf{S}\mathbf{x}=(-3,-4)^{\top}\), so \(\mathbf{x}^{\top}\mathbf{S}\mathbf{x}=-3+8=5\). The matrices differ, but both give the same value.

Common Pitfall: Doubling a Cross-Term Coefficient

A frequent error is to copy the entire coefficient of a cross term into both symmetric positions. For \(q(\mathbf{x})=6x_1x_2\), that mistake produces \(\begin{bmatrix}0&6\\6&0\end{bmatrix}\). But multiplying out gives \(6x_1x_2+6x_2x_1=12x_1x_2\), which is twice the required form. The correction is to split the coefficient: the unique symmetric matrix is \(\begin{bmatrix}0&3\\3&0\end{bmatrix}\), and its two cross-term contributions add to \(3x_1x_2+3x_2x_1=6x_1x_2\).

The rule is always to halve each cross-term coefficient when assigning it to a symmetric pair of entries. Diagonal coefficients are not halved: \(x_i^2\) comes from the single diagonal entry \(s_{ii}\), not from a pair of entries.

Check Your Understanding

Use the symmetric-part formula or the entry-recovery formula, and check each proposed matrix by expanding its quadratic form.

  1. Find the symmetric part of \(\begin{bmatrix}2&-1\\5&4\end{bmatrix}\).
  2. Write the unique symmetric matrix representing \(3x_1^2+14x_1x_2-2x_2^2\).
  3. For a symmetric matrix \(\mathbf{S}\), explain why the coefficient of \(x_ix_j\), for \(i\ne j\), is \(2s_{ij}\).
  4. Can two different symmetric matrices represent the same quadratic form? Justify your answer using evaluations at standard basis vectors and their pairwise sums.
  5. Show that adding a skew-symmetric matrix to a representing matrix does not change the represented quadratic form.

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