Most matrices need care to diagonalize: eigenvalues may be complex, eigenvectors may be missing, and $P$ may be awkward to invert. Symmetric matrices ($A^{T} = A$) have none of these problems. Their eigenvectors can be chosen orthonormal, so $P^{-1}$ is just $P^{T}$.
Key idea
Why it works
Worked example: Orthogonally diagonalize
- $\det(A - \lambda I)$ $= \lambda^{2} - 7\lambda + 6$ $= (\lambda - 6)(\lambda - 1)$: eigenvalues $6$ and $1$.
- $\lambda = 6$: $A - 6I = \begin{bmatrix} -4 & 2 \\ 2 & -1 \end{bmatrix}$ gives $x_2 = 2x_1$, so $(1, 2)$. $\lambda = 1$: $A - I = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}$ gives $(2, -1)$.
- They are orthogonal, as promised: $(1)(2) + (2)(-1) = 0$. Divide each by its length $\sqrt{5}$.
- $P = \frac{1}{\sqrt{5}}\begin{bmatrix} 1 & 2 \\ 2 & -1 \end{bmatrix}$, $D = \begin{bmatrix} 6 & 0 \\ 0 & 1 \end{bmatrix}$, and $A = PDP^{T}$.
Answer: $P = \frac{1}{\sqrt{5}}\begin{bmatrix} 1 & 2 \\ 2 & -1 \end{bmatrix}$, $D = \operatorname{diag}(6, 1)$
Writing $A = PDP^{T}$ column by column gives the spectral decomposition $$A = \lambda_1\mathbf{u}_1\mathbf{u}_1^{T} + \lambda_2\mathbf{u}_2\mathbf{u}_2^{T} + \cdots + \lambda_n\mathbf{u}_n\mathbf{u}_n^{T}.$$ Each $\mathbf{u}_i\mathbf{u}_i^{T}$ is the projection onto the line through $\mathbf{u}_i$, so a symmetric matrix is a weighted sum of projections onto perpendicular lines.
Worked example: The spectral decomposition
- $\mathbf{u}_1\mathbf{u}_1^{T} = \frac{1}{5}\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}$ and $\mathbf{u}_2\mathbf{u}_2^{T} = \frac{1}{5}\begin{bmatrix} 4 & -2 \\ -2 & 1 \end{bmatrix}$.
- $6 \cdot \frac{1}{5}\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} + 1 \cdot \frac{1}{5}\begin{bmatrix} 4 & -2 \\ -2 & 1 \end{bmatrix}$ $= \frac{1}{5}\begin{bmatrix} 10 & 10 \\ 10 & 25 \end{bmatrix}$ $= \begin{bmatrix} 2 & 2 \\ 2 & 5 \end{bmatrix}$. ✓
Answer: $A = 6\,\mathbf{u}_1\mathbf{u}_1^{T} + \mathbf{u}_2\mathbf{u}_2^{T}$
Geometrically, a symmetric matrix does the simplest thing a linear map can do: it picks $n$ perpendicular directions and stretches (or flips) along each one, with no turning or shearing in between. A general matrix may also rotate; the next topics show how the SVD separates the stretching from the rotating for every matrix.
Common mistake