Diagonalization: Reducing a Matrix to Its Simplest Form
Use eigenvalues and eigenvectors to transform a matrix into its simplest form, so that powers and exponentials become easy to compute.
Intermediate (undergraduate years 3–4)
Goals of this page
Understand what diagonalization is, when it is possible, and how to compute it. We show that diagonalization makes matrix powers and exponentials easy to evaluate.
1. What is diagonalization
1.1 The power of diagonal matrices
Matrix powers $A^n$ and the exponential $e^A$ are hard to compute in general. But if $A$ can be turned into a diagonal matrix, these reduce to simple entry-wise computations on the diagonal — that is the motivation for studying diagonalization.
A diagonal matrix is the easiest kind of matrix to work with:
$$D = \begin{pmatrix} \lambda_1 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n \end{pmatrix}$$Its powers are trivial to compute:
$$D^k = \begin{pmatrix} \lambda_1^k & 0 & \cdots & 0 \\ 0 & \lambda_2^k & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n^k \end{pmatrix}$$1.2 Definition of diagonalization
Definition: A matrix $A$ is diagonalizable if there exists an invertible matrix $P$ such that
$$P^{-1}AP = D$$
is a diagonal matrix. Equivalently: $A = PDP^{-1}$.
Let us see what this means geometrically. The columns of $P$ are the eigenvectors $\boldsymbol{v}_1, \ldots, \boldsymbol{v}_n$ of $A$, so $P$ represents "taking the eigenvectors as the coordinate axes." The coordinate system built from these eigenvectors is called the eigenbasis. Once we move into the eigenbasis with $P^{-1}$, the action of $A$ becomes the diagonal matrix $D$, which merely scales each eigenvector direction by its corresponding eigenvalue $\lambda_i$. In other words, a transform $A$ that looks complicated in the standard basis becomes the simple "scale each axis" operation once we choose the basis well — this is diagonalization.
In the figure below, the symbol $[\boldsymbol{v}]_B$ denotes the coordinates of a vector $\boldsymbol{v}$ as seen in the eigenbasis $B = \{\boldsymbol{v}_1, \ldots, \boldsymbol{v}_n\}$. The dashed lines are the eigenvector directions (eigen-axes).
1.3 Building $P$ and $D$
Let the eigenvalues of $A$ be $\lambda_1, \ldots, \lambda_n$ with corresponding eigenvectors $\boldsymbol{v}_1, \ldots, \boldsymbol{v}_n$. Then:
$$P = \begin{pmatrix} | & | & & | \\ \boldsymbol{v}_1 & \boldsymbol{v}_2 & \cdots & \boldsymbol{v}_n \\ | & | & & | \end{pmatrix}, \quad D = \begin{pmatrix} \lambda_1 & & \\ & \ddots & \\ & & \lambda_n \end{pmatrix}$$2. Conditions for diagonalizability
2.1 Necessary and sufficient condition
Condition for diagonalizability
An $n \times n$ matrix $A$ is diagonalizable ⇔ $A$ has $n$ linearly independent eigenvectors.
2.2 Sufficient conditions (easy to check)
- If $A$ has $n$ distinct eigenvalues ⇒ diagonalizable (because eigenvectors corresponding to distinct eigenvalues are linearly independent).
- If $A$ is a symmetric matrix ($A = A^T$) ⇒ diagonalizable (and can be diagonalized by an orthogonal matrix).
2.3 Testing via multiplicities (algebraic and geometric)
Important: eigenvalues alone cannot decide diagonalizability
Two matrices with the same eigenvalues may differ in whether they are diagonalizable. Deciding it requires examining the dimension of each eigenspace.
Definition: algebraic and geometric multiplicity
For an eigenvalue $\lambda$:
- Algebraic multiplicity: the multiplicity of $\lambda$ as a root of the characteristic polynomial.
- Geometric multiplicity: the dimension of the eigenspace $\ker(A - \lambda I)$.
It always holds that $1 \leq \text{geometric multiplicity} \leq \text{algebraic multiplicity}$.
Diagonalizability test (complete version)
An $n \times n$ matrix $A$ is diagonalizable ⇔ for every eigenvalue $\lambda$,
$$\text{geometric multiplicity}(\lambda) = \text{algebraic multiplicity}(\lambda)$$
Equivalently: the geometric multiplicities of all eigenvalues sum to $n$.
Example: same eigenvalue, different diagonalizability
Both of the following matrices have the eigenvalue $\lambda = 1$ (multiplicity 2), yet they differ in diagonalizability:
✓ Diagonalizable
$$A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I$$
- Eigenvalue: $\lambda = 1$ (algebraic multiplicity 2)
- Eigenspace: all of $\mathbb{R}^2$ (geometric multiplicity 2)
- Independent eigenvectors: 2
- algebraic = geometric → diagonalizable
✗ Not diagonalizable
$$B = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$$
- Eigenvalue: $\lambda = 1$ (algebraic multiplicity 2)
- Eigenspace: $\text{span}\left\{\begin{pmatrix} 1 \\ 0 \end{pmatrix}\right\}$ (geometric multiplicity 1)
- Independent eigenvectors: only 1
- algebraic > geometric → not diagonalizable
👉 Looking at the eigenvalues (characteristic polynomial) alone cannot decide diagonalizability. One must examine the dimension of each eigenspace.
2.4 A non-diagonalizable example
Consider $A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$.
Characteristic equation: $(1-\lambda)^2 = 0$, so $\lambda = 1$ (multiplicity 2).
Eigenspace: from $(A - I)\boldsymbol{v} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}\boldsymbol{v} = \boldsymbol{0}$, the eigenvectors are only scalar multiples of $\begin{pmatrix} 1 \\ 0 \end{pmatrix}$.
Since there is only one linearly independent eigenvector, the matrix is not diagonalizable.
3. Procedure for diagonalization
3.1 Algorithm
- Solve the characteristic equation $\det(A - \lambda I) = 0$ to find the eigenvalues.
- Find an eigenvector for each eigenvalue.
- Check that there are $n$ linearly independent eigenvectors.
- Let $P$ be the matrix whose columns are the eigenvectors, and $D$ the matrix with the eigenvalues on its diagonal.
- Verify: check that $P^{-1}AP = D$ holds (equivalently, $A\boldsymbol{v}_i = \lambda_i \boldsymbol{v}_i$ for each $i$).
3.2 Worked example
Diagonalize $A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}$.
Step 1: eigenvalues
$$\det(A - \lambda I) = \det\begin{pmatrix} 4-\lambda & 1 \\ 2 & 3-\lambda \end{pmatrix} = (4-\lambda)(3-\lambda) - 2 = \lambda^2 - 7\lambda + 10 = (\lambda - 5)(\lambda - 2)$$Eigenvalues: $\lambda_1 = 5$, $\lambda_2 = 2$.
Step 2: eigenvectors
$\lambda_1 = 5$: from $(A - 5I)\boldsymbol{v} = \begin{pmatrix} -1 & 1 \\ 2 & -2 \end{pmatrix}\boldsymbol{v} = \boldsymbol{0}$ we get $\boldsymbol{v}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$.
$\lambda_2 = 2$: from $(A - 2I)\boldsymbol{v} = \begin{pmatrix} 2 & 1 \\ 2 & 1 \end{pmatrix}\boldsymbol{v} = \boldsymbol{0}$ we get $\boldsymbol{v}_2 = \begin{pmatrix} 1 \\ -2 \end{pmatrix}$.
Step 3: result
$$P = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}, \quad D = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}$$ $$A = PDP^{-1}$$4. Applications of diagonalization
4.1 Matrix powers
If $A = PDP^{-1}$, then:
$$A^k = (PDP^{-1})^k = PD^kP^{-1}$$Since $D^k$ only raises the diagonal entries to the $k$-th power, the computation is easy.
4.2 Matrix exponential
$$e^A = Pe^DP^{-1}, \quad e^D = \begin{pmatrix} e^{\lambda_1} & & \\ & \ddots & \\ & & e^{\lambda_n} \end{pmatrix}$$4.3 Fibonacci sequence
The Fibonacci recurrence $F_n = F_{n-1} + F_{n-2}$ can be written in matrix form:
$$\begin{pmatrix} F_{n+1} \\ F_n \end{pmatrix} = \begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}^n \begin{pmatrix} 1 \\ 0 \end{pmatrix}$$Diagonalizing this matrix yields the closed form for $F_n$ (Binet's formula):
$$F_n = \dfrac{1}{\sqrt{5}}\left[\left(\dfrac{1+\sqrt{5}}{2}\right)^n - \left(\dfrac{1-\sqrt{5}}{2}\right)^n\right]$$4.4 Where diagonalization is used
As a tool that "reduces matrix powers and functions to entry-wise computation on the diagonal," diagonalization is essential across many fields.
| Application | What diagonalization does |
|---|---|
| Matrix powers $A^n$ | Reduces to computing $\lambda_i^n$ via $A^n = PD^nP^{-1}$ |
| Linear ODE systems $\dot{\boldsymbol{x}} = A\boldsymbol{x}$ | Decouples into eigenmodes via $e^{At} = Pe^{Dt}P^{-1}$ |
| Linear recurrences (Fibonacci, etc.) | Yields closed forms (Binet's formula) from matrix powers |
| Markov chains | Finds the stationary distribution from the transition matrix |
| Principal component analysis (PCA) | Orthogonal diagonalization of the (symmetric) covariance matrix gives the principal axes |
| Quantum mechanics | Diagonalizing the Hamiltonian gives eigenstates and energy levels |
5. Exercises
Problem 1: Diagonalize
Diagonalize $A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}$ and find $P$ and $D$.
Show solution
Characteristic equation: $\det(A - \lambda I) = (2-\lambda)^2 - 1 = \lambda^2 - 4\lambda + 3 = (\lambda-3)(\lambda-1)$. Eigenvalues $\lambda_1 = 3,\ \lambda_2 = 1$.
$\lambda_1 = 3$: from $(A-3I)\boldsymbol{v} = \begin{pmatrix} -1 & 1 \\ 1 & -1 \end{pmatrix}\boldsymbol{v} = \boldsymbol{0}$, we get $\boldsymbol{v}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$.
$\lambda_2 = 1$: from $(A-I)\boldsymbol{v} = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}\boldsymbol{v} = \boldsymbol{0}$, we get $\boldsymbol{v}_2 = \begin{pmatrix} 1 \\ -1 \end{pmatrix}$.
$$P = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad D = \begin{pmatrix} 3 & 0 \\ 0 & 1 \end{pmatrix}$$
Since $A$ is symmetric, the two eigenvectors are orthogonal.
Problem 2: Decide diagonalizability
Is $A = \begin{pmatrix} 3 & 1 \\ 0 & 3 \end{pmatrix}$ diagonalizable? Answer with reasons.
Show solution
Characteristic equation: $(3-\lambda)^2 = 0$, so $\lambda = 3$ (algebraic multiplicity 2).
Eigenspace: from $(A-3I)\boldsymbol{v} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}\boldsymbol{v} = \boldsymbol{0}$, the eigenvectors are only scalar multiples of $\begin{pmatrix} 1 \\ 0 \end{pmatrix}$ (geometric multiplicity 1).
Since geometric multiplicity $1\ <\ $ algebraic multiplicity $2$, the matrix is not diagonalizable.
Problem 3: Symmetric matrices
Explain why a real symmetric matrix $A = A^T$ is always diagonalizable.
Show solution
By the spectral theorem for real symmetric matrices, all eigenvalues of $A$ are real, and eigenvectors for distinct eigenvalues are mutually orthogonal. Moreover, one can build an orthonormal basis of $\mathbb{R}^n$ from the eigenvectors, so $A$ can be diagonalized by an orthogonal matrix $Q$: $Q^{-1}AQ = Q^{T}AQ = D$. Hence a symmetric matrix is always diagonalizable.
6. Summary
Key points of this page
- Diagonalization: the factorization $A = PDP^{-1}$.
- Condition: $n$ linearly independent eigenvectors are required.
- Benefit: powers become easy via $A^k = PD^kP^{-1}$.
- A symmetric matrix is always diagonalizable by an orthogonal matrix.