Diagonalization
Before Diagonalization needs a full set of independent eigenvectors and the inverse of P. Builds on: Eigenvalues and Eigenvectors · Linear Independence · Matrix Operations and Invertibility
Next This lesson closes the eigenvalue thread of the course. The same idea returns in later courses on differential equations and on data.
Before You Start: Prerequisite Check
Can you do these? (Click to reveal self-test)
Test yourself on these prerequisite skills:
Eigenvalues: For $A = \begin{pmatrix}2&1\\1&2\end{pmatrix}$, what are the eigenvalues?
Check
The characteristic polynomial is $\lambda^2 - 4\lambda + 3 = (\lambda-1)(\lambda-3)$. Eigenvalues: $\lambda = 1$ and $\lambda = 3$.
Eigenvectors: For the same $A$, what are the eigenvectors for $\lambda = 1$ and $\lambda = 3$?
Check
For $\lambda=1$: $\text{Nul}(A-I) = \text{Span}\left\{\begin{pmatrix}-1\\1\end{pmatrix}\right\}$. For $\lambda=3$: $\text{Nul}(A-3I) = \text{Span}\left\{\begin{pmatrix}1\\1\end{pmatrix}\right\}$.
Matrix inverse: How do you find $A^{-1}$ for a $2 \times 2$ matrix $A = \begin{pmatrix}a&b\\c&d\end{pmatrix}$?
Check
$A^{-1} = \frac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}$, provided $ad-bc \neq 0$.
If you struggled: Review Eigenvalues and Eigenvectors and Matrix Operations and Invertibility.
Try This First
Using $A = \begin{pmatrix}2&1\\1&2\end{pmatrix}$ with eigenvectors $\mathbf{v}_1 = \begin{pmatrix}-1\\1\end{pmatrix}$ ($\lambda_1 = 1$) and $\mathbf{v}_2 = \begin{pmatrix}1\\1\end{pmatrix}$ ($\lambda_2 = 3$):
Form $P = [\mathbf{v}_1 \; \mathbf{v}_2] = \begin{pmatrix}-1&1\\1&1\end{pmatrix}$ and $D = \begin{pmatrix}1&0\\0&3\end{pmatrix}$.
Compute $P^{-1}$ and then the product $PDP^{-1}$. Does it equal $A$?
Show Solution
$P^{-1} = \frac{1}{(-1)(1)-(1)(1)}\begin{pmatrix}1&-1\\-1&-1\end{pmatrix} = \frac{1}{-2}\begin{pmatrix}1&-1\\-1&-1\end{pmatrix} = \begin{pmatrix}-1/2&1/2\\1/2&1/2\end{pmatrix}$
$DP^{-1} = \begin{pmatrix}1&0\\0&3\end{pmatrix}\begin{pmatrix}-1/2&1/2\\1/2&1/2\end{pmatrix} = \begin{pmatrix}-1/2&1/2\\3/2&3/2\end{pmatrix}$
$PDP^{-1} = \begin{pmatrix}-1&1\\1&1\end{pmatrix}\begin{pmatrix}-1/2&1/2\\3/2&3/2\end{pmatrix} = \begin{pmatrix}1/2+3/2&-1/2+3/2\\-1/2+3/2&1/2+3/2\end{pmatrix} = \begin{pmatrix}2&1\\1&2\end{pmatrix} = A$
The factorization $A = PDP^{-1}$ holds. The matrix $A$ has been diagonalized.
Why Diagonalize?
A diagonal matrix is the simplest possible square matrix: multiplication, powers, and inverses are computed entry by entry. Diagonalization transfers this simplicity to any diagonalizable matrix.
The factorization $A = PDP^{-1}$ has one immediate payoff: matrix powers are trivial. \[ A^k = (PDP^{-1})^k = PD^kP^{-1} \] And $D^k = \begin{pmatrix}\lambda_1^k & & \\ & \ddots & \\ & & \lambda_n^k\end{pmatrix}$ (just raise each diagonal entry to the $k$th power).
Computing $A^{100}$ without diagonalization requires 99 matrix multiplications. With diagonalization, it requires one multiplication by $P^{-1}$, one application of $D^{100}$ (trivial), and one multiplication by $P$.
Prerequisite Map
Quick Reference
| Property | Value |
|---|---|
| Course | MATH 231 |
| Difficulty | Advanced |
| Time | ~30 minutes |
| Source | Lay, Linear Algebra and Its Applications, Sections 5.3 and 5.4 |
Diagonalization at a Glance
| $A = PDP^{-1}$ where | Meaning |
|---|---|
| $P = [\mathbf{p}_1 \; \cdots \; \mathbf{p}_n]$ | Columns are $n$ linearly independent eigenvectors |
| $D = \begin{pmatrix}\lambda_1 & & \\ & \ddots & \\ & & \lambda_n\end{pmatrix}$ | Diagonal entries are the matching eigenvalues |
| $\lambda_j$ matches $\mathbf{p}_j$ | Column $j$ of $P$ is an eigenvector for $\lambda_j$ in $D$ |
Key Concepts
Definition of Diagonalization
An $n \times n$ matrix $A$ is diagonalizable if there exists an invertible matrix $P$ and a diagonal matrix $D$ such that: \[ A = PDP^{-1} \]
This is equivalent to saying there exists a basis for $\mathbb{R}^n$ consisting entirely of eigenvectors of $A$.
The columns of $P$ are the basis eigenvectors; the diagonal entries of $D$ are the corresponding eigenvalues, listed in the same order.
Source: Lay, Linear Algebra and Its Applications, Section 5.3: Diagonalization.
When Is $A$ Diagonalizable?
Main Theorem (Lay, Section 5.3): An $n \times n$ matrix $A$ is diagonalizable if and only if it has $n$ linearly independent eigenvectors.
Three key facts:
Distinct eigenvalues guarantee independence: eigenvectors from different eigenvalues are always linearly independent. So if $A$ has $n$ distinct eigenvalues, it is automatically diagonalizable.
A repeated eigenvalue allows diagonalization only in 1 case: if an eigenvalue has algebraic multiplicity $k$ (it is a root of order $k$ in the characteristic polynomial) and geometric multiplicity $k$ (its eigenspace has dimension $k$), it contributes $k$ independent eigenvectors and diagonalization still works. If the geometric multiplicity is less than the algebraic multiplicity, diagonalization fails.
Defective matrices: a matrix is called defective if some eigenvalue has geometric multiplicity strictly less than its algebraic multiplicity. Defective matrices are not diagonalizable.
Diagonalization Algorithm
Input: An $n \times n$ matrix $A$.
Step 1. Find all eigenvalues by solving $\det(A - \lambda I) = 0$.
Step 2. For each eigenvalue, find a basis for the eigenspace $\text{Nul}(A - \lambda I)$.
Step 3. Check that the total number of independent eigenvectors across all eigenspaces is $n$.
- If yes: proceed to diagonalize.
- If no: $A$ is not diagonalizable.
Step 4. Form $P$ by placing the eigenvectors as columns, and $D$ by placing the matching eigenvalues on the diagonal.
Result: $A = PDP^{-1}$.
Note: the matrices $P$ and $D$ are not unique. You can permute the eigenvector-eigenvalue pairs (swap column $i$ of $P$ with column $j$, and correspondingly swap $D_{ii}$ with $D_{jj}$). Different orderings give valid (but different) factorizations.
Worked Example: Full Diagonalization
Diagonalize $A = \begin{pmatrix}4&-1\\2&1\end{pmatrix}$.
Step 1. Characteristic polynomial: $(4-\lambda)(1-\lambda)+2 = \lambda^2 - 5\lambda + 6 = (\lambda-2)(\lambda-3)$.
Eigenvalues: $\lambda_1 = 2$, $\lambda_2 = 3$.
Step 2. Eigenspaces:
- $\lambda = 2$: $A - 2I = \begin{pmatrix}2&-1\\2&-1\end{pmatrix}$. Basis: $\left\{\begin{pmatrix}1\\2\end{pmatrix}\right\}$.
- $\lambda = 3$: $A - 3I = \begin{pmatrix}1&-1\\2&-2\end{pmatrix}$. Basis: $\left\{\begin{pmatrix}1\\1\end{pmatrix}\right\}$.
Step 3. Two distinct eigenvalues for a $2 \times 2$ matrix: automatically 2 independent eigenvectors.
Step 4. \[ P = \begin{pmatrix}1&1\\2&1\end{pmatrix}, \quad D = \begin{pmatrix}2&0\\0&3\end{pmatrix} \]
$P^{-1} = \frac{1}{1-2}\begin{pmatrix}1&-1\\-2&1\end{pmatrix} = \begin{pmatrix}-1&1\\2&-1\end{pmatrix}$
Verify: $PD = \begin{pmatrix}2&3\\4&3\end{pmatrix}$; $\;PDP^{-1} = \begin{pmatrix}2&3\\4&3\end{pmatrix}\begin{pmatrix}-1&1\\2&-1\end{pmatrix} = \begin{pmatrix}-2+6&2-3\\-4+6&4-3\end{pmatrix} = \begin{pmatrix}4&-1\\2&1\end{pmatrix} = A$. Correct.
Application: Matrix Powers
If $A = PDP^{-1}$, then for any positive integer $k$: \[ A^k = P D^k P^{-1} \]
This works because $(PDP^{-1})^k = (PDP^{-1})(PDP^{-1})\cdots = PD(P^{-1}P)D(P^{-1}P)\cdots DP^{-1} = PD^kP^{-1}$.
Example: For $A = \begin{pmatrix}4&-1\\2&1\end{pmatrix}$ with $P$, $D$, $P^{-1}$ as above:
\[ A^k = \begin{pmatrix}1&1\\2&1\end{pmatrix}\begin{pmatrix}2^k&0\\0&3^k\end{pmatrix}\begin{pmatrix}-1&1\\2&-1\end{pmatrix} \]
\[ = \begin{pmatrix}2^k&3^k\\2^{k+1}&3^k\end{pmatrix}\begin{pmatrix}-1&1\\2&-1\end{pmatrix} = \begin{pmatrix}-2^k+2\cdot3^k & 2^k-3^k \\ -2^{k+1}+2\cdot3^k & 2^{k+1}-3^k\end{pmatrix} \]
Check for $k=1$: $\begin{pmatrix}-2+6&2-3\\-4+6&4-3\end{pmatrix} = \begin{pmatrix}4&-1\\2&1\end{pmatrix} = A$ (correct).
Check for $k=2$: $\begin{pmatrix}-4+18&4-9\\-8+18&8-9\end{pmatrix} = \begin{pmatrix}14&-5\\10&-1\end{pmatrix}$.
Verify directly: $A^2 = \begin{pmatrix}4&-1\\2&1\end{pmatrix}^2 = \begin{pmatrix}16-2&-4-1\\8+2&-2+1\end{pmatrix} = \begin{pmatrix}14&-5\\10&-1\end{pmatrix}$ (correct).
Common Pitfalls
| Mistake | Why It Is Wrong | Correct Approach |
|---|---|---|
| Assuming a repeated eigenvalue always prevents diagonalization | A repeated eigenvalue prevents diagonalization only when its eigenspace is smaller than its multiplicity | Check geometric multiplicity (eigenspace dimension) vs. algebraic multiplicity |
| Placing eigenvalues in $D$ in a different order from eigenvectors in $P$ | Column $j$ of $P$ must be an eigenvector for the eigenvalue at position $(j,j)$ in $D$ | List each eigenvector in $P$ directly beneath its eigenvalue in $D$ |
| Claiming $P$ and $D$ are unique | Any permutation of the eigenvector-eigenvalue pairs gives a valid (different) diagonalization | Multiple valid $P$, $D$ pairs exist; choose the most convenient |
A Defective (Non-Diagonalizable) Matrix
Consider $A = \begin{pmatrix}2&1\\0&2\end{pmatrix}$.
Characteristic polynomial: $(2-\lambda)^2 = 0$. Eigenvalue $\lambda = 2$ with algebraic multiplicity 2.
Eigenspace for $\lambda = 2$: $A - 2I = \begin{pmatrix}0&1\\0&0\end{pmatrix}$. $\text{Nul}(A-2I) = \text{Span}\left\{\begin{pmatrix}1\\0\end{pmatrix}\right\}$. Geometric multiplicity $= 1 < 2$.
Only 1 independent eigenvector for a $2 \times 2$ matrix. $A$ is not diagonalizable.
Geometrically: this matrix is a “shear” transformation. It has only one eigendirection, not two. No basis of eigenvectors exists.
Practice Problems
Check that $A = PDP^{-1}$ for:
\[ A = \begin{pmatrix}1&6\\5&2\end{pmatrix}, \quad P = \begin{pmatrix}1&6\\1&-5\end{pmatrix}, \quad D = \begin{pmatrix}7&0\\0&-4\end{pmatrix} \]
First verify that the columns of $P$ are eigenvectors of $A$. Then compute $PDP^{-1}$.
Find $P$ and $D$ to diagonalize $A = \begin{pmatrix}2&1\\1&2\end{pmatrix}$, using the eigenvalues $\lambda = 1, 3$ and eigenvectors found in the prerequisite check.
Then write $A = PDP^{-1}$ and compute $P^{-1}$ to verify.
Determine whether $A = \begin{pmatrix}3&1\\0&3\end{pmatrix}$ is diagonalizable.
If not, explain specifically why not.
Use the diagonalization of $A = \begin{pmatrix}4&-1\\2&1\end{pmatrix}$ (with $P$, $D$, $P^{-1}$ from the worked example) to compute $A^4$.
Prove: if an $n \times n$ matrix $A$ has $n$ distinct eigenvalues $\lambda_1, \ldots, \lambda_n$, then $A$ is diagonalizable.
(Hint: use the theorem that eigenvectors from distinct eigenvalues are linearly independent.)
Common Misconceptions
a repeated eigenvalue always means the matrix is not diagonalizable. A repeated eigenvalue is a warning sign, not a verdict. If the eigenspace for the repeated eigenvalue has the same dimension as its algebraic multiplicity, diagonalization still works. For example, $A = 3I_2$ (the scalar matrix) has eigenvalue $\lambda = 3$ with algebraic multiplicity 2 and a full 2-dimensional eigenspace. It is diagonalizable (in fact, already diagonal). Only when geometric multiplicity is strictly less than algebraic multiplicity does diagonalization fail.
the diagonalization $A = PDP^{-1}$ is unique. There are infinitely many valid diagonalizations. Any permutation of the eigenvector-eigenvalue pairs gives a different but valid $P$ and $D$. Scaling an eigenvector by a nonzero constant also gives a valid $P$. The factorization is not unique; what matters is that the columns of $P$ are eigenvectors and the corresponding diagonal entries of $D$ match.
the diagonal entries of $D$ can be placed in any order independently of $P$. The order of eigenvalues in $D$ must match the order of eigenvectors in $P$: if column $j$ of $P$ is an eigenvector for $\lambda$, then $D_{jj}$ must equal $\lambda$. Mixing the order (putting eigenvectors and their eigenvalues in different positions) produces a matrix $PDP^{-1}$ that does not equal $A$.
Mastery Checklist
Novice (Level 1-2):
Competent (Level 3-4):
Proficient (Level 5):
Mental Model
The Diagonal Shortcut
Multiplying by $A$ is usually expensive: each column of a product requires a dot product computation. But multiplying by a diagonal matrix is free: you just scale each entry. Diagonalization gives you a “change of coordinates” that makes $A$ act like a diagonal matrix.
In the eigenvector basis (the coordinates given by the columns of $P$), the matrix $A$ is diagonal: it merely scales each basis vector by the corresponding eigenvalue. Switching to this basis (multiplying by $P^{-1}$), doing the diagonal computation ($D$), and switching back ($P$) is the three-step recipe that explains $PDP^{-1}$.
A defective matrix has too few eigenvectors to build a complete eigenvector basis. You cannot fully simplify to diagonal form; the matrix is genuinely more complex than a diagonal action on any coordinate system.
Connections
Within MATH 231:
- Eigenvalues and Eigenvectors: diagonalization assembles all the eigenvalue-eigenvector pairs into one factorization
Real-world connections:
- Systems of differential equations: if $\frac{d\mathbf{x}}{dt} = A\mathbf{x}$, diagonalization decouples the system into $n$ independent equations, each solvable as $e^{\lambda_j t}$.
- Google’s PageRank computes the dominant eigenvector of a large matrix; diagonalization explains the convergence of the power iteration method.
- In quantum mechanics, the eigenvectors of an observable (a matrix) are the physically measurable states; diagonalization reveals them.
Source: Lay, Linear Algebra and Its Applications, Section 5.3: Diagonalization; Section 5.4: Eigenvectors and Linear Transformations.
Last updated: 2026-06-16
Watch and Read
- Lynch, MATH 231 lecture playlists (YouTube)Recorded MATH 231 lectures at EWU. Use them to see each topic worked through in a full class session.