C11 - Diagonalisation and matrix powers

C11 - Diagonalisation and matrix powers

Repeated matrix multiplication can become a calculation with ordinary powers. You will choose independent eigenvectors, place their eigenvalues in a matching diagonal matrix, and use the resulting diagonalisation to find matrix powers. You will also decide when this method is available over the real numbers.

Building U from independent eigenvectors

Can you find A20\mathbf{A}^{20} for A=(3113)\mathbf{A}=\begin{pmatrix}3&1\\1&3\end{pmatrix} without carrying out 19 successive matrix products? Its eigenvectors suggest a better coordinate system: along (1,1)T(1,1)^{\mathsf T} it multiplies by 4, and along (1,−1)T(1,-1)^{\mathsf T} it multiplies by 2.

In two dimensions, two nonparallel vectors let you express every vector uniquely as a combination of them. For example,

(xy)=x+y2(11)+x−y2(1−1)\begin{pmatrix}x\\y\end{pmatrix} =\frac{x+y}{2}\begin{pmatrix}1\\1\end{pmatrix} +\frac{x-y}{2}\begin{pmatrix}1\\-1\end{pmatrix}

These two eigenvectors form a basis. In that basis, the matrix just scales the two coefficients separately. In three dimensions you need three linearly independent vectors: none can be a combination of the others.

Eigenvector matrix

For an r×rr\times r real matrix with rr linearly independent real eigenvectors v1,…,vr\mathbf{v}_1,\ldots,\mathbf{v}_r, form

U=(∣∣v1⋯vr∣∣),D=diag⁡(λ1,…,λr)\mathbf{U}=\begin{pmatrix}|&&|\\\mathbf{v}_1&\cdots&\mathbf{v}_r\\|&&|\end{pmatrix},\qquad \mathbf{D}=\operatorname{diag}(\lambda_1,\ldots,\lambda_r)

The eigenvectors go in the columns of U\mathbf{U}. Each λj\lambda_j must correspond to column jj. Independence makes U\mathbf{U} invertible: equivalently, det⁡U≠0\det\mathbf{U}\ne0.

The choices are not unique. You can rescale an eigenvector by any nonzero scalar, or reorder the columns, provided the eigenvalues follow the same order.

Worked example 1: choosing a basis and a matching diagonal

Question. The eigenpairs of A=(3113)\mathbf{A}=\begin{pmatrix}3&1\\1&3\end{pmatrix} include 4,(1,1)T4,(1,1)^{\mathsf T} and 2,(1,−1)T2,(1,-1)^{\mathsf T}. Construct U\mathbf{U} and D\mathbf{D}, and check that U\mathbf{U} is invertible.

Plan. Use the listed order for both matrices and calculate a determinant.

U=(111−1),D=(4002),det⁡U=−1−1=−2≠0\mathbf{U}=\begin{pmatrix}1&1\\1&-1\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}4&0\\0&2\end{pmatrix},\quad \det\mathbf{U}=-1-1=-2\ne0

Answer. The displayed matrices give a valid ordered eigenvector basis and matching eigenvalues.

Check. Compare the column products:

AU=(424−2)=UD\mathbf{A}\mathbf{U}=\begin{pmatrix}4&2\\4&-2\end{pmatrix} =\mathbf{U}\mathbf{D}

Right multiplication by D\mathbf{D} scales column 1 by 4 and column 2 by 2, exactly as required.

Swap the two eigenvectors but leave their lengths unchanged. Only their positions and the matching diagonal positions change.

Worked example 2: a different valid order

Question. Construct another valid pair by placing (1,−1)T(1,-1)^{\mathsf T} first.

Plan. Move its eigenvalue 2 into the first diagonal position and check independence again.

U~=(11−11),D~=(2004),det⁡U~=1+1=2≠0\widetilde{\mathbf{U}}=\begin{pmatrix}1&1\\-1&1\end{pmatrix},\quad \widetilde{\mathbf{D}}=\begin{pmatrix}2&0\\0&4\end{pmatrix},\quad \det\widetilde{\mathbf{U}}=1+1=2\ne0

Answer. This is another valid ordered pair for the same matrix.

Check.

AU~=(24−24)=U~D~\mathbf{A}\widetilde{\mathbf{U}}=\begin{pmatrix}2&4\\-2&4\end{pmatrix} =\widetilde{\mathbf{U}}\widetilde{\mathbf{D}}

Keeping diag⁡(4,2)\operatorname{diag}(4,2) after swapping these columns would fail this check.

For a 3×33\times3 matrix the construction is identical, with three columns. Even three distinct-looking nonzero vectors are unsuitable if one is a linear combination of the other two. A nonzero determinant checks the whole set.

Watch out

Two different multiples of the same eigenvector do not form a basis. Columns (1,1)T(1,1)^{\mathsf T} and (2,2)T(2,2)^{\mathsf T} give determinant zero, so they cannot form an invertible U\mathbf{U}. Also, write vectors as columns, then match the diagonal order to those columns.

Choose the matching order for a new matrix.

Diagonalising a matrix

The equality MU=UD\mathbf{M}\mathbf{U}=\mathbf{U}\mathbf{D} packages the individual eigenvector equations together. Multiplying on the right by U−1\mathbf{U}^{-1} gives the diagonalisation of M\mathbf{M}.

Diagonalisation

If the columns of an invertible matrix U\mathbf{U} are eigenvectors of M\mathbf{M}, with corresponding eigenvalues in the same order on the diagonal of D\mathbf{D}, then

MU=UD,M=UDU−1,D=U−1MU\mathbf{M}\mathbf{U}=\mathbf{U}\mathbf{D},\qquad \mathbf{M}=\mathbf{U}\mathbf{D}\mathbf{U}^{-1},\qquad \mathbf{D}=\mathbf{U}^{-1}\mathbf{M}\mathbf{U}

For a real diagonalisation, choose real eigenvectors and real eigenvalues. Real eigenvalues alone do not guarantee an invertible eigenvector matrix.

Not in the formula booklet: learn it.

Read UDU−1x\mathbf{U}\mathbf{D}\mathbf{U}^{-1}\mathbf{x} from right to left. First U−1\mathbf{U}^{-1} finds the coefficients of x\mathbf{x} in the eigenvector basis. Then D\mathbf{D} scales those coefficients. Finally U\mathbf{U} rebuilds the output in ordinary coordinates. This explains both the order and the usefulness of the factorisation.

Worked example 3: completing the factorisation

Question. Diagonalise A=(3113)\mathbf{A}=\begin{pmatrix}3&1\\1&3\end{pmatrix} using U=(111−1)\mathbf{U}=\begin{pmatrix}1&1\\1&-1\end{pmatrix}.

Plan. Use the corresponding diagonal diag⁡(4,2)\operatorname{diag}(4,2), find the inverse, and multiply to verify.

U−1=1−2(−1−1−11)=12(111−1)\mathbf{U}^{-1}=\frac1{-2}\begin{pmatrix}-1&-1\\-1&1\end{pmatrix} =\frac12\begin{pmatrix}1&1\\1&-1\end{pmatrix}

Thus

UDU−1=12(424−2)(111−1)=12(6226)=(3113)\begin{aligned} \mathbf{U}\mathbf{D}\mathbf{U}^{-1} &=\frac12\begin{pmatrix}4&2\\4&-2\end{pmatrix}\begin{pmatrix}1&1\\1&-1\end{pmatrix}\\ &=\frac12\begin{pmatrix}6&2\\2&6\end{pmatrix} =\begin{pmatrix}3&1\\1&3\end{pmatrix} \end{aligned}

Answer. A=Udiag⁡(4,2)U−1\mathbf{A}=\mathbf{U}\operatorname{diag}(4,2)\mathbf{U}^{-1}, with the inverse above.

Check. For x=(1,0)T\mathbf{x}=(1,0)^{\mathsf T}, its basis coefficients are (1/2,1/2)T(1/2,1/2)^{\mathsf T}. Scaling gives (2,1)T(2,1)^{\mathsf T}; rebuilding gives (3,1)T(3,1)^{\mathsf T}, agreeing with direct multiplication by A\mathbf{A}.

Now use the alternative column order from Worked example 2. The original matrix must stay the same even though all three factors look different.

Worked example 4: verifying the reordered factorisation

Question. Diagonalise the same A\mathbf{A} using U~=(11−11)\widetilde{\mathbf{U}}=\begin{pmatrix}1&1\\-1&1\end{pmatrix}.

Plan. Use D~=diag⁡(2,4)\widetilde{\mathbf{D}}=\operatorname{diag}(2,4) and compute the new inverse.

U~−1=12(1−111)\widetilde{\mathbf{U}}^{-1}=\frac12\begin{pmatrix}1&-1\\1&1\end{pmatrix}

Then

U~D~U~−1=12(24−24)(1−111)=12(6226)=A\begin{aligned} \widetilde{\mathbf{U}}\widetilde{\mathbf{D}}\widetilde{\mathbf{U}}^{-1} &=\frac12\begin{pmatrix}2&4\\-2&4\end{pmatrix}\begin{pmatrix}1&-1\\1&1\end{pmatrix}\\ &=\frac12\begin{pmatrix}6&2\\2&6\end{pmatrix}=\mathbf{A} \end{aligned}

Answer. The reordered factors give another correct diagonalisation of A\mathbf{A}.

Check. U~−1AU~=(2004)\widetilde{\mathbf{U}}^{-1}\mathbf{A}\widetilde{\mathbf{U}}=\begin{pmatrix}2&0\\0&4\end{pmatrix}, so changing to this basis really does produce the claimed diagonal matrix.

The same reasoning works for a full three-dimensional eigenbasis. For B=(31013000−1)\mathbf{B}=\begin{pmatrix}3&1&0\\1&3&0\\0&0&-1\end{pmatrix}, take

U3=(1101−10001),D3=diag⁡(4,2,−1),U3−1=(1/21/201/2−1/20001)\mathbf{U}_3=\begin{pmatrix}1&1&0\\1&-1&0\\0&0&1\end{pmatrix},\quad \mathbf{D}_3=\operatorname{diag}(4,2,-1),\quad \mathbf{U}_3^{-1}=\begin{pmatrix}1/2&1/2&0\\1/2&-1/2&0\\0&0&1\end{pmatrix}

The first two coordinates use the calculation above and the third contributes 1(−1)1=−11(-1)1=-1, giving B=U3D3U3−1\mathbf{B}=\mathbf{U}_3\mathbf{D}_3\mathbf{U}_3^{-1}.

Watch out

U−1MU=D\mathbf{U}^{-1}\mathbf{M}\mathbf{U}=\mathbf{D}, while UDU−1=M\mathbf{U}\mathbf{D}\mathbf{U}^{-1}=\mathbf{M}. Reversing the outer factors usually gives a different matrix. Track what each factor does instead of rearranging matrix factors as if they were numbers.

Complete a new factorisation.

Calculating matrix powers

The benefit appears when you square the factorisation. Associativity lets adjacent inverse factors cancel, without swapping any factors:

M2=(UDU−1)(UDU−1)=UD(U−1U)DU−1=UD2U−1\begin{aligned} \mathbf{M}^2 &=(\mathbf{U}\mathbf{D}\mathbf{U}^{-1})(\mathbf{U}\mathbf{D}\mathbf{U}^{-1})\\ &=\mathbf{U}\mathbf{D}(\mathbf{U}^{-1}\mathbf{U})\mathbf{D}\mathbf{U}^{-1} =\mathbf{U}\mathbf{D}^2\mathbf{U}^{-1} \end{aligned}

Repeating this cancellation leaves only a diagonal power to calculate.

Powers from diagonalisation

If M=UDU−1\mathbf{M}=\mathbf{U}\mathbf{D}\mathbf{U}^{-1}, then for every positive integer nn,

Mn=UDnU−1,Dn=diag⁡(λ1n,…,λrn)\mathbf{M}^n=\mathbf{U}\mathbf{D}^n\mathbf{U}^{-1},\qquad \mathbf{D}^n=\operatorname{diag}(\lambda_1^n,\ldots,\lambda_r^n)

It also holds for n=0n=0, using M0=D0=I\mathbf{M}^0=\mathbf{D}^0=\mathbf{I}. Negative integer powers require M\mathbf{M} to be invertible, equivalently all its eigenvalues to be nonzero. Fractional powers need further choices and are not assumed here.

Not in the formula booklet: learn it.

An ordinary matrix power multiplies matrices. It does not raise each individual entry to that power. A diagonal matrix is a special case where taking powers of the diagonal entries works.

Worked example 5: a formula for every positive integer power

Question. Find An\mathbf{A}^n for positive integers nn, where A=(3113)\mathbf{A}=\begin{pmatrix}3&1\\1&3\end{pmatrix}, and hence find A20\mathbf{A}^{20}.

Plan. Use the first diagonalisation, raise 4 and 2 to power nn, then multiply the two small matrices.

An=12(111−1)(4n002n)(111−1)=12(4n+2n4n−2n4n−2n4n+2n)\begin{aligned} \mathbf{A}^n &=\frac12\begin{pmatrix}1&1\\1&-1\end{pmatrix} \begin{pmatrix}4^n&0\\0&2^n\end{pmatrix} \begin{pmatrix}1&1\\1&-1\end{pmatrix}\\ &=\frac12\begin{pmatrix}4^n+2^n&4^n-2^n\\4^n-2^n&4^n+2^n\end{pmatrix} \end{aligned}

Answer. The displayed general formula gives

A20=12(420+220420−220420−220420+220)\mathbf{A}^{20}=\frac12\begin{pmatrix}4^{20}+2^{20}&4^{20}-2^{20}\\4^{20}-2^{20}&4^{20}+2^{20}\end{pmatrix}

No long chain of products is needed.

Check. Directly squaring A\mathbf{A} gives (106610)\begin{pmatrix}10&6\\6&10\end{pmatrix}. The formula at n=2n=2 gives the same matrix. At n=1n=1 it recovers A\mathbf{A}.

Divide every entry of A\mathbf{A} by 4. The eigenvectors stay the same and the eigenvalues become 1 and 1/21/2. This controlled change makes a long-term limit visible.

Worked example 6: repeated transformations with a limit

Question. Let T=14A\mathbf{T}=\frac14\mathbf{A}. Find Tn\mathbf{T}^n for positive integers nn and its limit as n→∞n\to\infty.

Plan. Keep U\mathbf{U} and its inverse, but use diag⁡(1,1/2)\operatorname{diag}(1,1/2). Then take the limit of the scalar powers.

Tn=12(111−1)(1002−n)(111−1)=12(1+2−n1−2−n1−2−n1+2−n)\begin{aligned} \mathbf{T}^n &=\frac12\begin{pmatrix}1&1\\1&-1\end{pmatrix} \begin{pmatrix}1&0\\0&2^{-n}\end{pmatrix} \begin{pmatrix}1&1\\1&-1\end{pmatrix}\\ &=\frac12\begin{pmatrix}1+2^{-n}&1-2^{-n}\\1-2^{-n}&1+2^{-n}\end{pmatrix} \end{aligned}

Since 2−n→02^{-n}\to0, each entry has a limit.

Answer.

Tn⟶12(1111)\mathbf{T}^n\longrightarrow\frac12\begin{pmatrix}1&1\\1&1\end{pmatrix}

Check. The limit sends (1,1)T(1,1)^{\mathsf T} to itself and (1,−1)T(1,-1)^{\mathsf T} to zero. That matches repeated scaling by 1 and 1/21/2: the first component survives and the second shrinks away.

This is a useful surprise: repeated transformations can settle to a nonzero matrix even though one direction disappears. Limits must be checked from the actual eigenvalue powers. For example, an eigenvalue −1-1 produces (−1)n(-1)^n, which oscillates; real eigenvalues do not by themselves guarantee convergence.

For the three-dimensional B\mathbf{B} in part 2, the identical multiplication gives a top-left block equal to An\mathbf{A}^n, zero entries linking to the third coordinate, and bottom-right entry (−1)n(-1)^n. Thus the same method works in either dimension.

Watch out

Wrong: A2=(9119)\mathbf{A}^2=\begin{pmatrix}9&1\\1&9\end{pmatrix}, found by squaring each entry. Correct matrix multiplication gives (106610)\begin{pmatrix}10&6\\6&10\end{pmatrix}. Also, raise the entries of D\mathbf{D}, not the entries of U\mathbf{U} or U−1\mathbf{U}^{-1}.

Apply a supplied diagonalisation to a fresh matrix.

When a real eigenbasis exists

A real diagonalisation exists exactly when an r×rr\times r real matrix has rr linearly independent real eigenvectors. Finding real eigenvalues is part of the job; finding enough independent vectors is the decisive check.

Distinct eigenvalues give independent eigenvectors. For two vectors, you can see why: if v2=cv1\mathbf{v}_2=c\mathbf{v}_1 with c≠0c\ne0, then applying the matrix would give both cλ1v1c\lambda_1\mathbf{v}_1 and cλ2v1c\lambda_2\mathbf{v}_1. Equality would force λ1=λ2\lambda_1=\lambda_2. The general result also holds for larger sets. Hence a real 2×22\times2 matrix with two distinct real eigenvalues, or a real 3×33\times3 matrix with three distinct real eigenvalues, can be diagonalised over the reals.

A repeated eigenvalue needs more care. Compare

F=(2002),G=(2102)\mathbf{F}=\begin{pmatrix}2&0\\0&2\end{pmatrix},\qquad \mathbf{G}=\begin{pmatrix}2&1\\0&2\end{pmatrix}

Both have characteristic equation (2−λ)2=0(2-\lambda)^2=0. For F\mathbf{F}, every nonzero vector is an eigenvector for 2, so (1,0)T(1,0)^{\mathsf T} and (0,1)T(0,1)^{\mathsf T} form a basis; F\mathbf{F} is already diagonal. For G\mathbf{G}, the equations for eigenvalue 2 are

(0100)(xy)=0⟹y=0\begin{pmatrix}0&1\\0&0\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=\mathbf{0} \quad\Longrightarrow\quad y=0

Every eigenvector is a multiple of (1,0)T(1,0)^{\mathsf T}. Any two such columns give determinant zero, so G\mathbf{G} cannot be diagonalised.

In three dimensions, diag⁡(2,2,5)\operatorname{diag}(2,2,5) has two independent vectors in the plane for eigenvalue 2 and one on the third axis for 5: three in total. In contrast, (210020005)\begin{pmatrix}2&1&0\\0&2&0\\0&0&5\end{pmatrix} gives only one independent vector for 2 and one for 5, so two in total. A repeated root may or may not supply enough directions.

Finally, a real matrix with a non-real eigenvalue cannot have a diagonalisation with real U\mathbf{U} and real D\mathbf{D}. For example, the quarter-turn matrix has eigenvalues ±i\pm\mathrm{i} and no real eigenvectors. A diagonalisation using complex vectors is a different question. Here the factorisations use real eigenbases.

Key idea

Check the number of independent real eigenvectors, not just the number of roots counting repeats. Repeated eigenvalues neither guarantee nor rule out diagonalisation; real eigenvalues alone are insufficient.

Decide what a repeated root actually tells you.

Quick Recap

  • Put a full set of independent eigenvectors in the columns of U\mathbf{U}, with their eigenvalues in the same order in D\mathbf{D}.
  • MU=UD\mathbf{M}\mathbf{U}=\mathbf{U}\mathbf{D} gives M=UDU−1\mathbf{M}=\mathbf{U}\mathbf{D}\mathbf{U}^{-1}.
  • For positive integers nn, use Mn=UDnU−1\mathbf{M}^n=\mathbf{U}\mathbf{D}^n\mathbf{U}^{-1}; negative powers additionally require invertibility.
  • Repeated real eigenvalues may or may not provide an eigenbasis. Solve for the vectors and check independence.

Yes: the opening matrix has A20=12(420+220420−220420−220420+220)\mathbf{A}^{20}=\frac12\begin{pmatrix}4^{20}+2^{20}&4^{20}-2^{20}\\4^{20}-2^{20}&4^{20}+2^{20}\end{pmatrix}, found from two scalar powers and the diagonalisation.