Tutorials › Linear Algebra › Orthogonal Diagonalization: A Diagnostic Problem Workshop

Symmetric Matrices and the Spectral Theorem · Tutorial 754 of 1000

Orthogonal Diagonalization: A Diagnostic Problem Workshop

Learn a reliable diagnostic workflow for deciding when orthogonal diagonalization applies and for checking every step of the construction.

Advanced 11 min read

What You'll Learn

  • Test whether a real square matrix is symmetric before attempting orthogonal diagonalization.
  • Find eigenvectors and check each one by multiplying the original matrix.
  • Normalize eigenvectors and handle a repeated eigenvalue using an orthogonal basis for its eigenspace.
  • Match the columns of the orthogonal matrix to the entries of the diagonal matrix.
  • Verify an orthogonal diagonalization by multiplying QDQᵀ back to the original matrix.

A Diagnostic Workflow Before You Calculate

Orthogonal diagonalization has a strict requirement: the matrix must be real and symmetric. When it applies, the matrix can be written \(\mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\), where \(\mathbf{Q}\) has orthonormal columns and \(\mathbf{D}\) is diagonal. In a complete solution, it is not enough to list plausible eigenvalues and eigenvectors. Check symmetry first, verify each eigenvector against the original matrix, normalize the vectors, keep their order matched to the diagonal entries, and multiply the factors back.

Definition: A real square matrix \(\mathbf{A}\) is orthogonally diagonalizable if there are a real orthogonal matrix \(\mathbf{Q}\) and a real diagonal matrix \(\mathbf{D}\) such that \(\mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\). A square matrix \(\mathbf{Q}\) is orthogonal when \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}\); its columns are then orthonormal, and \(\mathbf{Q}^{-1}=\mathbf{Q}^{\top}\).

The columns of \(\mathbf{Q}\) are ordered unit eigenvectors of \(\mathbf{A}\). If the \(i\)th column is \(\mathbf{q}_i\) and the \(i\)th diagonal entry of \(\mathbf{D}\) is \(\lambda_i\), the required equation is \(\mathbf{A}\mathbf{q}_i=\lambda_i\mathbf{q}_i\). Pairing the wrong eigenvalue with a column, even when all the listed vectors are correct, changes the product.

Theorem (Real Spectral Theorem): A real square matrix is orthogonally diagonalizable if and only if it is symmetric, meaning \(\mathbf{A}^{\top}=\mathbf{A}\). The converse direction is the standard Spectral Theorem established in the earlier material on symmetric matrices and the spectral theorem.

Proof. First suppose \(\mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\), where \(\mathbf{Q}\) is orthogonal and \(\mathbf{D}\) is real diagonal. A diagonal matrix equals its transpose, so

$$ \mathbf{A}^{\top} =(\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top})^{\top} =\mathbf{Q}\mathbf{D}^{\top}\mathbf{Q}^{\top} =\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top} =\mathbf{A}. $$

Thus orthogonal diagonalizability implies symmetry. Conversely, if \(\mathbf{A}\) is real and symmetric, the Real Spectral Theorem gives an orthonormal basis of real eigenvectors. Put those vectors in the columns of \(\mathbf{Q}\) and put their corresponding eigenvalues, in the same order, on the diagonal of \(\mathbf{D}\). Then \(\mathbf{A}\mathbf{Q}=\mathbf{Q}\mathbf{D}\). Multiplying on the right by \(\mathbf{Q}^{\top}\), and using \(\mathbf{Q}\mathbf{Q}^{\top}=\mathbf{I}\), gives \(\mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\). \(\square\)

This criterion gives the first diagnostic: a nonsymmetric real matrix cannot have an orthogonal diagonalization, regardless of whether it has real eigenvalues. For a symmetric matrix, the Spectral Theorem guarantees that the construction is possible; the remaining work is to calculate and check it correctly.

Eigenvectors, Orthogonality, and Normalization

An eigenvector must be nonzero and must satisfy \(\mathbf{A}\mathbf{v}=\lambda\mathbf{v}\). A vector obtained from solving \((\mathbf{A}-\lambda\mathbf{I})\mathbf{v}=\mathbf{0}\) is only a candidate until it is checked by substitution. After finding eigenvectors, use unit vectors in \(\mathbf{Q}\): a nonzero vector \(\mathbf{v}\) is normalized by dividing it by its length, \(\|\mathbf{v}\|=\sqrt{\mathbf{v}^{\top}\mathbf{v}}\).

For distinct eigenvalues of a symmetric matrix, eigenvectors are automatically orthogonal. Repeated eigenvalues need a separate check: vectors in the same eigenspace need not be orthogonal merely because they are eigenvectors. One can choose an orthonormal basis within that eigenspace, for example by the Gram-Schmidt process.

Proposition: If \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is symmetric and \(\mathbf{u},\mathbf{v}\) are eigenvectors with distinct eigenvalues \(\lambda\) and \(\mu\), then \(\mathbf{u}^{\top}\mathbf{v}=0\).

Proof. Since \(\mathbf{A}\mathbf{u}=\lambda\mathbf{u}\) and \(\mathbf{A}\mathbf{v}=\mu\mathbf{v}\), we have \((\mathbf{A}\mathbf{u})^{\top}\mathbf{v}=\lambda\mathbf{u}^{\top}\mathbf{v}\). Symmetry gives \((\mathbf{A}\mathbf{u})^{\top}\mathbf{v}=\mathbf{u}^{\top}\mathbf{A}\mathbf{v}=\mu\mathbf{u}^{\top}\mathbf{v}\). Subtracting yields \((\lambda-\mu)\mathbf{u}^{\top}\mathbf{v}=0\). Because \(\lambda\ne\mu\), division by \(\lambda-\mu\) gives \(\mathbf{u}^{\top}\mathbf{v}=0\). \(\square\)

Worked Construction and Product Check

Worked Example: A Three-Eigenvalue Matrix

Orthogonally diagonalize \(\mathbf{A}=\begin{bmatrix}2&1&0\\1&2&0\\0&0&5\end{bmatrix}\), if possible, and verify the factorization.

First check symmetry: \(\mathbf{A}^{\top}=\mathbf{A}\). The characteristic equation factors as \((2-\lambda)^2-1\) times \((5-\lambda)=0\), or \((1-\lambda)(3-\lambda)(5-\lambda)=0\). Thus the eigenvalues are \(1,3,5\). For \(\lambda=3\), \(\mathbf{v}_1=(1,1,0)^{\top}\) works because \(\mathbf{A}\mathbf{v}_1=(3,3,0)^{\top}=3\mathbf{v}_1\). For \(\lambda=1\), \(\mathbf{v}_2=(1,-1,0)^{\top}\) works because \(\mathbf{A}\mathbf{v}_2=(1,-1,0)^{\top}=\mathbf{v}_2\). For \(\lambda=5\), \(\mathbf{v}_3=(0,0,1)^{\top}\) works because \(\mathbf{A}\mathbf{v}_3=(0,0,5)^{\top}=5\mathbf{v}_3\).

The first two vectors each have length \(\sqrt{2}\); the third has length \(1\). They are pairwise orthogonal, since \(\mathbf{v}_1^{\top}\mathbf{v}_2=1-1=0\) and both have zero dot product with \(\mathbf{v}_3\). Choose the column order \(\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3\), so the diagonal order must be \(3,1,5\). Normalization gives

$$ \mathbf{Q}= \begin{bmatrix} 1/\sqrt{2}&1/\sqrt{2}&0\\ 1/\sqrt{2}&-1/\sqrt{2}&0\\ 0&0&1 \end{bmatrix}, \qquad \mathbf{D}= \begin{bmatrix} 3&0&0\\ 0&1&0\\ 0&0&5 \end{bmatrix}. $$

The columns of \(\mathbf{Q}\) have length \(1\) and are mutually orthogonal, so \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}\). Now compute the first product before multiplying by \(\mathbf{Q}^{\top}\):

$$ \mathbf{Q}\mathbf{D}= \begin{bmatrix} 3/\sqrt{2}&1/\sqrt{2}&0\\ 3/\sqrt{2}&-1/\sqrt{2}&0\\ 0&0&5 \end{bmatrix}, \qquad \mathbf{Q}^{\top}= \begin{bmatrix} 1/\sqrt{2}&1/\sqrt{2}&0\\ 1/\sqrt{2}&-1/\sqrt{2}&0\\ 0&0&1 \end{bmatrix}. $$

Multiplying row by column gives the top-left entries \(3/2+1/2=2\), \(3/2-1/2=1\), \(3/2-1/2=1\), and \(3/2+1/2=2\); the third diagonal entry is \(5\), and all entries connecting the third coordinate to the first two are \(0\). Therefore

$$ \mathbf{Q}\mathbf{D}\mathbf{Q}^{\top} = \begin{bmatrix}2&1&0\\1&2&0\\0&0&5\end{bmatrix} =\mathbf{A}. $$

This multiplication is also a check on the order: the eigenvalue \(3\) multiplies the first column of \(\mathbf{Q}\), \(1\) the second, and \(5\) the third. The original matrix is recovered exactly.

Repeated Eigenvalues Require Care Within Their Eigenspaces

Worked Example: Choosing an Orthonormal Basis for a Repeated Eigenvalue

Diagonalize \(\mathbf{A}=\begin{bmatrix}3&1&1\\1&3&1\\1&1&3\end{bmatrix}\) orthogonally, including a product check.

The matrix is symmetric. Its action on vectors whose coordinates sum to zero is multiplication by \(2\): for \(\mathbf{x}=(x,y,z)^{\top}\) with \(x+y+z=0\), the first coordinate of \(\mathbf{A}\mathbf{x}\) is \(3x+y+z=2x\), and the other two coordinates similarly equal \(2y\) and \(2z\). Thus \(\lambda=2\) has an eigenspace containing \(\mathbf{v}_1=(1,-1,0)^{\top}\) and \(\mathbf{v}_2=(1,1,-2)^{\top}\). Direct substitution gives \(\mathbf{A}\mathbf{v}_1=(2,-2,0)^{\top}\) and \(\mathbf{A}\mathbf{v}_2=(2,2,-4)^{\top}\). Also \(\mathbf{v}_3=(1,1,1)^{\top}\) satisfies \(\mathbf{A}\mathbf{v}_3=(5,5,5)^{\top}\), so its eigenvalue is \(5\).

The dot products are \(\mathbf{v}_1^{\top}\mathbf{v}_2=1-1+0=0\), \(\mathbf{v}_1^{\top}\mathbf{v}_3=1-1+0=0\), and \(\mathbf{v}_2^{\top}\mathbf{v}_3=1+1-2=0\). Their lengths are \(\sqrt{2},\sqrt{6},\sqrt{3}\), respectively. Normalize, and keep the two eigenvalues \(2\) beside the first two columns:

$$ \mathbf{Q}= \begin{bmatrix} 1/\sqrt{2}&1/\sqrt{6}&1/\sqrt{3}\\ -1/\sqrt{2}&1/\sqrt{6}&1/\sqrt{3}\\ 0&-2/\sqrt{6}&1/\sqrt{3} \end{bmatrix}, \qquad \mathbf{D}= \begin{bmatrix}2&0&0\\0&2&0\\0&0&5\end{bmatrix}. $$

Each column has length \(1\), and the dot products above show the columns are mutually orthogonal; hence \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}\). For a direct multiplication check,

$$ \mathbf{Q}\mathbf{D}= \begin{bmatrix} \sqrt{2}&2/\sqrt{6}&5/\sqrt{3}\\ -\sqrt{2}&2/\sqrt{6}&5/\sqrt{3}\\ 0&-4/\sqrt{6}&5/\sqrt{3} \end{bmatrix}, \qquad \mathbf{Q}^{\top}= \begin{bmatrix} 1/\sqrt{2}&-1/\sqrt{2}&0\\ 1/\sqrt{6}&1/\sqrt{6}&-2/\sqrt{6}\\ 1/\sqrt{3}&1/\sqrt{3}&1/\sqrt{3} \end{bmatrix}. $$

The entries in the product are as follows. The diagonal entries are \(1+1/3+5/3=3\), \(1+1/3+5/3=3\), and \(4/3+5/3=3\). The three distinct off-diagonal entries are \(-1+1/3+5/3=1\), \(-2/3+5/3=1\), and \(-2/3+5/3=1\). The product is symmetric, so the opposite off-diagonal entries agree:

$$ \mathbf{Q}\mathbf{D}\mathbf{Q}^{\top} = \begin{bmatrix}3&1&1\\1&3&1\\1&1&3\end{bmatrix} =\mathbf{A}. $$

The repeated eigenvalue does not mean that any two eigenvectors from its eigenspace can be used as columns without checking them. Here the selected vectors were checked to be orthogonal before normalization.

When the Symmetry Test Rejects the Problem

Worked Example: Real Eigenvalues Do Not Replace Symmetry

Decide whether \(\mathbf{B}=\begin{bmatrix}2&1\\0&2\end{bmatrix}\) is orthogonally diagonalizable.

Its transpose is \(\mathbf{B}^{\top}=\begin{bmatrix}2&0\\1&2\end{bmatrix}\), which is not \(\mathbf{B}\), so the matrix is not symmetric. The characteristic equation is \((2-\lambda)^2=0\); in particular, its eigenvalue is real. But the Real Spectral Theorem requires symmetry, not merely real eigenvalues. The necessity direction proved above shows that a matrix with an orthogonal diagonalization must be symmetric. Therefore \(\mathbf{B}\) is not orthogonally diagonalizable.

As an additional check, for \(\lambda=2\), solving \((\mathbf{B}-2\mathbf{I})\mathbf{x}=\mathbf{0}\) gives \(y=0\), so its eigenvectors are nonzero multiples of \((1,0)^{\top}\). There is no pair of linearly independent eigenvectors to place in a \(2\times2\) eigenvector matrix. This reinforces the rejection, but the nonsymmetry test alone already decides the orthogonal-diagonalization question.

Common Assembly and Diagnostic Errors

Wrong intermediate product. A frequent error is to write down a matrix labelled \(\mathbf{Q}\mathbf{D}\) without actually multiplying each column of \(\mathbf{Q}\) by its corresponding diagonal entry. In the first worked example, using the correct \(\mathbf{Q}\) and \(\mathbf{D}\), the first column of \(\mathbf{Q}\mathbf{D}\) must be \(3(1/\sqrt{2},1/\sqrt{2},0)^{\top}=(3/\sqrt{2},3/\sqrt{2},0)^{\top}\), not \((1,1,0)^{\top}\). The second column must be \(1(1/\sqrt{2},-1/\sqrt{2},0)^{\top}\). The corrected product is displayed in that example, and multiplying it by \(\mathbf{Q}^{\top}\) recovers \(\mathbf{A}\). Checking this intermediate step catches a wrong final answer before it is presented.

Misordered eigenvalues. If the columns of \(\mathbf{Q}\) are reordered, the diagonal entries of \(\mathbf{D}\) must be reordered in exactly the same way. Otherwise \(\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\) combines eigenvalues with the wrong directions. Unnormalized columns. Eigenvectors of arbitrary nonzero length do not make an orthogonal matrix; normalize each one and check its length. Skipping the symmetry test. An attempted eigenvector calculation cannot establish that a matrix has an orthogonal diagonalization. A real square matrix that is not symmetric is ruled out immediately.

1
Test symmetry.
For a real square matrix, compare \(\mathbf{A}^{\top}\) with \(\mathbf{A}\). If they differ, stop: orthogonal diagonalization is impossible.
2
Find and verify eigenvectors.
For each eigenvalue, solve \((\mathbf{A}-\lambda\mathbf{I})\mathbf{x}=\mathbf{0}\), then check \(\mathbf{A}\mathbf{x}=\lambda\mathbf{x}\).
3
Make the eigenvectors orthonormal.
Check dot products, handle any repeated-eigenvalue eigenspace carefully, and normalize each selected vector.
4
Assemble and verify.
Place the unit eigenvectors in \(\mathbf{Q}\), put their matching eigenvalues in \(\mathbf{D}\) in the same order, and check \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}\) and \(\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}=\mathbf{A}\).

Check Your Understanding

For each proposed construction, show the calculation that supports your conclusion.

  1. What condition must a real square matrix satisfy before it can be orthogonally diagonalized?
  2. For a symmetric matrix, explain why eigenvectors belonging to distinct eigenvalues are orthogonal.
  3. If the columns of \(\mathbf{Q}\) are ordered for eigenvalues \(4,1,4\), what order must the diagonal entries of \(\mathbf{D}\) use?
  4. Why is a repeated eigenvalue not, by itself, a reason to choose any two eigenvectors from its eigenspace as columns of an orthogonal matrix?
  5. For \(\mathbf{B}=\begin{bmatrix}2&1\\0&2\end{bmatrix}\), give the decisive reason it is not orthogonally diagonalizable.

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