Lesson 7.1 · Symmetric Matrices
Diagonalizing symmetric matrices
Many of the matrices that show up in practice are symmetric: covariance matrices in statistics, Hessians in calculus, stiffness matrices in engineering. Symmetric matrices are the best-behaved matrices there are. Their eigenvalues are always real, and they can always be diagonalized using an orthonormal basis of eigenvectors, so the messy in becomes a simple transpose.
Symmetric matrices
Definition
Symmetric matrix
A square matrix is symmetric if . Equivalently, for every and : the entries are mirror images across the main diagonal.
For example,
are symmetric, while is not, and a non-square matrix never is. The diagonal entries can be anything; only the off-diagonal pairs must match.
A handy source of symmetric matrices: for any matrix (any size), is symmetric, because . You will use this fact in the lesson on the singular value decomposition.
Eigenvectors of a symmetric matrix are orthogonal
Recall from the last unit that eigenvectors for different eigenvalues are always linearly independent. For a symmetric matrix, something much stronger is true.
Orthogonal eigenvectors
If is symmetric, then any two eigenvectors from different eigenspaces are orthogonal.
The proof is short and worth knowing. Suppose and with . Using and ,
So . Since , the dot product must be .
Orthogonal diagonalization
If you normalize orthogonal eigenvectors, they become orthonormal, and a square matrix with orthonormal columns is an orthogonal matrix: it satisfies , so . That leads to the following definition.
Definition
Orthogonally diagonalizable
A square matrix is orthogonally diagonalizable if there are an orthogonal matrix and a diagonal matrix with
If , then , since a diagonal matrix equals its own transpose. So only symmetric matrices can be orthogonally diagonalizable. The remarkable fact is that the converse is also true.
The spectral theorem for symmetric matrices
An matrix is orthogonally diagonalizable if and only if it is symmetric. In that case:
- has real eigenvalues, counted with multiplicity.
- The dimension of each eigenspace equals the multiplicity of its eigenvalue.
- Eigenspaces for different eigenvalues are orthogonal.
- , where the columns of are an orthonormal basis of made of eigenvectors of .
The set of eigenvalues of a matrix is called its spectrum, which is where the name comes from. Part 2 is the big surprise: a symmetric matrix never has a deficient eigenspace, so it is always diagonalizable, even with repeated eigenvalues.
The recipe
- Find the eigenvalues.
- For each eigenvalue, find a basis of its eigenspace.
- Make each basis orthonormal. If an eigenspace is one-dimensional, just normalize. If it has dimension 2 or more, run Gram-Schmidt on its basis, then normalize.
- Put the orthonormal eigenvectors into the columns of and the matching eigenvalues on the diagonal of .
You never need Gram-Schmidt between different eigenspaces: they are automatically orthogonal.
Worked example: A 2 × 2 matrix
Orthogonally diagonalize .
The characteristic polynomial is .
For : , so and .
For : , so and .
As promised, . Both have length , so
Worked example: A repeated eigenvalue
Orthogonally diagonalize .
Every row sums to , so and is an eigenvalue with eigenvector . Next, has rank , so is an eigenvalue with a two-dimensional eigenspace: the plane . (Check with the trace: .)
A basis for the plane is , , but these are not orthogonal (). Apply Gram-Schmidt:
Scale this to . Now normalize all three eigenvectors:
Notice that was already orthogonal to both and , exactly as the theorem guarantees.
Common mistake
Inside an eigenspace of dimension 2 or more, a basis you find by row reduction is usually not orthogonal. If you just normalize those vectors and put them in , then is not an orthogonal matrix and . Always run Gram-Schmidt within each multi-dimensional eigenspace.
The spectral decomposition
Write . Multiplying out column-by-row gives
This is the spectral decomposition of . Each is an matrix of rank , and it is exactly the matrix of orthogonal projection onto the line spanned by . So a symmetric matrix acts by splitting a vector into perpendicular pieces along its eigenvectors and scaling each piece by its eigenvalue.
Worked example: Building a matrix from its spectrum
Let . Find the spectral decomposition of .
The characteristic polynomial is .
For : gives , so .
For : the eigenvector must be orthogonal to , so .
Check: .
Tip
For a symmetric matrix, once you have one eigenvector , the other eigenvector is (or ). No second row reduction is needed.
Practice
Which matrix is guaranteed to be orthogonally diagonalizable?
Find the eigenvalues of .
Separate answers with commas, e.g. 2, -5
The matrix is orthogonal. Find the entry of .
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Let . Its eigenvalues are and . What is the dimension of the eigenspace for ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A symmetric matrix has eigenvalues and , and is an eigenvector for . Find the entry of .
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Let and , and let . Find the entry of .
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Find the eigenvalues of , then describe an orthonormal eigenbasis.
Separate answers with commas, e.g. 2, -5
Let be an symmetric matrix. Which statement is false?