Unit 8, lesson 41

Diagonalization and Matrix Powers

How an eigenbasis gives a diagonalization, why powers of a diagonalizable matrix reduce to powers of its eigenvalues, how this describes a repeated linear update, and how to test whether a matrix is diagonalizable.

  • Video 41
  • Diagonalization

Start with the vector (1,0)(1, 0) and apply the matrix with rows (2,1)(2, 1) and (1,2)(1, 2) again and again. The outputs (2,1)(2, 1), (5,4)(5, 4) and (14,13)(14, 13) follow no obvious pattern, and the fiftieth one seems to need fifty multiplications. Yet in a well-chosen pair of coordinates the same matrix only stretches one axis by 33 and leaves the other alone, and then every power is easy to write down. This lesson builds those coordinates from eigenvectors, writes the matrix as PDP−1PDP^{-1}, and shows how to recognize a matrix for which no such coordinates exist. Here and below, a tuple such as (1,0)(1, 0) stands for a column vector.

Key terms

Eigenbasis

Definition Let AA be a real n×nn \times n matrix. An eigenbasis of AA is an ordered basis B=(v1,…,vn)\mathcal{B} = (\mathbf{v}_1, \dots, \mathbf{v}_n) of Rn\mathbb{R}^n in which every vector is an eigenvector of AA, so that Avj=λjvjA\mathbf{v}_j = \lambda_j\mathbf{v}_j for real numbers λ1,…,λn\lambda_1, \dots, \lambda_n. The eigenvalues in this list need not be distinct. The eigenvector matrix P=[v1 ⋯ vn]P = [\mathbf{v}_1 \ \cdots \ \mathbf{v}_n] is invertible because its columns form a basis, and DD denotes the diagonal matrix with λ1,…,λn\lambda_1, \dots, \lambda_n on its diagonal in the same order. The coordinates of a vector x\mathbf{x} in this basis, its eigen-coordinates, are

[x]B=P−1x.[\mathbf{x}]_{\mathcal{B}} = P^{-1}\mathbf{x}.

A few eigenvectors are not enough. The list must contain nn linearly independent eigenvectors.

In plain words An eigenbasis is a set of axes along which the matrix only stretches, shrinks or flips. Each axis comes with its own factor, the eigenvalue.

Example Let SS be the matrix with rows (2,1)(2, 1) and (1,2)(1, 2). The vectors u=(1,1)\mathbf{u} = (1, 1) and w=(1,−1)\mathbf{w} = (1, -1) satisfy Su=(3,3)=3uS\mathbf{u} = (3, 3) = 3\mathbf{u} and Sw=(1,−1)=1wS\mathbf{w} = (1, -1) = 1\mathbf{w}. The matrix

P=[111−1]P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}

has determinant −2≠0-2 \ne 0, so (u,w)(\mathbf{u}, \mathbf{w}) is an eigenbasis of SS, and the matching diagonal matrix has entries 33 and 11 in that order. The reversed list (w,u)(\mathbf{w}, \mathbf{u}) is also an eigenbasis, but then the diagonal entries must be reversed too, to 11 and 33.

Diagonalization

Definition A real n×nn \times n matrix AA is diagonalizable over R\mathbb{R} if there are an invertible real n×nn \times n matrix PP and a real diagonal matrix DD with

A=PDP−1.A = PDP^{-1}.

Such a factorization is a diagonalization of AA. The following theorem says exactly which PP and DD work. Let PP be invertible with columns p1,…,pn\mathbf{p}_1, \dots, \mathbf{p}_n, and let DD be diagonal with entries d1,…,dnd_1, \dots, d_n. Then A=PDP−1A = PDP^{-1} if and only if Apj=djpjA\mathbf{p}_j = d_j\mathbf{p}_j for every jj, that is, if and only if the columns of PP form an eigenbasis of AA with eigenvalues d1,…,dnd_1, \dots, d_n in matching order. The proof compares columns. Since PP is invertible, A=PDP−1A = PDP^{-1} is equivalent to AP=PDAP = PD, and column jj of APAP is ApjA\mathbf{p}_j while column jj of PDPD is djpjd_j\mathbf{p}_j. So AA is diagonalizable over R\mathbb{R} exactly when Rn\mathbb{R}^n has an eigenbasis of AA, and then D=P−1APD = P^{-1}AP is the matrix of the map x↦Ax\mathbf{x} \mapsto A\mathbf{x} in that eigenbasis. Allowing complex entries in PP and DD gives diagonalizability over C\mathbb{C}, and the choice of scalars can change the answer.

In plain words Read PDP−1xPDP^{-1}\mathbf{x} from right to left. First P−1P^{-1} finds the eigen-coordinates of x\mathbf{x}, then DD scales each coordinate by its own eigenvalue, and finally PP turns the scaled coordinates back into a vector in standard coordinates. Only the middle step carries out the action of AA. The outer two steps change how the vector is described, not the vector itself.

Example For the eigenbasis of SS above, P2=2IP^2 = 2I, so P−1=12PP^{-1} = \tfrac{1}{2}P and

S=PDP−1=[111−1][3001]12[111−1].\begin{aligned} S &= PDP^{-1} \\[0.4em] &= \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\begin{bmatrix} 3 & 0 \\ 0 & 1 \end{bmatrix}\frac{1}{2}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}. \end{aligned}

The column check behind it is SP=PDSP = PD. Both sides have columns (3,3)(3, 3) and (1,−1)(1, -1), which are 3u3\mathbf{u} and 1w1\mathbf{w}.

Matrix powers in eigen-coordinates

Definition If A=PDP−1A = PDP^{-1} with DD diagonal, then for every integer k≥0k \ge 0

Ak=PDkP−1,Dk=diag⁡(d1k,…,dnk),\begin{gathered} A^k = PD^kP^{-1}, \\[0.4em] D^k = \operatorname{diag}(d_1^k, \dots, d_n^k), \end{gathered}

where A0=IA^0 = I. The reason is that neighboring factors cancel. For example A2=PDP−1PDP−1=PD2P−1A^2 = PDP^{-1}PDP^{-1} = PD^2P^{-1}, and each further factor of AA cancels one more pair P−1PP^{-1}P. To apply AkA^k to a vector x\mathbf{x}, compute its eigen-coordinates c=P−1x\mathbf{c} = P^{-1}\mathbf{x}, multiply each cjc_j by djkd_j^k, and multiply the result by PP. If every djd_j is nonzero, then AA is invertible with A−1=PD−1P−1A^{-1} = PD^{-1}P^{-1}, and the formula holds for negative kk as well.

In plain words In eigen-coordinates a power of the matrix is just a power of each eigenvalue. The coordinates never mix, so each one is simply multiplied by its own eigenvalue at every step.

Example For SS and e1=(1,0)\mathbf{e}_1 = (1, 0), the eigen-coordinates are P−1e1=(12,12)P^{-1}\mathbf{e}_1 = (\tfrac{1}{2}, \tfrac{1}{2}), so e1=12u+12w\mathbf{e}_1 = \tfrac{1}{2}\mathbf{u} + \tfrac{1}{2}\mathbf{w}. After kk steps the first coordinate has been multiplied by 3k3^k and the second by 1k=11^k = 1, so

Ske1=3k2[11]+12[1−1]=12[3k+13k−1].\begin{aligned} S^k\mathbf{e}_1 &= \frac{3^k}{2}\begin{bmatrix} 1 \\ 1 \end{bmatrix} + \frac{1}{2}\begin{bmatrix} 1 \\ -1 \end{bmatrix} \\[0.4em] &= \frac{1}{2}\begin{bmatrix} 3^k + 1 \\ 3^k - 1 \end{bmatrix}. \end{aligned}

For k=2k = 2 this gives (5,4)(5, 4), and direct multiplication agrees, since Se1=(2,1)S\mathbf{e}_1 = (2, 1) and S(2,1)=(5,4)S(2, 1) = (5, 4). Multiplying out PDkP−1PD^kP^{-1} gives the whole power,

Sk=12[3k+13k−13k−13k+1].S^k = \frac{1}{2}\begin{bmatrix} 3^k + 1 & 3^k - 1 \\ 3^k - 1 & 3^k + 1 \end{bmatrix}.

Repeated linear update

Definition A repeated linear update is a sequence of vectors x0,x1,x2,…\mathbf{x}_0, \mathbf{x}_1, \mathbf{x}_2, \dots in Rn\mathbb{R}^n produced by a fixed real n×nn \times n matrix AA through the rule

xk+1=Axk,k=0,1,2,…,\mathbf{x}_{k+1} = A\mathbf{x}_k, \qquad k = 0, 1, 2, \dots,

so that xk=Akx0\mathbf{x}_k = A^k\mathbf{x}_0. Such a rule is also called a discrete linear dynamical system. Suppose AA has an eigenbasis (v1,…,vn)(\mathbf{v}_1, \dots, \mathbf{v}_n) with eigenvalues λ1,…,λn\lambda_1, \dots, \lambda_n, and write the starting vector as x0=c1v1+⋯+cnvn\mathbf{x}_0 = c_1\mathbf{v}_1 + \cdots + c_n\mathbf{v}_n. Then

xk=c1λ1kv1+⋯+cnλnkvn.\mathbf{x}_k = c_1\lambda_1^k\mathbf{v}_1 + \cdots + c_n\lambda_n^k\mathbf{v}_n.

A term with cj≠0c_j \ne 0 grows when ∣λj∣>1\lvert \lambda_j \rvert > 1, dies out when ∣λj∣<1\lvert \lambda_j \rvert < 1 and stays fixed when λj=1\lambda_j = 1, and a negative λj\lambda_j makes it change sign at every step.

In plain words Split the starting state into eigenvector pieces, let each piece evolve on its own by its eigenvalue, and add the pieces back together. What the update means in an application comes from the equations. The update x′=2x+yx' = 2x + y, y′=x+2yy' = x + 2y given by SS triples the sum x+yx + y and keeps the difference x−yx - y, so it does not conserve the total.

Example Each year 8080 percent of the people in town XX stay and 2020 percent move to town YY, while 7070 percent of the people in YY stay and 3030 percent move to XX. With xk\mathbf{x}_k listing the populations of XX and YY in thousands after kk years,

xk+1=110[8327]xk.\mathbf{x}_{k+1} = \frac{1}{10}\begin{bmatrix} 8 & 3 \\ 2 & 7 \end{bmatrix}\mathbf{x}_k.

The matrix sends (3,2)(3, 2) to itself and (1,−1)(1, -1) to 12(1,−1)\tfrac{1}{2}(1, -1), so its eigenvalues are 11 and 12\tfrac{1}{2}. Starting from x0=(100,0)\mathbf{x}_0 = (100, 0), solving gives (100,0)=20(3,2)+40(1,−1)(100, 0) = 20(3, 2) + 40(1, -1), and therefore

xk=20[32]+402k[1−1].\mathbf{x}_k = 20\begin{bmatrix} 3 \\ 2 \end{bmatrix} + \frac{40}{2^k}\begin{bmatrix} 1 \\ -1 \end{bmatrix}.

This gives x1=(80,20)\mathbf{x}_1 = (80, 20) and x2=(70,30)\mathbf{x}_2 = (70, 30), and as kk grows the populations approach (60,40)(60, 40). The total stays 100100 because each column of the matrix adds up to 11.

Diagonalizability test

Definition Let AA be a real n×nn \times n matrix whose distinct real eigenvalues are λ1,…,λp\lambda_1, \dots, \lambda_p, and let Eλ=Null⁡(A−λI)E_{\lambda} = \operatorname{Null}(A - \lambda I) be the eigenspace of λ\lambda. Then AA is diagonalizable over R\mathbb{R} if and only if

dim⁡Eλ1+⋯+dim⁡Eλp=n.\dim E_{\lambda_1} + \cdots + \dim E_{\lambda_p} = n.

The reason is that bases of the separate eigenspaces, listed together, always form a linearly independent list. In a linear relation among these vectors, group the terms by eigenspace. Each group adds up to a vector of its eigenspace. If some of these sums were not 0\mathbf{0}, they would be eigenvectors for distinct eigenvalues adding up to 0\mathbf{0}, which their independence rules out. So every group adds up to 0\mathbf{0}, and since each group uses the vectors of one basis, all coefficients are zero. The combined list is an eigenbasis exactly when it has nn vectors. Conversely, an eigenbasis has at most dim⁡Eλj\dim E_{\lambda_j} of its vectors in each EλjE_{\lambda_j}, so when one exists the dimensions add up to at least nn, and the independent combined list shows they never add up to more. Several consequences follow. If AA has nn distinct real eigenvalues, it is diagonalizable over R\mathbb{R}, but this sufficient condition is not necessary, as the diagonal matrix with entries 2,2,32, 2, 3 below shows. If the characteristic polynomial χA\chi_A factors into real linear factors, then AA is diagonalizable over R\mathbb{R} if and only if every eigenvalue has geometric multiplicity equal to its algebraic multiplicity, since the algebraic multiplicities add up to nn and no geometric multiplicity exceeds its algebraic one. If χA\chi_A has a nonreal root, then AA is not diagonalizable over R\mathbb{R}. A defective matrix, one with an eigenvalue whose geometric multiplicity is smaller than its algebraic multiplicity, is not diagonalizable even when complex scalars are allowed.

In plain words Count independent eigenvector directions. If they fill the whole space, the matrix can be diagonalized. A repeated eigenvalue causes no trouble when its eigenspace is as large as its multiplicity, and it blocks diagonalization when the eigenspace falls short.

Example The diagonal matrix with entries 2,2,32, 2, 3 has a repeated eigenvalue, yet E2=span⁡{e1,e2}E_2 = \operatorname{span}\{\mathbf{e}_1, \mathbf{e}_2\} and E3=span⁡{e3}E_3 = \operatorname{span}\{\mathbf{e}_3\} have dimensions adding up to 33, so it is diagonalizable. It is already diagonal. By contrast,

J=[2102]J = \begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix}

has χJ(t)=(t−2)2\chi_J(t) = (t - 2)^2, but J−2IJ - 2I has rows (0,1)(0, 1) and (0,0)(0, 0), so E2=span⁡{e1}E_2 = \operatorname{span}\{\mathbf{e}_1\} has dimension 1<21 < 2. Every eigenvector of JJ lies on the first axis, so any 2×22 \times 2 matrix built from eigenvectors of JJ is singular, and no diagonalization exists. Powers can still be computed directly. They are

Jk=[2kk 2k−102k],J^k = \begin{bmatrix} 2^k & k\,2^{k-1} \\ 0 & 2^k \end{bmatrix},

for example J2J^2 has rows (4,4)(4, 4) and (0,4)(0, 4). A diagonal matrix with entries 2,22, 2 would lose the upper right entry. Generalized eigenvectors and the Jordan form describe matrices like JJ.

Check yourself

  1. The matrix AA with rows (1,2)(1, 2) and (2,1)(2, 1) has eigenvectors (1,1)(1, 1) for the eigenvalue 33 and (1,−1)(1, -1) for the eigenvalue −1-1. Use eigen-coordinates to find A3(3,1)A^3(3, 1), and check the answer by direct multiplication.
Show the answer

Solve (3,1)=c1(1,1)+c2(1,−1)(3, 1) = c_1(1, 1) + c_2(1, -1). The equations c1+c2=3c_1 + c_2 = 3 and c1−c2=1c_1 - c_2 = 1 give c1=2c_1 = 2 and c2=1c_2 = 1. Scaling each coordinate by the cube of its eigenvalue gives

A3[31]=2⋅27[11]+(−1)3[1−1]=[5355].\begin{aligned} A^3\begin{bmatrix} 3 \\ 1 \end{bmatrix} &= 2 \cdot 27\begin{bmatrix} 1 \\ 1 \end{bmatrix} + (-1)^3\begin{bmatrix} 1 \\ -1 \end{bmatrix} \\[0.4em] &= \begin{bmatrix} 53 \\ 55 \end{bmatrix}. \end{aligned}

Direct multiplication gives the chain (3,1)(3, 1), (5,7)(5, 7), (19,17)(19, 17), (53,55)(53, 55), which agrees. The negative eigenvalue makes the second piece change sign at every step.

  1. The matrix MM with rows (4,1)(4, 1) and (2,3)(2, 3) has eigenvalues 55 and 22. Find an eigenbasis, write M=PDP−1M = PDP^{-1}, and give a formula for MkM^k. Check the formula at k=1k = 1.
Show the answer

The matrix M−5IM - 5I has rows (−1,1)(-1, 1) and (2,−2)(2, -2), so E5=span⁡{(1,1)}E_5 = \operatorname{span}\{(1, 1)\}. The matrix M−2IM - 2I has rows (2,1)(2, 1) and (2,1)(2, 1), so E2=span⁡{(−1,2)}E_2 = \operatorname{span}\{(-1, 2)\}. The two eigenvectors form an eigenbasis, and

P=[1−112],D=[5002],P−1=13[21−11].\begin{gathered} P = \begin{bmatrix} 1 & -1 \\ 1 & 2 \end{bmatrix}, \qquad D = \begin{bmatrix} 5 & 0 \\ 0 & 2 \end{bmatrix}, \\[0.4em] P^{-1} = \frac{1}{3}\begin{bmatrix} 2 & 1 \\ -1 & 1 \end{bmatrix}. \end{gathered}

Multiplying out PDkP−1PD^kP^{-1} gives

Mk=13[2⋅5k+2k5k−2k2⋅5k−2k+15k+2k+1].M^k = \frac{1}{3}\begin{bmatrix} 2 \cdot 5^k + 2^k & 5^k - 2^k \\ 2 \cdot 5^k - 2^{k+1} & 5^k + 2^{k+1} \end{bmatrix}.

At k=1k = 1 the bracket has rows (12,3)(12, 3) and (6,9)(6, 9), and one third of it is MM.

  1. Which of the matrices AA with rows (3,1),(0,3)(3, 1), (0, 3), BB with rows (3,0),(0,3)(3, 0), (0, 3) and CC with rows (3,1),(0,2)(3, 1), (0, 2) are diagonalizable over R\mathbb{R}? A classmate says that Ak=3kIA^k = 3^k I because 33 is the only eigenvalue of AA. What is wrong?
Show the answer

The matrix B=3IB = 3I is already diagonal. The matrix CC is triangular with distinct eigenvalues 33 and 22, so it is diagonalizable, with eigenvectors (1,0)(1, 0) and (−1,1)(-1, 1). The matrix AA has the single eigenvalue 33 with algebraic multiplicity 22, but A−3IA - 3I has rows (0,1)(0, 1) and (0,0)(0, 0), so E3=span⁡{e1}E_3 = \operatorname{span}\{\mathbf{e}_1\} has dimension 11. It is defective and not diagonalizable. The classmate replaced AA by a diagonal matrix of its eigenvalues, which is valid only with an eigenbasis. In fact A2A^2 has rows (9,6)(9, 6) and (0,9)(0, 9), so A2≠9IA^2 \ne 9I. A diagonalizable matrix whose only eigenvalue is 33 would equal P(3I)P−1=3IP(3I)P^{-1} = 3I, and AA does not.

How this lesson connects

Where this leads in Linear Algebra II