← MATH 231 MathScape 0 MATH231

Diagonalization

9 min read

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.

Jump to a section
Reference: Lay, Linear Algebra and Its Applications, Section 5.3: Diagonalization; Section 5.4: Eigenvectors and Linear Transformations

Video: Dr Lynch’s MATH 231 lectures (YouTube playlists)

Before You Start: Prerequisite Check

Can you do these? (Click to reveal self-test)

Test yourself on these prerequisite skills:

  1. 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$.

  2. 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\}$.

  3. 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

This skillDiagonalization
Leads tono further branch yet

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:

  1. Distinct eigenvalues guarantee independence: eigenvectors from different eigenvalues are always linearly independent. So if $A$ has $n$ distinct eigenvalues, it is automatically diagonalizable.

  2. 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.

  3. 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$.

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:

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

Level 1 Verify a Diagonalization

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}$.

Thought Process

Check $A\mathbf{p}_1 = 7\mathbf{p}_1$ and $A\mathbf{p}_2 = -4\mathbf{p}_2$. Then compute $P^{-1}$ (a $2\times 2$ inverse) and the product $PDP^{-1}$.

Show Answer

Verify the eigenvectors. Column 1 of $P$ is $\begin{pmatrix}1\\1\end{pmatrix}$: \[ A\begin{pmatrix}1\\1\end{pmatrix} = \begin{pmatrix}1+6\\5+2\end{pmatrix} = \begin{pmatrix}7\\7\end{pmatrix} = 7\begin{pmatrix}1\\1\end{pmatrix}, \] an eigenvector for $\lambda = 7$. Column 2 is $\begin{pmatrix}6\\-5\end{pmatrix}$: \[ A\begin{pmatrix}6\\-5\end{pmatrix} = \begin{pmatrix}6-30\\30-10\end{pmatrix} = \begin{pmatrix}-24\\20\end{pmatrix} = -4\begin{pmatrix}6\\-5\end{pmatrix}, \] an eigenvector for $\lambda = -4$. The eigenvalues match the diagonal of $D$.

Compute $P^{-1}$. Here $\det P = (1)(-5) - (6)(1) = -11$, so \[ P^{-1} = \frac{1}{-11}\begin{pmatrix}-5&-6\\-1&1\end{pmatrix} = \frac{1}{11}\begin{pmatrix}5&6\\1&-1\end{pmatrix}. \]

Conclude $A = PDP^{-1}$. The columns of $P$ are eigenvectors with eigenvalues $7$ and $-4$, so $AP = PD$ (verified column by column above). Multiplying on the right by $P^{-1}$ gives $A = PDP^{-1}$.

Level 2 Diagonalize a 2x2 Matrix

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.

Thought Process

The eigenvectors are $\begin{pmatrix}-1\\1\end{pmatrix}$ for $\lambda = 1$ and $\begin{pmatrix}1\\1\end{pmatrix}$ for $\lambda = 3$. Place them as columns of $P$ and the matching eigenvalues on the diagonal of $D$.

Show Answer

$P = \begin{pmatrix}-1&1\\1&1\end{pmatrix}$, $D = \begin{pmatrix}1&0\\0&3\end{pmatrix}$.

$P^{-1} = \frac{1}{-1-1}\begin{pmatrix}1&-1\\-1&-1\end{pmatrix} = \begin{pmatrix}-1/2&1/2\\1/2&1/2\end{pmatrix}$

$PDP^{-1} = \begin{pmatrix}-1&1\\1&1\end{pmatrix}\begin{pmatrix}1&0\\0&3\end{pmatrix}\begin{pmatrix}-1/2&1/2\\1/2&1/2\end{pmatrix}$

$= \begin{pmatrix}-1&3\\1&3\end{pmatrix}\begin{pmatrix}-1/2&1/2\\1/2&1/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$ (correct).

Level 3 Detect a Non-Diagonalizable Matrix

Determine whether $A = \begin{pmatrix}3&1\\0&3\end{pmatrix}$ is diagonalizable.

If not, explain specifically why not.

Thought Process

Find the eigenvalues. Check the dimension of each eigenspace. If some eigenvalue’s geometric multiplicity is less than its algebraic multiplicity, the matrix is not diagonalizable.

Show Answer

Characteristic polynomial: $(3-\lambda)^2 = 0$. Eigenvalue $\lambda = 3$ with algebraic multiplicity 2.

Eigenspace for $\lambda = 3$: $A - 3I = \begin{pmatrix}0&1\\0&0\end{pmatrix}$. Row reduce: already in REF. Free column: column 1. Null space: $\text{Span}\left\{\begin{pmatrix}1\\0\end{pmatrix}\right\}$.

Geometric multiplicity $= 1$. Algebraic multiplicity $= 2$.

Since geometric multiplicity $(1) <$ algebraic multiplicity $(2)$, there are not enough independent eigenvectors to form a basis for $\mathbb{R}^2$. $A$ is not diagonalizable.

Level 4 Compute a High Power Using Diagonalization

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$.

Thought Process

$A^4 = PD^4P^{-1}$ where $D^4 = \begin{pmatrix}2^4&0\\0&3^4\end{pmatrix} = \begin{pmatrix}16&0\\0&81\end{pmatrix}$.

Use the formula derived in the worked example.

Show Answer

From the worked example: $k=4$, so $2^k = 16$ and $3^k = 81$.

\[ A^4 = \begin{pmatrix}-2^4+2\cdot3^4 & 2^4-3^4 \\ -2^5+2\cdot3^4 & 2^5-3^4\end{pmatrix} = \begin{pmatrix}-16+162 & 16-81 \\ -32+162 & 32-81\end{pmatrix} = \begin{pmatrix}146&-65\\130&-49\end{pmatrix} \]

Verify one entry: $A^2 = \begin{pmatrix}14&-5\\10&-1\end{pmatrix}$ (from worked example). $A^4 = (A^2)^2$: $(A^2)^2 = \begin{pmatrix}14&-5\\10&-1\end{pmatrix}^2 = \begin{pmatrix}196-50&-70+5\\140-10&-50+1\end{pmatrix} = \begin{pmatrix}146&-65\\130&-49\end{pmatrix}$ (correct).

Level 5 Distinct Eigenvalues Guarantee Diagonalizability

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.)

Thought Process

For each eigenvalue, find one eigenvector. Apply the theorem about eigenvectors from distinct eigenvalues being independent. Conclude you have $n$ independent vectors, forming a basis.

Show Answer

Let $\lambda_1, \ldots, \lambda_n$ be $n$ distinct eigenvalues of $A$. For each $\lambda_j$, since $\lambda_j$ is an eigenvalue, the eigenspace $\text{Nul}(A - \lambda_j I)$ is at least 1-dimensional. Pick one nonzero eigenvector $\mathbf{v}_j$ from each eigenspace.

Key theorem (Lay, Section 5.1): eigenvectors corresponding to distinct eigenvalues are linearly independent.

Applying this theorem: since $\lambda_1, \ldots, \lambda_n$ are distinct, the eigenvectors $\mathbf{v}_1, \ldots, \mathbf{v}_n$ (one from each eigenvalue) are linearly independent.

$n$ linearly independent vectors in $\mathbb{R}^n$ form a basis for $\mathbb{R}^n$.

Therefore $A$ has a basis of eigenvectors, so $A$ is diagonalizable by definition. $\square$

Summary: $n$ distinct eigenvalues $\implies$ $n$ independent eigenvectors $\implies$ eigenvector basis for $\mathbb{R}^n$ $\implies$ diagonalizable.


Common Misconceptions

Common misconception

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.

Common misconception

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.

Common misconception

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:

Real-world connections:

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