Matrix Diagonalization: Complete Tutorial
Master the process of diagonalizing matrices. This comprehensive guide covers eigenvalues, eigenvectors, and step-by-step diagonalization with practical examples and applications.
What Is Matrix Diagonalization?
Matrix diagonalization is the process of finding a diagonal matrix D that is similar to a given square matrix A. Two matrices are similar if one can be transformed into the other through a change of basis—specifically, if there exists an invertible matrix P such that:
A = PDP-1
Or equivalently: D = P-1AP
Where:
- A is the original square matrix
- D is a diagonal matrix (only non-zero entries on the main diagonal)
- P is the matrix of eigenvectors
- P-1 is the inverse of P
Why Diagonalize?
Diagonal matrices are incredibly simple to work with. Operations that are complex for general matrices become trivial for diagonal matrices:
Matrix Powers
Dn is found by raising each diagonal entry to the nth power. For An = PDnP-1
Matrix Exponentials
eD is found by taking e to the power of each diagonal entry.
Determinants
det(D) is simply the product of all diagonal entries.
Systems of Equations
Differential equations become decoupled and easier to solve.
Eigenvalues and Eigenvectors Explained
Before we can diagonalize a matrix, we need to understand eigenvalues and eigenvectors—they're the building blocks of diagonalization.
What Is an Eigenvector?
An eigenvector of a matrix A is a non-zero vector v that, when multiplied by A, only gets scaled (stretched or compressed) but doesn't change direction. The scaling factor is called the eigenvalue (λ):
Av = λv
Matrix × Eigenvector = Eigenvalue × Eigenvector
Geometric Intuition
When you multiply a general vector by a matrix, it typically gets both rotated and scaled. But eigenvectors are special—they only get scaled, staying on the same line through the origin. Think of them as the "natural axes" of the transformation.
- If λ > 1: the eigenvector gets stretched
- If 0 < λ < 1: the eigenvector gets compressed
- If λ < 0: the eigenvector gets flipped and scaled
- If λ = 1: the eigenvector stays exactly the same
- If λ = 0: the eigenvector maps to the zero vector
How to Find Eigenvalues
Eigenvalues are found by solving the characteristic equation. Here's the step-by-step process:
Step 1: Set Up the Characteristic Equation
Start with Av = λv and rearrange to (A - λI)v = 0
For non-trivial solutions (v ≠ 0), we need det(A - λI) = 0
Step 2: Form A - λI
Subtract λ from each diagonal entry of A
Step 3: Calculate the Determinant
Compute det(A - λI) to get a polynomial in λ (the characteristic polynomial)
Step 4: Solve for λ
Find the roots of the characteristic polynomial—these are your eigenvalues
Example: Find Eigenvalues of a 2×2 Matrix
Find the eigenvalues of A = [4, 1; 2, 3]
Step 1: Form A - λI
A - λI = [4-λ, 1; 2, 3-λ]
Step 2: Calculate determinant
det(A - λI) = (4-λ)(3-λ) - (1)(2)
= 12 - 4λ - 3λ + λ² - 2
= λ² - 7λ + 10
Step 3: Solve λ² - 7λ + 10 = 0
(λ - 5)(λ - 2) = 0
λ₁ = 5, λ₂ = 2
How to Find Eigenvectors
Once you have the eigenvalues, find the corresponding eigenvectors by solving (A - λI)v = 0 for each eigenvalue:
Step 1: Substitute Each Eigenvalue
For each λ, compute the matrix (A - λI)
Step 2: Solve the Homogeneous System
Find the null space of (A - λI) using row reduction
Step 3: Write the General Solution
Express eigenvectors in terms of free variables (any non-zero scalar multiple of an eigenvector is also an eigenvector)
Example: Find Eigenvectors
Using A = [4, 1; 2, 3] with eigenvalues λ₁ = 5 and λ₂ = 2:
For λ₁ = 5:
A - 5I = [-1, 1; 2, -2]
Row reduce to find: -x₁ + x₂ = 0, so x₁ = x₂
v₁ = [1; 1] (or any scalar multiple)
For λ₂ = 2:
A - 2I = [2, 1; 2, 1]
Row reduce to find: 2x₁ + x₂ = 0, so x₂ = -2x₁
v₂ = [1; -2] (or any scalar multiple)
The Diagonalization Process
Now we can put it all together to diagonalize a matrix:
Step 1: Find All Eigenvalues
Solve det(A - λI) = 0
Step 2: Find Eigenvectors for Each Eigenvalue
Solve (A - λI)v = 0 for each λ
Step 3: Form Matrix P
Create P by placing eigenvectors as columns: P = [v₁ | v₂ | ... | vₙ]
Step 4: Form Diagonal Matrix D
D has eigenvalues on the diagonal in the same order as eigenvectors in P
Step 5: Verify (Optional)
Check that AP = PD (which means A = PDP⁻¹)
Complete Worked Example
Let's diagonalize the matrix A = [4, 1; 2, 3] step by step:
Given Matrix A
A = [4, 1]
[2, 3]
Step 1: Eigenvalues (from earlier)
λ₁ = 5 and λ₂ = 2
Step 2: Eigenvectors (from earlier)
v₁ = [1; 1] for λ₁ = 5
v₂ = [1; -2] for λ₂ = 2
Step 3: Form Matrix P
P = [1, 1]
[1, -2]
Step 4: Form Diagonal Matrix D
D = [5, 0]
[0, 2]
Step 5: Find P⁻¹ (for complete factorization)
det(P) = (1)(-2) - (1)(1) = -3
P⁻¹ = (-1/3) × [-2, -1]
[-1, 1]
P⁻¹ = [2/3, 1/3]
[1/3, -1/3]
Final Result
A = PDP⁻¹
Where:
P = [1, 1; 1, -2], D = [5, 0; 0, 2], P⁻¹ = [2/3, 1/3; 1/3, -1/3]
When Is a Matrix Diagonalizable?
Not all matrices can be diagonalized. A matrix is diagonalizable if and only if it has enough linearly independent eigenvectors to form the matrix P.
✓ Diagonalizable When:
- n×n matrix has n distinct eigenvalues
- Each eigenvalue's geometric multiplicity equals algebraic multiplicity
- Matrix is symmetric (always diagonalizable with orthogonal P)
- There are n linearly independent eigenvectors
✗ NOT Diagonalizable When:
- Repeated eigenvalues with insufficient eigenvectors
- Defective matrices (geometric < algebraic multiplicity)
- Example: [1, 1; 0, 1] has λ = 1 (twice) but only one eigenvector
Multiplicity Definitions
- Algebraic multiplicity: How many times an eigenvalue appears as a root of the characteristic polynomial
- Geometric multiplicity: The dimension of the eigenspace (number of linearly independent eigenvectors)
- Key rule: Geometric multiplicity ≤ Algebraic multiplicity (always)
- For diagonalizability: They must be equal for ALL eigenvalues
Applications of Diagonalization
🔢 Computing Matrix Powers
Since A = PDP⁻¹, we have An = PDnP⁻¹. Raising a diagonal matrix to a power is trivial—just raise each diagonal entry to that power.
Example: Find A¹⁰⁰ by computing PD¹⁰⁰P⁻¹ (where D¹⁰⁰ just has 5¹⁰⁰ and 2¹⁰⁰ on the diagonal)
📊 Solving Systems of Differential Equations
For dx/dt = Ax, diagonalization decouples the system. If A = PDP⁻¹ and y = P⁻¹x, then dy/dt = Dy, which is easy to solve.
Application: Modeling population dynamics, chemical reactions, electrical circuits
🔁 Fibonacci Numbers
The Fibonacci sequence can be expressed using matrix powers: [F(n+1); F(n)] = An[1; 0] where A = [1,1;1,0].
Diagonalization gives: A closed-form formula for F(n) using the golden ratio!
🎮 Computer Graphics
Understanding eigenvalues helps analyze transformations. The eigenvectors of a transformation matrix reveal its "principal axes."
Application: Scaling, rotation analysis, principal component analysis (PCA)
📈 Google's PageRank
The PageRank algorithm uses eigenvalue computation on massive matrices to rank web pages by importance.
The dominant eigenvector of the web's link matrix gives page importance scores
🧪 Quantum Mechanics
In quantum physics, observable quantities are represented by Hermitian matrices. Their eigenvalues are the possible measurement outcomes.
Eigenvectors represent the states associated with each measurement
Summary: Key Takeaways
- Diagonalization rewrites A as PDP⁻¹ where D is diagonal
- Eigenvalues are found from det(A - λI) = 0
- Eigenvectors are found from (A - λI)v = 0
- P contains eigenvectors as columns; D has eigenvalues on diagonal
- Not all matrices are diagonalizable—need n independent eigenvectors
- Symmetric matrices are always diagonalizable
- Applications include matrix powers, differential equations, PageRank, and quantum mechanics
Ready to Diagonalize Matrices?
Use our free diagonalization calculator to find eigenvalues, eigenvectors, and the P and D matrices instantly.
Try the Diagonalization Calculator →