MAT1041 · Week 13 · - Eigenvalues and Eigenvectors

Diagonalization and matrix powers

You learn to test whether a matrix is diagonalizable by counting eigenvectors, to build P and D and write A = PDP⁻¹, and to use it to compute high powers of A quickly.

diagonalizablediagonalizationdiagonal matrixsimilar matriceseigenvector basisalgebraic multiplicitygeometric multiplicitydefective matrixmatrix powers

Working with a diagonal matrix is child’s play: its product, inverse, power and determinant are visible at a glance. Diagonalization means transforming a matrix into a diagonal matrix in a suitable basis. We saw in week 12 that the matrices of the same transformation in different bases are similar (A′=P−1APA' = P^{-1}AP). If we choose the eigenvectors as the basis, A′A' is diagonal and the eigenvalues stand on the diagonal. This page answers two questions: when is this possible, and what is it good for when it is possible.

Golden rules:

  1. An n×nn \times n matrix is diagonalizable   ⟺  \iff it has nn independent eigenvectors.
  2. nn distinct eigenvalues are enough. For a repeated eigenvalue, compute the dimension of the eigenspace.
  3. The columns of PP are the eigenvectors, the eigenvalues in DD in the same order.
  4. Check without taking A−1A^{-1}: AP=PDAP = PD.

Definition and the main theorem

A square matrix AA is diagonalizable if there is an invertible PP such that P−1AP=DP^{-1}AP = D is diagonal. Equivalently: A=PDP−1A = PDP^{-1}.

Theorem. If AA is n×nn \times n: AA is diagonalizable   ⟺  \iff AA has nn linearly independent eigenvectors. In that case

P=[v1∣v2∣⋯∣vn],D=diag⁡(λ1,λ2,…,λn),Avi=λivi.P = [\mathbf{v}_1 \mid \mathbf{v}_2 \mid \cdots \mid \mathbf{v}_n], \qquad D = \operatorname{diag}(\lambda_1, \lambda_2, \dots, \lambda_n), \qquad A\mathbf{v}_i = \lambda_i\mathbf{v}_i.

Why? AP=[Av1∣⋯∣Avn]=[λ1v1∣⋯∣λnvn]=PDAP = [A\mathbf{v}_1 \mid \cdots \mid A\mathbf{v}_n] = [\lambda_1\mathbf{v}_1 \mid \cdots \mid \lambda_n\mathbf{v}_n] = PD. Since the columns are independent, PP is invertible, and P−1AP=DP^{-1}AP = D.

The recipe

  1. Solve the characteristic equation: the eigenvalues and their algebraic multiplicities.
  2. Find a basis of EλE_\lambda for each eigenvalue.
  3. Count the vectors in all the bases. If there are nn, it is diagonalizable; if fewer, it is not.
  4. Write PP with the eigenvectors and DD with the corresponding eigenvalues in the same order.

Since eigenvectors of distinct eigenvalues are always independent, putting together vectors from different eigenspaces in step 3 is safe.

Example 1. A=[2321]A = \begin{bmatrix} 2 & 3 \\ 2 & 1 \end{bmatrix}. From the previous page: (3,2)(3, 2) for λ=4\lambda = 4, (1,−1)(1, -1) for λ=−1\lambda = -1.

P=[312−1],D=[400−1],P−1=15[112−3].P = \begin{bmatrix} 3 & 1 \\ 2 & -1 \end{bmatrix}, \quad D = \begin{bmatrix} 4 & 0 \\ 0 & -1 \end{bmatrix}, \quad P^{-1} = \frac15\begin{bmatrix} 1 & 1 \\ 2 & -3 \end{bmatrix}.

Check: AP=[6+62−34+22−1]=[12−181]AP = \begin{bmatrix} 6 + 6 & 2 - 3 \\ 4 + 2 & 2 - 1 \end{bmatrix} = \begin{bmatrix} 12 & -1 \\ 8 & 1 \end{bmatrix}, PD=[12−181]PD = \begin{bmatrix} 12 & -1 \\ 8 & 1 \end{bmatrix}. Equal.

PP is not unique: you can scale the eigenvectors or change their order. If you change the order, the diagonal of DD changes in the same way.

Example 2 (a repeated eigenvalue, still diagonalizable). The A=[32−223−222−1]A = \begin{bmatrix} 3 & 2 & -2 \\ 2 & 3 & -2 \\ 2 & 2 & -1 \end{bmatrix} from the previous page: two independent eigenvectors (−1,1,0)(-1, 1, 0), (1,0,1)(1, 0, 1) for λ=1\lambda = 1 (algebraic 2); (1,1,1)(1, 1, 1) for λ=3\lambda = 3. In total 3:

P=[−111101011],D=[100010003].P = \begin{bmatrix} -1 & 1 & 1 \\ 1 & 0 & 1 \\ 0 & 1 & 1 \end{bmatrix}, \qquad D = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 3 \end{bmatrix}.

When is it not diagonalizable?

If the geometric multiplicity of an eigenvalue is smaller than its algebraic multiplicity, there are not enough eigenvectors.

Example 3. A=[2102]A = \begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix}. Eigenvalue 2 (algebraic 2). A−2I=[0100]A - 2I = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, E2=span⁡{(1,0)}E_2 = \operatorname{span}\{(1, 0)\}. Only one independent eigenvector: not diagonalizable. A matrix of this kind is called defective.

CaseDecision
nn distinct eigenvaluesdiagonalizable
repeated eigenvalue, geometric = algebraic for eachdiagonalizable
geometric < algebraic for some eigenvaluenot diagonalizable
a non-real eigenvalue (for real diagonalization)not diagonalizable

PITFALL · saying “not diagonalizable” when you see a repeated root. A repeated eigenvalue alone says nothing. Example 2 is diagonalizable, Q9 is not; both have a double root. Don’t decide without computing the dimension of the eigenspace.

Powers: Aᵏ = PDᵏP⁻¹

If A=PDP−1A = PDP^{-1} then

A2=PDP−1PDP−1=PD2P−1,Ak=PDkP−1.A^2 = PDP^{-1}PDP^{-1} = PD^2P^{-1}, \qquad A^k = PD^kP^{-1}.

The P−1PP^{-1}P in the middle disappear. And DkD^k is just the kkth power of the diagonal entries. A5A^5 for Example 1:

D^5    = diag(4^5, (-1)^5) = diag(1024, -1)
P D^5  = [3·1024  1·(-1); 2·1024  (-1)(-1)] = [3072 -1; 2048 1]
A^5    = (P D^5) P⁻¹ = (1/5) [3072 - 2   3072 + 3; 2048 + 2   2048 - 3]
       = (1/5) [3070 3075; 2050 2045] = [614 615; 410 409]

Check: trace 614+409=1023=45+(−1)5614 + 409 = 1023 = 4^5 + (-1)^5. A single chain of products instead of multiplying directly five times.

The same idea extends to polynomials: p(A)=P p(D) P−1p(A) = P\,p(D)\,P^{-1}. Applications such as systems of differential equations and Markov chains rest on this formula.

In the language of linear transformations

If T(x)=AxT(\mathbf{x}) = A\mathbf{x} and AA is diagonalizable, then in the basis BB made of eigenvectors the matrix of TT is DD (week 12, A′=P−1APA' = P^{-1}AP). That is, in this basis TT multiplies each coordinate separately by a number. Diagonalization is finding the coordinate system that shows the transformation in its simplest form.

Common mistakes

WrongRight
Writing the eigenvectors as rows of PPColumns
Writing the order in DD different from the column order of PPThe same order
A=P−1DPA = P^{-1}DPA=PDP−1A = PDP^{-1} (if the eigenvectors are columns)
Repeated eigenvalue = not diagonalizableCompute the dimension of the eigenspace
Ak=PkDkP−kA^k = P^kD^kP^{-k}PDkP−1PD^kP^{-1}
Putting the diagonal of AA into DDThe eigenvalues
Finishing AkA^k without computing P−1P^{-1}Ak=PDkP−1A^k = PD^kP^{-1}, P−1P^{-1} is required

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Is A=[1203]A = \begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix} diagonalizable?

Show answer
Yes

Triangular: the eigenvalues are 11 and 33, and they are distinct. If an n×nn \times n matrix has nn distinct eigenvalues it is diagonalizable (the eigenvectors of distinct eigenvalues are independent).

Question 2easy

Is A=[5105]A = \begin{bmatrix} 5 & 1 \\ 0 & 5 \end{bmatrix} diagonalizable?

Show answer
No

The only eigenvalue is 55, with algebraic multiplicity 2. A−5I=[0100]A - 5I = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}: y=0y = 0, E5=span⁡{(1,0)}E_5 = \operatorname{span}\{(1, 0)\}, dimension 1.
There are not two independent eigenvectors. (If it were diagonalizable, D=5ID = 5I and A=P(5I)P−1=5IA = P(5I)P^{-1} = 5I would follow, but A≠5IA \neq 5I.)

Question 3medium

Diagonalize A=[1423]A = \begin{bmatrix} 1 & 4 \\ 2 & 3 \end{bmatrix}: find PP and DD with P−1AP=DP^{-1}AP = D.

Show answer
P=[121−1], D=[500−1]P = \begin{bmatrix} 1 & 2 \\ 1 & -1 \end{bmatrix},\ D = \begin{bmatrix} 5 & 0 \\ 0 & -1 \end{bmatrix}

The eigenvalues are 5,−15, -1. E5E_5: (1,1)(1, 1). E−1E_{-1}: x+2y=0x + 2y = 0, for example (2,−1)(2, -1).
The eigenvectors are the columns of PP, the eigenvalues in DD in the same order.
Check: AP=[5−251]=PDAP = \begin{bmatrix} 5 & -2 \\ 5 & 1 \end{bmatrix} = PD.

Question 4medium

Use the diagonalization of the previous question to compute A4A^4.

Show answer
[209416208417]\begin{bmatrix} 209 & 416 \\ 208 & 417 \end{bmatrix}

A4=PD4P−1A^4 = PD^4P^{-1}, D4=diag⁡(625,1)D^4 = \operatorname{diag}(625, 1), P−1=13[121−1]P^{-1} = \frac13\begin{bmatrix} 1 & 2 \\ 1 & -1 \end{bmatrix}.PD4=[6252625−1]PD^4 = \begin{bmatrix} 625 & 2 \\ 625 & -1 \end{bmatrix}. Multiply: 13[62712486241251]=[209416208417]\frac13\begin{bmatrix} 627 & 1248 \\ 624 & 1251 \end{bmatrix} = \begin{bmatrix} 209 & 416 \\ 208 & 417 \end{bmatrix}.
Check: trace 626=54+(−1)4626 = 5^4 + (-1)^4.

Question 5medium

Find the matrix AA with eigenvectors (1,1)(1, 1) for λ=2\lambda = 2 and (1,2)(1, 2) for λ=3\lambda = 3.

Show answer
[11−24]\begin{bmatrix} 1 & 1 \\ -2 & 4 \end{bmatrix}

A=PDP−1A = PDP^{-1}, P=[1112]P = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}, D=diag⁡(2,3)D = \operatorname{diag}(2, 3), P−1=[2−1−11]P^{-1} = \begin{bmatrix} 2 & -1 \\ -1 & 1 \end{bmatrix}.PD=[2326]PD = \begin{bmatrix} 2 & 3 \\ 2 & 6 \end{bmatrix}, PDP−1=[4−3−2+34−6−2+6]=[11−24]PDP^{-1} = \begin{bmatrix} 4 - 3 & -2 + 3 \\ 4 - 6 & -2 + 6 \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ -2 & 4 \end{bmatrix}.
Check: A(1,2)T=(3,6)=3(1,2)A(1, 2)^T = (3, 6) = 3(1, 2).

Question 6hard

Is A=[210020003]A = \begin{bmatrix} 2 & 1 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix} diagonalizable?

Show answer
No

λ=2\lambda = 2: algebraic 2, but E2=span⁡{(1,0,0)}E_2 = \operatorname{span}\{(1, 0, 0)\}, geometric 1. λ=3\lambda = 3: 1 eigenvector.
The total number of independent eigenvectors is 1+1=2<31 + 1 = 2 < 3. Not diagonalizable.

Question 7hard

For which values of kk is [1k01]\begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix} diagonalizable?

Show answer
k=0k = 0 only

The only eigenvalue is 1 (algebraic 2). A−I=[0k00]A - I = \begin{bmatrix} 0 & k \\ 0 & 0 \end{bmatrix}.k≠0k \neq 0: y=0y = 0, the eigenspace has dimension 1, not diagonalizable. k=0k = 0: A=IA = I is already diagonal.

Question 8medium

True or false: A 3×33 \times 3 matrix with eigenvalues 1,2,31, 2, 3 is diagonalizable.

Show answer
True

Three distinct eigenvalues, each has at least one eigenvector, and eigenvectors of distinct eigenvalues are independent. 3 independent eigenvectors: it is diagonalizable.
The converse is not true: a matrix with a repeated eigenvalue can also be diagonalizable (for example II).

Question 9hard

Is B=[300121112]B = \begin{bmatrix} 3 & 0 & 0 \\ 1 & 2 & 1 \\ 1 & 1 & 2 \end{bmatrix} diagonalizable? (Its characteristic polynomial is (λ−1)(λ−3)2(\lambda - 1)(\lambda - 3)^2.)

Show answer
No

λ=3\lambda = 3 has algebraic multiplicity 2. B−3I=[0001−1111−1]B - 3I = \begin{bmatrix} 0 & 0 & 0 \\ 1 & -1 & 1 \\ 1 & 1 & -1 \end{bmatrix}. R1↔R2R_1 \leftrightarrow R_2, R3←R3−R1R_3 \leftarrow R_3 - R_1: (0,2,−2)(0, 2, -2), then move the zero row to the bottom.
Rank 2, dim⁡E3=3−2=1<2\dim E_3 = 3 - 2 = 1 < 2. E3=span⁡{(0,1,1)}E_3 = \operatorname{span}\{(0, 1, 1)\}. Not diagonalizable.
Trap: the matrix "looks like a symmetric one" but is not (row 1 and column 1 differ).

Question 10hard

Compute A10A^{10} for A=[1012]A = \begin{bmatrix} 1 & 0 \\ 1 & 2 \end{bmatrix}.

Show answer
[1010231024]\begin{bmatrix} 1 & 0 \\ 1023 & 1024 \end{bmatrix}

The eigenvalues are 1 and 2. E1E_1: x+y=0x + y = 0, (−1,1)(-1, 1). E2E_2: x=0x = 0, (0,1)(0, 1).P=[−1011]=P−1P = \begin{bmatrix} -1 & 0 \\ 1 & 1 \end{bmatrix} = P^{-1}. A10=Pdiag⁡(1,1024)P−1=[−1011024][−1011]=[1010231024]A^{10} = P\operatorname{diag}(1, 1024)P^{-1} = \begin{bmatrix} -1 & 0 \\ 1 & 1024 \end{bmatrix}\begin{bmatrix} -1 & 0 \\ 1 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 1023 & 1024 \end{bmatrix}.
Pattern: the (2,1)(2,1) entry is 210−12^{10} - 1.

Question 11easy

A=PDP−1A = PDP^{-1} with D=diag⁡(2,−1,3)D = \operatorname{diag}(2, -1, 3). Find det⁡A\det A.

Show answer
-6

det⁡A=det⁡Pdet⁡Ddet⁡P−1=det⁡D=2⋅(−1)⋅3=−6\det A = \det P\det D\det P^{-1} = \det D = 2 \cdot (-1) \cdot 3 = -6.
Similar matrices have the same determinant; the determinant is the product of the eigenvalues.

Verification: All diagonalizations were verified in node by computing the product P⁻¹AP = D exactly with BigInt fractions; matrix powers were computed both with P·Dᵏ·P⁻¹ and by direct repeated multiplication and compared; in the non-diagonalizable examples the eigenspace dimensions were found with the exact null space (verify/MAT1041/13.mjs).

Review card

A is diagonalizable ⇔ A = PDP⁻¹ (P⁻¹AP = D) ⇔ A has n INDEPENDENT eigenvectors. The COLUMNS of P = eigenvectors; the diagonal of D = the corresponding eigenvalues (SAME ORDER). Recipe: (1) solve det(λI - A) = 0 (2) a basis of E_λ for each λ (3) are there n vectors in total? yes → write P and D; no → not diagonalizable. n DISTINCT eigenvalues → definitely diagonalizable. Repeated λ: geometric = algebraic is required (for every λ). A matrix of the type [λ 1; 0 λ] (Jordan block) → NOT DIAGONALIZABLE. Check: AP = PD (without taking an inverse). Powers: A^k = P D^k P⁻¹, D^k = the k-th power of the numbers on the diagonal. det A = Πλ, tr A = Σλ (read from D). Similar matrices: same eigenvalues, det, trace, rank. Symmetric matrices are ALWAYS diagonalizable (week 14).