MatrixStep

Guides8 min

Matrix Diagonalization and Powers Aⁿ, Step by Step

Nobody computes A¹⁰⁰ by multiplying a hundred times. Diagonalizing a matrix turns powers of A into powers of its diagonal entries, so you can write a closed form for Aⁿ at once. This guide follows a 2×2 example from diagonalization to the formula for Aⁿ.

What is diagonalization?

A square matrix A is diagonalizable when it can be written as A = PDP⁻¹, where D is a diagonal matrix and P is invertible. Rearranged, this is the same as P⁻¹AP = D.

The diagonal entries of D are the eigenvalues of A, and the columns of P are the corresponding eigenvectors. So the condition for diagonalization is having n linearly independent eigenvectors. Distinct eigenvalues guarantee this; a repeated eigenvalue must supply as many independent eigenvectors as its multiplicity.

Example: diagonalizing a 2×2 matrix

A =4123

Step 1: eigenvalues and eigenvectors

The characteristic equation λ² − 7λ + 10 = (λ − 2)(λ − 5) = 0 gives the eigenvalues λ = 2 and 5. Their eigenvectors are shown below; the full working is in the eigenvalue guide.

λ = 2:1−2λ = 5:11

Step 2: build P and D

Put the eigenvectors in the columns of P, and put the eigenvalues on the diagonal of D in the same order. Mismatched order gives a wrong answer.

P =11−21D =2005

Step 3: find P⁻¹

Since det(P) = 1·1 − 1·(−2) = 3, the 2×2 inverse formula gives P⁻¹ directly.

P⁻¹ =13−132313

Check

Multiply PDP⁻¹ and confirm that A comes back.

11−21·2005·13−132313=4123

Using it for powers: Aⁿ = PDⁿP⁻¹

In Aⁿ = (PDP⁻¹)(PDP⁻¹)…(PDP⁻¹), every inner P⁻¹P collapses to I, leaving Aⁿ = PDⁿP⁻¹. Raising a diagonal matrix to a power just raises each diagonal entry to that power.

Dⁿ =2ⁿ005ⁿ

Multiplying PDⁿP⁻¹ symbolically gives the closed form for Aⁿ.

Aⁿ = PDⁿP⁻¹ = 1/3 ·2ⁿ + 2·5ⁿ−2ⁿ + 5ⁿ−2·2ⁿ + 2·5ⁿ2·2ⁿ + 5ⁿ

With n = 1 this gives (2 + 10)/3 = 4, (−2 + 5)/3 = 1, (−4 + 10)/3 = 2 and (4 + 5)/3 = 3, which is A. Let's try n = 5.

D⁵ =32003125A⁵ = PD⁵P⁻¹ =2094103120621063

Multiplying A by itself five times gives the same result. Enter A and n = 5 in the matrix power calculator to see the intermediate results A², A³ and A⁴ as well.

When diagonalization fails

J =1101

The characteristic equation is (λ − 1)² = 0, so the eigenvalue 1 is repeated (algebraic multiplicity 2). But J − I = [[0, 1], [0, 0]] has rank 1, so there is only one direction of eigenvectors (geometric multiplicity 1). With fewer than two independent eigenvectors, J cannot be diagonalized.

For a matrix like this, multiply directly and look for a pattern: J² = [[1, 2], [0, 1]], J³ = [[1, 3], [0, 1]], … so Jⁿ = [[1, n], [0, 1]].

J⁶ =1601

Fibonacci numbers and matrix powers

Powers of F = [[1, 1], [1, 0]] produce the Fibonacci numbers: Fⁿ = [[Fₙ₊₁, Fₙ], [Fₙ, Fₙ₋₁]].

F¹⁰ =89555534

You can read off F₁₀ = 55 and F₁₁ = 89. The eigenvalues of F are the irrational numbers (1 ± √5)/2, and diagonalizing gives Binet's formula Fₙ = (φⁿ − ψⁿ)/√5. The irrational arithmetic is tedious by hand, so for a specific n the power calculator gives the exact integers much faster.

Common mistakes

FAQ

Can I diagonalize when the eigenvalues are irrational?

Yes, but P and D then contain square roots, which makes hand calculation tedious. For 2×2 matrices the eigenvalue calculator shows the exact form (a ± √b)/c.

What is diagonalization used for?

Besides matrix powers: systems of recurrences, long-run states of Markov chains, solutions of linear differential equations, and classifying quadratic forms. All of them need Aⁿ or e^A to be easy to compute.

Is P unique?

No. Any nonzero multiple of an eigenvector is still an eigenvector, so there are many valid choices of P. Every one of them gives the same PDP⁻¹ = A.

Related guides