Hello! Welcome to the next lesson in our journey through linear algebra.
In our last lesson, we established a crucial property of symmetric and Hermitian matrices: they always have real eigenvalues. This is a cornerstone for their application in physics and data science. Today, we build directly on that foundation to uncover one of the most powerful results in linear algebra.
Our learning outcome is to apply the Spectral Theorem to find an orthonormal basis of eigenvectors for any symmetric or Hermitian matrix. This theorem is the culmination of the special properties of these matrices. It guarantees that not only are their eigenvalues real, but their eigenvectors can always be chosen to form an orthonormal basis. This has profound implications, from understanding quantum states to performing dimensionality reduction in machine learning.
1. The Spectral Theorem: A Guarantee of Orthogonal Diagonalization
In our previous module on diagonalization, we saw that a matrix is diagonalizable if it has a full set of linearly independent eigenvectors. This allowed us to write , where is the matrix of eigenvectors.
The Spectral Theorem tells us that for symmetric (and Hermitian) matrices, we can do even better. Not only are they always diagonalizable, but the eigenvector matrix can be chosen to be an orthogonal matrix (or a unitary matrix in the complex case).
Let's start with a clear overview of the theorem from Professor Gilbert Strang.
25. Symmetric Matrices and Positive Definiteness
In this video, Professor Strang introduces the two remarkable properties of symmetric matrices (real eigenvalues and orthogonal eigenvectors) and combines them into the Spectral Theorem. He explains the famous decomposition A = QΛQᵀ.
Watch the first part of the video, from 0:08 to 8:52. Focus on understanding the structure of the decomposition: Q is an orthogonal matrix with orthonormal eigenvectors as its columns, and Λ is a diagonal matrix containing the real eigenvalues.
As you saw, the theorem makes a very strong claim. Let's state it formally.
The Spectral Theorem for Real Symmetric Matrices
A real matrix is symmetric () if and only if there exists an orthogonal matrix and a real diagonal matrix such that:
The columns of are an orthonormal basis of eigenvectors for , and the diagonal entries of are the corresponding (real) eigenvalues.

The Spectral Theorem for Complex Hermitian Matrices
A complex matrix is Hermitian () if and only if there exists a unitary matrix and a real diagonal matrix such that:
The columns of are an orthonormal basis of eigenvectors for , and the diagonal entries of are the corresponding (real) eigenvalues.
This is a fantastic result! It means that for these important matrices, we can always find a set of perpendicular axes (the eigenvectors) along which the matrix's action is just simple scaling (by the eigenvalues).
2. How to Find the Orthonormal Eigenbasis: The Algorithm
The Spectral Theorem guarantees that an orthonormal basis of eigenvectors exists. Our job is to find it. The process combines what we already know about finding eigenvalues and eigenvectors with the Gram-Schmidt process you learned in Module 3.
The document 'Applied Linear Algebra' provides a clear, step-by-step algorithm for orthogonally diagonalizing a symmetric matrix. We will follow this procedure in our examples.
Read 'Algorithm 8.1.4 Orthogonal diagonalization of a symmetric matrix A'. These are the exact steps we'll be applying.
Here is a summary of the algorithm:
- Find the eigenvalues of the symmetric/Hermitian matrix by solving the characteristic equation .
- Find a basis for each eigenspace by finding the null space of .
- Create an orthonormal basis for each eigenspace:
- If an eigenspace has dimension 1 (i.e., the eigenvalue is not repeated), simply take the single basis eigenvector and normalize it to have a length of 1.
- If an eigenspace has dimension (i.e., the eigenvalue is repeated), apply the Gram-Schmidt process to the basis vectors you found for that eigenspace to get an orthonormal basis for that subspace.
- Construct the final matrix: The collection of all orthonormal vectors from all the eigenspaces forms the complete orthonormal eigenbasis for the whole space. Create the matrix (or ) by placing these orthonormal eigenvectors as its columns.
A key point to remember: eigenvectors from different eigenspaces of a symmetric/Hermitian matrix are guaranteed to be orthogonal. You only need to use Gram-Schmidt within an eigenspace if its dimension is greater than one.
3. Worked Examples
Let's apply this algorithm to a few cases.
Example 1: Symmetric Matrix with Distinct Eigenvalues
This is the simplest case. The eigenvectors for the distinct eigenvalues will automatically be orthogonal to each other. We just need to normalize them.
Example 2: Symmetric Matrix with Repeated Eigenvalues
This case is more involved, as it requires the Gram-Schmidt process. Pay close attention to how we create an orthonormal basis for the eigenspace corresponding to the repeated eigenvalue.
Now let's see this algorithm in action. The same document provides two excellent examples. The first handles a simple case with distinct eigenvalues, while the second demonstrates the use of the Gram-Schmidt process for a repeated eigenvalue.
Study 'Example 2' and 'Example 3'. For Example 2, verify how the eigenvectors for the distinct eigenvalues λ=3 and λ=8 are orthogonal. For Example 3, focus on how the Gram-Schmidt process is applied to the basis vectors of the E₀ eigenspace to create an orthonormal basis for that specific subspace.
Test your understanding!
Find an orthonormal basis of eigenvectors for the symmetric matrix:
Show answer
- Eigenvalues: The characteristic equation is , which simplifies to . The eigenvalues are and .
- Eigenspaces:
- For , we solve , which gives the eigenvector .
- For , we solve , which gives the eigenvector .
- As expected, . They are orthogonal.
- Normalize:
- . So, .
- . So, .
- Conclusion: The orthonormal basis of eigenvectors is .
Example 3: A Hermitian Matrix
The procedure is identical for Hermitian matrices, but the calculations will involve complex numbers and the complex inner product. This is crucial for your study of quantum mechanics.
Let's walk through an example for a Hermitian matrix from 'Lecture 3x Hermitian Matrices'. Notice the parallels to the real symmetric case.
Read the example that begins with the matrix A = [[6, √3 - i], [√3 + i, 3]]. Follow the calculations for finding the eigenvalues and eigenvectors. Observe how the eigenvectors are normalized using the complex inner product, where the length-squared of a vector z is z†z, to form the columns of the unitary matrix U.
4. The Spectral Decomposition: A Deeper Interpretation
The equation gives us another powerful way to think about symmetric matrices. It can be rewritten as a sum of simple matrices, each representing a projection onto an eigenvector's direction.
25. Symmetric Matrices and Positive Definiteness
Professor Strang explains how to interpret the spectral theorem as a decomposition of the matrix A into a sum of projection matrices, each scaled by an eigenvalue.
Watch from 24:52 to 28:23. He shows how A = QΛQᵀ can be rewritten as A = λ₁q₁q₁ᵀ + λ₂q₂q₂ᵀ + ... where each qᵢqᵢᵀ is a rank-one matrix that projects vectors onto the direction of the eigenvector qᵢ.
The formula is:
This decomposition is extremely useful. It tells us that the action of any symmetric matrix is a weighted sum of projections onto its orthogonal eigen-directions. The weights are just the eigenvalues.
The following animation provides a beautiful geometric picture of this idea.
Spectral Theorem For Dummies - 3Blue1Brown Summer of Math Exposition #SoME1
This short animation visualizes what the spectral decomposition means. It shows how the matrix's transformation of a vector can be built by projecting the vector onto the eigenvectors, scaling each part, and summing the results.
Watch from 5:26 to 6:24. Connect this visual representation to the projection formula A = Σλᵢqᵢqᵢᵀ you just learned about.
Conclusion
This lesson was centered on one of the most elegant and useful theorems in linear algebra. You've not only understood its meaning but also learned the practical steps to apply it.
Key Takeaways:
- The Spectral Theorem guarantees that any real symmetric or complex Hermitian matrix has a full set of eigenvectors that can form an orthonormal basis for the entire space.
- This allows for an orthogonal/unitary diagonalization: or .
- We have a concrete algorithm to find this orthonormal basis: find eigenspaces, use Gram-Schmidt within any eigenspace of dimension > 1, normalize all vectors, and combine them.
- The theorem also provides the spectral decomposition, , which interprets the matrix's action as a sum of scaled projections onto its orthonormal eigenvectors.
Preview of the Next Lesson:
We've now fully characterized the eigenvalues and eigenvectors of symmetric matrices. In the next lesson, we will use these results to classify them further. We will define positive definite and semi-definite matrices. This classification is based entirely on the sign of the eigenvalues, a property made accessible by the Spectral Theorem. This concept is fundamental to understanding convex optimization, which is the engine behind training most deep learning models.