Matrix Diagonalization: A = PDP⁻¹ Step by Step
Diagonalizing a matrix means rewriting it in the coordinates where it only scales each axis. This guide covers A = PDP⁻¹, when it is possible, and why it makes powers of a matrix easy.
- What it means
- A = PDP⁻¹
- When it works
- Repeated eigenvalues
- Defective matrices
- Worked example
- Why it is useful
- Common mistakes
What diagonalization means
A square matrix A is diagonalizable if it can be written as
where D is a diagonal matrix and P is invertible. Intuitively, there is a set of axes (the eigenvector directions) in which A does nothing but scale each axis, and D records those scale factors.
How D and P are built
- D has the eigenvalues \lambda_1,\dots,\lambda_n on its diagonal and zeros elsewhere.
- P has the matching eigenvectors \mathbf v_1,\dots,\mathbf v_n as its columns.
The order must match: column i of P is the eigenvector for the i-th diagonal entry of D. This works because AP=PD says, column by column, that A\mathbf v_i=\lambda_i\mathbf v_i.
When a matrix is diagonalizable
An n\times n matrix is diagonalizable exactly when it has n linearly independent eigenvectors. Equivalent test: for every eigenvalue, the geometric multiplicity equals the algebraic multiplicity. Two handy sufficient conditions: n distinct eigenvalues guarantee it, and every real symmetric matrix is diagonalizable.
Repeated eigenvalues
A repeated eigenvalue does not decide the question by itself. 3I has \lambda=3 twice and two independent eigenvectors, so it is (trivially) diagonalizable with P=I. You must count the independent eigenvectors in each eigenspace.
Defective matrices
A matrix with too few independent eigenvectors is defective and cannot be diagonalized. The classic example is \begin{bmatrix}1&1\\0&1\end{bmatrix}: \lambda=1 is repeated twice, but the only eigenvectors are multiples of (1,0). Only one column is available for P, so P cannot be invertible. Such matrices are handled with the Jordan form, a step beyond this guide.
Worked example
Diagonalize A=\begin{bmatrix}4&1\\2&3\end{bmatrix}.
From the earlier guides: \lambda_1=5 with \mathbf v_1=(1,1) and \lambda_2=2 with \mathbf v_2=(1,-2). Two independent eigenvectors, so it is diagonalizable.
(here \det P=-3). Check the product: PD=\begin{bmatrix}5&2\\5&-4\end{bmatrix} and
The product equals A. ✓
Why diagonalization is useful
Powers become easy, because the inner P^{-1}P factors cancel:
For k=2 this gives A^2=\begin{bmatrix}18&7\\14&11\end{bmatrix}, and for large k the 5^k term dominates. The same idea gives matrix exponentials for solving \mathbf x'=A\mathbf x, closed forms for recurrences, and long-run behavior of Markov chains and vibrating systems.
Common mistakes
- Putting eigenvectors in P in a different order from the eigenvalues in D.
- Writing P^{-1}DP instead of PDP^{-1}.
- Using eigenvectors that are not independent, so P is not invertible.
- Believing a repeated eigenvalue always means "not diagonalizable" (or never does). Count the eigenvectors.
- Confusing diagonalizable with invertible. A matrix can be one without the other.
Try it: the Eigen Vector tool reports whether a matrix has a full set of independent eigenvectors, and flags defective matrices.