Diagonalization & Matrix Powers

Study Sheet

Diagonalization & Matrix Powers

A = PDP⁻¹ and everything it unlocks

Changing to the Eigenbasis

Tip
Diagonalization is a change of glasses
xAx5v₁2v₂v₁v₂
x = v₁ + v₂; A stretches the v₁-part by 5 and the v₂-part by 2, giving Ax = 5v₁ + 2v₂ = (7, 1).

If a matrix AA has nn independent eigenvectors, pack them as the columns of PP and their eigenvalues into the diagonal of DD: then A=PDP−1A = PDP^{-1}. Reading right to left: P−1P^{-1} translates a vector into eigen-coordinates, DD stretches each coordinate by its eigenvalue (the easy part), and PP translates back.

The matrix was never complicated — we were looking at it in the wrong basis. Consequences cascade: Ak=PDkP−1A^k = PD^kP^{-1} (powers act on eigenvalues only), tr(Ak)=∑λik\mathrm{tr}(A^k) = \sum\lambda_i^k, and functions of matrices (A\sqrt A, eAte^{At}) are defined by applying them to the diagonal. Computing A100A^{100} costs a diagonalization, not a hundred multiplications. A concrete case: A=(4123)A = \begin{pmatrix}4&1\\2&3\end{pmatrix} has eigenvectors v1=(1,1)\mathbf v_1 = (1, 1) with λ=5\lambda = 5 and v2=(1,−2)\mathbf v_2 = (1, -2) with λ=2\lambda = 2. The vector x=(2,−1)\mathbf x = (2, -1) is v1+v2\mathbf v_1 + \mathbf v_2 — its eigen-coordinates are (1,1)(1, 1). So Ax=5v1+2v2=(7,1)A\mathbf x = 5\mathbf v_1 + 2\mathbf v_2 = (7, 1), computed without multiplying by AA; check: A(2,−1)=(8−1,4−3)=(7,1)A(2, -1) = (8 - 1, 4 - 3) = (7, 1) ✓.

Side note
When diagonalization fails

A repeated eigenvalue may come with too few eigenvectors: the shear (1101)\begin{pmatrix}1&1\\0&1\end{pmatrix} has the double eigenvalue 11 but only one eigenvector direction — it is defective, and no basis makes it diagonal. The fix (Jordan form) adds an off-diagonal 11 and, in differential equations, produces exactly the teλtte^{\lambda t} solutions you met with repeated characteristic roots. The two "repeated root" phenomena are one phenomenon.

Tip
Recurrences are matrix powers

Fibonacci's Fn+1=Fn+Fn−1F_{n+1} = F_n + F_{n-1} is the matrix iteration (Fn+1Fn)=(1110)(FnFn−1)\binom{F_{n+1}}{F_n} = \begin{pmatrix}1&1\\1&0\end{pmatrix}\binom{F_n}{F_{n-1}}, so FnF_n lives inside QnQ^n.

Diagonalizing QQ (eigenvalues φ=1+52\varphi = \tfrac{1+\sqrt5}{2} and ψ=1−52\psi = \tfrac{1-\sqrt5}{2}) yields Binet's formula Fn=φn−ψn5F_n = \tfrac{\varphi^n - \psi^n}{\sqrt5} — a closed form for a recursive sequence, and since ∣ψ∣<1|\psi| < 1, the growth rate of Fibonacci is exactly the golden ratio. Every linear recurrence yields to the same treatment: its characteristic equation is the characteristic polynomial of its companion matrix.

Try it
Try it: trace of a big power in ten seconds

Compute tr⁡(A5)\operatorname{tr}(A^5) for A=(2112)A = \begin{pmatrix}2&1\\1&2\end{pmatrix} without multiplying any matrices.

Show the answer

The eigenvalues come from the trace and determinant: tr⁡A=4\operatorname{tr}A = 4 and det⁡A=3\det A = 3, so λ2−4λ+3=(λ−1)(λ−3)=0\lambda^2 - 4\lambda + 3 = (\lambda - 1)(\lambda - 3) = 0, giving λ=1\lambda = 1 and 33. Since A=PDP−1A = PDP^{-1}, A5=PD5P−1A^5 = PD^5P^{-1} has the same trace as D5D^5, the sum of the fifth powers of the eigenvalues: tr⁡(A5)=15+35=1+243=244\operatorname{tr}(A^5) = 1^5 + 3^5 = 1 + 243 = 244. To confirm, A5=(122121121122)A^5 = \begin{pmatrix}122&121\\121&122\end{pmatrix}, whose diagonal adds to 244244 ✓.

Diagonalizing Step by Step

Tip
When and how

AA (n×nn\times n) is diagonalizable exactly when it has nn independent eigenvectors. Then A=PDP−1A = PDP^{-1} with the eigenvectors as the columns of PP and the matching eigenvalues, in the same order, on the diagonal of DD. Distinct eigenvalues guarantee it; a repeated eigenvalue needs as many independent eigenvectors as its multiplicity. Symmetric matrices are always diagonalizable.

The equation AP=PDAP = PD is just the eigenvector equations side by side: column jj of APAP is AvjA\mathbf v_j, and column jj of PDPD is λjvj\lambda_j\mathbf v_j. Multiplying on the right by P−1P^{-1}, which exists because the columns are independent, gives A=PDP−1A = PDP^{-1}. If a repeated eigenvalue has too few eigenvectors, there are not enough columns to fill an invertible PP, and no change of basis can make AA diagonal.

Example
Worked: a 2×2, checked by multiplying back

Diagonalize A=(6−213)A = \begin{pmatrix}6&-2\\1&3\end{pmatrix}. Trace 99, determinant 18+2=2018 + 2 = 20, so λ2−9λ+20=(λ−4)(λ−5)=0\lambda^2 - 9\lambda + 20 = (\lambda - 4)(\lambda - 5) = 0. For λ=5\lambda = 5, A−5I=(1−21−2)A - 5I = \begin{pmatrix}1&-2\\1&-2\end{pmatrix} gives v=(2,1)\mathbf v = (2, 1); for λ=4\lambda = 4, A−4I=(2−21−1)A - 4I = \begin{pmatrix}2&-2\\1&-1\end{pmatrix} gives v=(1,1)\mathbf v = (1, 1).

So P=(2111)P = \begin{pmatrix}2&1\\1&1\end{pmatrix} with D=(5004)D = \begin{pmatrix}5&0\\0&4\end{pmatrix}, in matching order. det⁡P=1\det P = 1, so P−1=(1−1−12)P^{-1} = \begin{pmatrix}1&-1\\-1&2\end{pmatrix}. Check:

PDP−1=(10454)(1−1−12)=(6−213)=A ✓PDP^{-1} = \begin{pmatrix}10&4\\5&4\end{pmatrix}\begin{pmatrix}1&-1\\-1&2\end{pmatrix} = \begin{pmatrix}6&-2\\1&3\end{pmatrix} = A\ \checkmark

Now any power is immediate, for instance An=P(5n004n)P−1A^n = P\begin{pmatrix}5^n&0\\0&4^n\end{pmatrix}P^{-1}.

Example
Worked: a repeated eigenvalue that is harmless

Diagonalize A=(200031013)A = \begin{pmatrix}2&0&0\\0&3&1\\0&1&3\end{pmatrix}. Expanding along row 1, det⁡(A−λI)=(2−λ)[(3−λ)2−1]=(2−λ)(2−λ)(4−λ)\det(A - \lambda I) = (2 - \lambda)\big[(3 - \lambda)^2 - 1\big] = (2 - \lambda)(2 - \lambda)(4 - \lambda). The eigenvalue 22 is repeated.

For λ=2\lambda = 2: A−2I=(000011011)A - 2I = \begin{pmatrix}0&0&0\\0&1&1\\0&1&1\end{pmatrix} has rank 11, so its null space is two-dimensional — v2+v3=0v_2 + v_3 = 0 with v1v_1 and v3v_3 free — spanned by (1,0,0)(1, 0, 0) and (0,1,−1)(0, 1, -1). For λ=4\lambda = 4: A−4I=(−2000−1101−1)A - 4I = \begin{pmatrix}-2&0&0\\0&-1&1\\0&1&-1\end{pmatrix} gives v1=0v_1 = 0, v2=v3v_2 = v_3: (0,1,1)(0, 1, 1). Three independent eigenvectors, so A=PDP−1A = PDP^{-1} with P=(1000110−11)P = \begin{pmatrix}1&0&0\\0&1&1\\0&-1&1\end{pmatrix} and D=diag(2,2,4)D = \mathrm{diag}(2, 2, 4). AA is symmetric, and its eigenvectors are even mutually perpendicular.

Example
Worked: a repeated eigenvalue that is fatal

Is A=(5−141)A = \begin{pmatrix}5&-1\\4&1\end{pmatrix} diagonalizable? Trace 66, determinant 5+4=95 + 4 = 9, so λ2−6λ+9=(λ−3)2\lambda^2 - 6\lambda + 9 = (\lambda - 3)^2: the single eigenvalue 33, repeated.

A−3I=(2−14−2)A - 3I = \begin{pmatrix}2&-1\\4&-2\end{pmatrix} has rank 11 (row 2 is twice row 1), so its null space is one-dimensional: only the multiples of (1,2)(1, 2). Two independent eigenvectors would be needed; there is one. So AA is not diagonalizable. Had it been, DD would be 3I3I and A=P(3I)P−1=3IA = P(3I)P^{-1} = 3I — but A≠3IA \ne 3I. That one-line argument settles every 2×22\times2 with a repeated eigenvalue: diagonalizable only if it is already a multiple of II.

Side note
Where it goes wrong: columns of P out of step with D

With the eigenvectors (2,1)(2, 1) for 55 and (1,1)(1, 1) for 44, taking P=(2111)P = \begin{pmatrix}2&1\\1&1\end{pmatrix} but D=diag(4,5)D = \mathrm{diag}(4, 5) pairs each vector with the wrong eigenvalue. Then PDP−1=(32−16)PDP^{-1} = \begin{pmatrix}3&2\\-1&6\end{pmatrix}, not AA — though it has the same trace and determinant, which is why the error slips past quick checks. Multiply PDP−1PDP^{-1} back out, or at least check AP=PDAP = PD column by column.

Try it
Try it: diagonalize and take powers

Diagonalize A=(1221)A = \begin{pmatrix}1&2\\2&1\end{pmatrix} and find a formula for AnA^n.

Show the answer

Trace 22, determinant 1−4=−31 - 4 = -3, so λ2−2λ−3=(λ−3)(λ+1)=0\lambda^2 - 2\lambda - 3 = (\lambda - 3)(\lambda + 1) = 0. For λ=3\lambda = 3: A−3I=(−222−2)A - 3I = \begin{pmatrix}-2&2\\2&-2\end{pmatrix} gives (1,1)(1, 1). For λ=−1\lambda = -1: A+I=(2222)A + I = \begin{pmatrix}2&2\\2&2\end{pmatrix} gives (1,−1)(1, -1). So P=(111−1)P = \begin{pmatrix}1&1\\1&-1\end{pmatrix}, D=diag(3,−1)D = \mathrm{diag}(3, -1), P−1=12(111−1)P^{-1} = \tfrac12\begin{pmatrix}1&1\\1&-1\end{pmatrix}, and

An=PDnP−1=12(3n+(−1)n3n−(−1)n3n−(−1)n3n+(−1)n).A^n = PD^nP^{-1} = \frac12\begin{pmatrix}3^n + (-1)^n & 3^n - (-1)^n\\ 3^n - (-1)^n & 3^n + (-1)^n\end{pmatrix}.

Check n=1n = 1: 12(2442)=A\tfrac12\begin{pmatrix}2&4\\4&2\end{pmatrix} = A ✓; and n=2n = 2 gives (5445)\begin{pmatrix}5&4\\4&5\end{pmatrix}, which is A2A^2 ✓.

Long-Run Behavior: Powers and Differential Equations

Tip
The dominant eigenvalue wins

If x0=c1v1+⋯+cnvn\mathbf x_0 = c_1\mathbf v_1 + \cdots + c_n\mathbf v_n in an eigenbasis, then

xk=Akx0=c1λ1kv1+⋯+cnλnkvn,u(t)=eAtu0=c1eλ1tv1+⋯+cneλntvn\mathbf x_k = A^k\mathbf x_0 = c_1\lambda_1^k\mathbf v_1 + \cdots + c_n\lambda_n^k\mathbf v_n, \qquad \mathbf u(t) = e^{At}\mathbf u_0 = c_1e^{\lambda_1t}\mathbf v_1 + \cdots + c_ne^{\lambda_nt}\mathbf v_n

solve xk+1=Axk\mathbf x_{k+1} = A\mathbf x_k and u′=Au\mathbf u' = A\mathbf u. For large kk the term with the largest ∣λ∣|\lambda| dominates; for large tt, the one with the largest real part.

Both formulas decouple the system: in eigen-coordinates each component evolves on its own, multiplied by λ\lambda each step or growing like eλte^{\lambda t}. To check the continuous one, differentiate: each term's derivative is λicieλitvi=A(cieλitvi)\lambda_ic_ie^{\lambda_it}\mathbf v_i = A(c_ie^{\lambda_it}\mathbf v_i), so u′=Au\mathbf u' = A\mathbf u, and at t=0t = 0 the sum is x0\mathbf x_0's expansion. The coefficients cic_i come from solving Pc=x0P\mathbf c = \mathbf x_0 once.

Example
Worked: a system that settles by oscillating
xy121x₀x₁x₂y = x/2
The iterates hop across the eigenvector line y = x/2 and close in on (2, 1).

Let A=(121120)A = \begin{pmatrix}\tfrac12&1\\\tfrac12&0\end{pmatrix} and x0=(3,0)\mathbf x_0 = (3, 0). Trace 12\tfrac12, determinant −12-\tfrac12, so λ2−12λ−12=(λ−1)(λ+12)=0\lambda^2 - \tfrac12\lambda - \tfrac12 = (\lambda - 1)(\lambda + \tfrac12) = 0. Eigenvectors: (2,1)(2, 1) for λ=1\lambda = 1 and (1,−1)(1, -1) for λ=−12\lambda = -\tfrac12.

Expand the start: (3,0)=(2,1)+(1,−1)(3, 0) = (2, 1) + (1, -1), so c1=c2=1c_1 = c_2 = 1 and

xk=(2,1)+(−12)k(1,−1).\mathbf x_k = (2, 1) + \left(-\tfrac12\right)^k(1, -1).

The first few: x1=(1.5,1.5)\mathbf x_1 = (1.5, 1.5), x2=(2.25,0.75)\mathbf x_2 = (2.25, 0.75), x3=(1.875,1.125)\mathbf x_3 = (1.875, 1.125); check x1=Ax0=(1.5,1.5)\mathbf x_1 = A\mathbf x_0 = (1.5, 1.5) ✓. The λ=1\lambda = 1 part never changes, and the −12-\tfrac12 part halves and flips sign each step, so the points hop from side to side of the eigenvector line and close in on (2,1)(2, 1).

Example
Worked: a system of differential equations

Solve u′=Au\mathbf u' = A\mathbf u with A=(4123)A = \begin{pmatrix}4&1\\2&3\end{pmatrix} and u(0)=(2,−1)\mathbf u(0) = (2, -1). The eigen-data were found above: λ=5\lambda = 5 with (1,1)(1, 1) and λ=2\lambda = 2 with (1,−2)(1, -2), and (2,−1)=(1,1)+(1,−2)(2, -1) = (1, 1) + (1, -2).

So

u(t)=e5t(11)+e2t(1−2)=(e5t+e2te5t−2e2t).\mathbf u(t) = e^{5t}\begin{pmatrix}1\\1\end{pmatrix} + e^{2t}\begin{pmatrix}1\\-2\end{pmatrix} = \begin{pmatrix}e^{5t} + e^{2t}\\e^{5t} - 2e^{2t}\end{pmatrix}.

Check the first equation, u1′=4u1+u2u_1' = 4u_1 + u_2: the left side is 5e5t+2e2t5e^{5t} + 2e^{2t}, the right side is 4e5t+4e2t+e5t−2e2t=5e5t+2e2t4e^{5t} + 4e^{2t} + e^{5t} - 2e^{2t} = 5e^{5t} + 2e^{2t} ✓; and u(0)=(2,−1)\mathbf u(0) = (2, -1) ✓. For large tt the e5te^{5t} term dominates, so the solution heads off along the direction (1,1)(1, 1).

Side note
Where it goes wrong: small entries, large powers

"Every entry is less than 11, so Ak→0A^k \to 0" is false. A=(0.60.60.60.6)A = \begin{pmatrix}0.6&0.6\\0.6&0.6\end{pmatrix} has eigenvalues 1.21.2 (along (1,1)(1, 1)) and 00, so Ak=1.2k−1AA^k = 1.2^{k-1}A grows without bound. What decides decay is the size of the eigenvalues, not of the entries: Ak→0A^k \to 0 exactly when every eigenvalue has ∣λ∣<1|\lambda| < 1.

Try it
Try it: solve u′ = Au

Solve u′=Au\mathbf u' = A\mathbf u with A=(1221)A = \begin{pmatrix}1&2\\2&1\end{pmatrix} and u(0)=(3,1)\mathbf u(0) = (3, 1).

Show the answer

From the previous Try-it, AA has λ=3\lambda = 3 with (1,1)(1, 1) and λ=−1\lambda = -1 with (1,−1)(1, -1). Expand the start: c1(1,1)+c2(1,−1)=(3,1)c_1(1, 1) + c_2(1, -1) = (3, 1) gives c1+c2=3c_1 + c_2 = 3 and c1−c2=1c_1 - c_2 = 1, so c1=2c_1 = 2, c2=1c_2 = 1. Then

u(t)=2e3t(11)+e−t(1−1)=(2e3t+e−t2e3t−e−t).\mathbf u(t) = 2e^{3t}\begin{pmatrix}1\\1\end{pmatrix} + e^{-t}\begin{pmatrix}1\\-1\end{pmatrix} = \begin{pmatrix}2e^{3t} + e^{-t}\\2e^{3t} - e^{-t}\end{pmatrix}.

Check: u1′=6e3t−e−tu_1' = 6e^{3t} - e^{-t} and u1+2u2=2e3t+e−t+4e3t−2e−t=6e3t−e−tu_1 + 2u_2 = 2e^{3t} + e^{-t} + 4e^{3t} - 2e^{-t} = 6e^{3t} - e^{-t} ✓, and u(0)=(3,1)\mathbf u(0) = (3, 1) ✓. The e−te^{-t} part dies away and the solution lines up with (1,1)(1, 1).

Proofs & Why It Matters

Tip
Proof: Aᵏ = PDᵏP⁻¹, and why traces are power sums

A2=(PDP−1)(PDP−1)=PD(P−1P)DP−1=PD2P−1A^2 = (PDP^{-1})(PDP^{-1}) = PD(P^{-1}P)DP^{-1} = PD^2P^{-1} — the inner pair cancels; induction extends to all kk. For the trace, use tr(XY)=tr(YX)\mathrm{tr}(XY) = \mathrm{tr}(YX): tr(Ak)=tr(PDkP−1)=tr(DkP−1P)=tr(Dk)=∑λik\mathrm{tr}(A^k) = \mathrm{tr}(PD^kP^{-1}) = \mathrm{tr}(D^kP^{-1}P) = \mathrm{tr}(D^k) = \sum\lambda_i^k.

■\blacksquare Significance: this identity is how one counts closed walks in graphs (adjacency-matrix powers), computes partition functions in physics, and analyzes mixing of Markov chains — three fields, one cancellation.

Side note
Significance: exponentials of matrices

Define eAt=PeDtP−1e^{At} = Pe^{Dt}P^{-1}, i.e. exponentiate each eigenvalue. Then u(t)=eAtu0\mathbf u(t) = e^{At}\mathbf u_0 solves u′=Au\mathbf u' = A\mathbf u — the systems topic of Differential Equations is literally this formula. Diagonalization is the load-bearing wall between the two courses.

Going Deeper: Worked Problems

Example
Worked: a full diagonalization, then a closed-form power

Diagonalize A=(4123)A = \begin{pmatrix}4&1\\2&3\end{pmatrix} and use it to find a formula for AnA^n.

Step 1 — eigenvalues: trace 77, det 1010: λ2−7λ+10=(λ−2)(λ−5)=0\lambda^2 - 7\lambda + 10 = (\lambda-2)(\lambda-5) = 0.

Step 2 — eigenvectors: for λ=5\lambda = 5, (A−5I)v=(−112−2)v=0(A - 5I)\mathbf v = \begin{pmatrix}-1&1\\2&-2\end{pmatrix}\mathbf v = \mathbf 0 gives (1,1)(1,1); for λ=2\lambda = 2, (2121)v=0\begin{pmatrix}2&1\\2&1\end{pmatrix}\mathbf v = \mathbf 0 gives (1,−2)(1,-2).

Step 3 — P=(111−2)P = \begin{pmatrix}1&1\\1&-2\end{pmatrix}, D=diag(5,2)D = \mathrm{diag}(5, 2), and P−1=1−3(−2−1−11)P^{-1} = \tfrac{1}{-3}\begin{pmatrix}-2&-1\\-1&1\end{pmatrix}.

Step 4 — An=PDnP−1=13(2⋅5n+2n5n−2n2⋅5n−2⋅2n5n+2⋅2n)A^n = PD^nP^{-1} = \tfrac13\begin{pmatrix}2\cdot5^n + 2^n & 5^n - 2^n\\ 2\cdot5^n - 2\cdot2^n & 5^n + 2\cdot2^n\end{pmatrix}.

Step 5 — check n=1n = 1: 13(12369)=A\tfrac13\begin{pmatrix}12&3\\6&9\end{pmatrix} = A ✓. Every entry is now a formula in nn; the 5n5^n terms dominate, along the eigenvector (1,1)(1,1).

Example
Worked: solving a recurrence by diagonalization

A sequence satisfies an+1=5an−6an−1a_{n+1} = 5a_n - 6a_{n-1} with a0=1a_0 = 1, a1=4a_1 = 4. Find a closed form.

Step 1 — companion matrix: (an+1an)=(5−610)(anan−1)\binom{a_{n+1}}{a_n} = \begin{pmatrix}5&-6\\1&0\end{pmatrix}\binom{a_n}{a_{n-1}}.

Step 2 — its characteristic polynomial is λ2−5λ+6=(λ−2)(λ−3)\lambda^2 - 5\lambda + 6 = (\lambda-2)(\lambda-3) — exactly the recurrence with λ\lambda in place of the shift.

Step 3 — so an=c1⋅2n+c2⋅3na_n = c_1\cdot2^n + c_2\cdot3^n; the data give c1+c2=1c_1 + c_2 = 1 and 2c1+3c2=42c_1 + 3c_2 = 4, hence c2=2c_2 = 2, c1=−1c_1 = -1: an=2⋅3n−2na_n = 2\cdot3^n - 2^n.

Step 4 — verify a2a_2: recurrence gives 5⋅4−6⋅1=145\cdot4 - 6\cdot1 = 14; formula gives 18−4=1418 - 4 = 14 ✓. Diagonalizing the companion matrix is the "characteristic equation" method — now you know why it works.