Diagonalization: A = PDP⁻¹
Problem
Diagonalize A = [[4,1],[2,3]]. Construct P (eigenvectors) and D (eigenvalues), verify A = PDP⁻¹, and use it to compute Aⁿ quickly.
Explanation
What is diagonalization?
A square matrix is diagonalizable if there exists an invertible and diagonal with
The columns of are eigenvectors of ; the diagonal entries of are the corresponding eigenvalues.
Equivalently, is diagonalizable iff it has linearly independent eigenvectors. A matrix is defective (not diagonalizable) if it lacks enough independent eigenvectors for some eigenvalue.
Why diagonalize?
Powers become cheap. Using :
and is just each diagonal entry raised to the . One matrix multiplication becomes one diagonal multiplication — for big , the savings are huge.
Other uses: solving linear ODEs, matrix exponentials, Markov-chain steady states, principal-axis theorems.
Step-by-step
(same matrix as problem 355).
Step 1 — Find eigenvalues.
From problem 355: , .
Step 2 — Find eigenvectors.
From problem 355: for ; for .
Step 3 — Build and .
Columns of = eigenvectors (in any order, as long as matches).
Step 4 — Compute .
. By the 2×2 inverse formula:
Step 5 — Verify .
Using diagonalization to compute
Compute without diagonalizing: multiply by itself 9 times. Slow.
With diagonalization:
. One matrix multiplication on each side and you're done.
When diagonalization works
is diagonalizable if any of these holds:
- has distinct eigenvalues (no repeats).
- is symmetric (then it's orthogonally diagonalizable — see spectral theorem).
- is normal () — true of symmetric, Hermitian, unitary, orthogonal matrices.
Repeated eigenvalues don't automatically make defective — you have to check if the eigenspace has the right dimension.
The defective case
Example: . Characteristic polynomial: . Only eigenvalue is with algebraic multiplicity 2. But the eigenspace is spanned by only — geometric multiplicity 1 < 2. Not diagonalizable. For this case, use the Jordan canonical form.
Common mistakes
- Mismatching columns of with diagonal of . Column of must be the eigenvector of the eigenvalue .
- Using the wrong . Always double-check by computing .
- Assuming every square matrix diagonalizes. Many important ones do not (shear matrices, nilpotent matrices).
Try it in the visualization
Slide the matrix entries; eigenvalues/eigenvectors update live. are displayed and their product is compared against — red when not diagonalizable, green when verified.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.