Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Compute Matrix Powers by Diagonalization

Once A=PDP−1A = PDP^{-1}, the inner factors cancel in AkA^k and leave Ak=PDkP−1A^k = PD^kP^{-1}. Powering a diagonal matrix only powers its entries, so any power, or a formula for every kk, costs two matrix products.

Recognize the task

A high or general power of a square matrix: A10A^{10}, AkA^k for all kk, the long-run behavior of AkxA^k\mathbf{x}, or a recurrence xk+1=Axk\mathbf{x}_{k+1} = A\mathbf{x}_k (population steps, Markov chains, sequences like an+1=an+2an−1a_{n+1} = a_n + 2a_{n-1}). Test: AA must be diagonalizable; for small powers of a small matrix, plain matrix powers by repeated multiplication may be quicker.
The method is the Matrix Powers section of the diagonalization lesson; it rests on the power of a diagonal matrix.

Ways to do it

Diagonalize: PDᵏP⁻¹any k, closed form
Ak=PDkP−1=Pdiag⁡(λ1k,…,λnk)P−1A^k = PD^kP^{-1} = P\operatorname{diag}(\lambda_1^k, \ldots, \lambda_n^k)P^{-1}
Each eigenvalue is simply raised to the kk-th power (eigenvalues of a power); the eigenvectors stay the same.
Repeated multiplicationsmall k
Ak=A⋅A⋯AA^k = A \cdot A \cdots A
Fine for k≤4k \le 4; for larger kk square repeatedly: A2A^2, A4A^4, A8A^8.
Cayley–Hamilton reductionno eigenvectors
p(A)=0p(A) = 0
The Cayley–Hamilton theorem rewrites A2A^2 in terms of AA and II, and so every higher power: for A=(5412)A = \begin{pmatrix} 5 & 4 \\ 1 & 2 \end{pmatrix}, A2=7A−6IA^2 = 7A - 6I.

Steps

StepOn A=(5412)A = \begin{pmatrix} 5 & 4 \\ 1 & 2 \end{pmatrix}, k=3k = 3
1Diagonalize AA. Follow diagonalizing a matrix.P=(411−1)P = \begin{pmatrix} 4 & 1 \\ 1 & -1 \end{pmatrix}, D=diag⁡(6,1)D = \operatorname{diag}(6, 1), P−1=15(111−4)P^{-1} = \frac{1}{5}\begin{pmatrix} 1 & 1 \\ 1 & -4 \end{pmatrix}
2Raise the diagonal entries to the power. Only DD is powered entry by entry, never AA.D3=diag⁡(216,1)D^3 = \operatorname{diag}(216, 1)
3Multiply PDkP−1PD^kP^{-1}. Do PDkPD^k first: it just scales the columns of PP.PD3=(8641216−1)PD^3 = \begin{pmatrix} 864 & 1 \\ 216 & -1 \end{pmatrix}; A3=15(865860215220)=(1731724344)A^3 = \frac{1}{5}\begin{pmatrix} 865 & 860 \\ 215 & 220 \end{pmatrix} = \begin{pmatrix} 173 & 172 \\ 43 & 44 \end{pmatrix}
4Check. Set k=1k = 1 in a general formula to get AA back, or compare with a direct product.A2=(292878)A^2 = \begin{pmatrix} 29 & 28 \\ 7 & 8 \end{pmatrix}, A2A=(1731724344)A^2 A = \begin{pmatrix} 173 & 172 \\ 43 & 44 \end{pmatrix} ✓

Worked examples

Example 1 · a fifth power

2×2
A=(1331)=PDP−1A = \begin{pmatrix} 1 & 3 \\ 3 & 1 \end{pmatrix} = PDP^{-1}, D=diag⁡(4,−2)D = \operatorname{diag}(4, -2)
P=(111−1)P = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}
D5=diag⁡(1024,−32)D^5 = \operatorname{diag}(1024, -32)
odd power keeps the sign
A5=(111−1)(102400−32)12(111−1)A^5 = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1024 & 0 \\ 0 & -32 \end{pmatrix}\frac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}
A5=(496528528496)A^5 = \begin{pmatrix} 496 & 528 \\ 528 & 496 \end{pmatrix}

Example 2 · a formula for every k

general k
A=(2103)A = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}: P=(1101)P = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, D=diag⁡(2,3)D = \operatorname{diag}(2, 3)
eigenvectors (1,0)(1, 0) and (1,1)(1, 1)
P−1=(1−101)P^{-1} = \begin{pmatrix} 1 & -1 \\ 0 & 1 \end{pmatrix}
Ak=(2k3k−2k03k)A^k = \begin{pmatrix} 2^k & 3^k - 2^k \\ 0 & 3^k \end{pmatrix}
check: k=1k = 1 gives AA

Example 3 · a recurrence

application
an+1=an+2an−1a_{n+1} = a_n + 2a_{n-1}, a0=0a_0 = 0, a1=1a_1 = 1: (an+1an)=An(10)\begin{pmatrix} a_{n+1} \\ a_n \end{pmatrix} = A^n\begin{pmatrix} 1 \\ 0 \end{pmatrix}
one step is one multiplication
A=(1210)A = \begin{pmatrix} 1 & 2 \\ 1 & 0 \end{pmatrix}: λ=2,−1\lambda = 2, -1; P=(211−1)P = \begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix}
λ2−λ−2=0\lambda^2 - \lambda - 2 = 0
P−1=13(111−2)P^{-1} = \frac{1}{3}\begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}; second row of PDnP−1(10)PD^nP^{-1}\begin{pmatrix} 1 \\ 0 \end{pmatrix}
an=2n−(−1)n3a_n = \frac{2^n - (-1)^n}{3}, so a10=1024−13=341a_{10} = \frac{1024 - 1}{3} = 341
check: a2=1a_2 = 1, a3=3a_3 = 3
Compare with repeated multiplication in the matrix power visualizer.

See it happen

In the eigenvector basis, applying AA once multiplies each coordinate by its eigenvalue; applying it kk times multiplies by λk\lambda^k. So the long-run behavior of AkxA^k\mathbf{x} is set by the eigenvalue of largest size: for (5412)\begin{pmatrix} 5 & 4 \\ 1 & 2 \end{pmatrix}, 6k6^k quickly swamps 1k1^k, and AkxA^k\mathbf{x} swings toward the eigenvector (4,1)(4, 1). The power iteration visualizer shows this pull toward the dominant direction.

Common mistakes

Powering the entries of A

✗ A3=(1256418)A^3 = \begin{pmatrix} 125 & 64 \\ 1 & 8 \end{pmatrix}
✓ A3=PD3P−1=(1731724344)A^3 = PD^3P^{-1} = \begin{pmatrix} 173 & 172 \\ 43 & 44 \end{pmatrix}; only DD is powered entrywise

Powering P too

✗ Ak=PkDk(P−1)kA^k = P^kD^k(P^{-1})^k
✓ Ak=PDkP−1A^k = PD^kP^{-1}: every inner pair P−1PP^{-1}P cancels

Losing the sign of a negative eigenvalue

✗ (−2)5=32(-2)^5 = 32
✓ (−2)5=−32(-2)^5 = -32; odd powers keep the sign

Using it on a defective matrix

✗ (3103)k=(3k003k)\begin{pmatrix} 3 & 1 \\ 0 & 3 \end{pmatrix}^k = \begin{pmatrix} 3^k & 0 \\ 0 & 3^k \end{pmatrix}
✓ (3103)k=(3kk⋅3k−103k)\begin{pmatrix} 3 & 1 \\ 0 & 3 \end{pmatrix}^k = \begin{pmatrix} 3^k & k \cdot 3^{k-1} \\ 0 & 3^k \end{pmatrix}; this matrix is not diagonalizable