FP2 3.2 - Diagonalising matrices

FP2 3.2 - Diagonalising matrices

Build a diagonal form from independent eigenvectors, keeping columns and eigenvalues in the same order. Recognise when diagonalisation fails, construct orthogonal diagonalisation for real symmetric matrices, and use a diagonal form to calculate powers and inverses.

Make a transformation simple by changing coordinates

Can a matrix that collapses a whole direction still be diagonalised? Consider

S=(2−1−1−12−1−1−12)\mathbf{S}=\begin{pmatrix}2&-1&-1\\-1&2&-1\\-1&-1&2\end{pmatrix}

It sends (1,1,1)T(1,1,1)^{\mathrm T} to zero. Nevertheless, we will find three perpendicular eigenvector directions and a perfectly good diagonal form. The matrix that changes coordinates must be invertible; the original transformation need not be.

You already know

An eigenpair satisfies Av=λv\mathbf{A}\mathbf{v}=\lambda\mathbf{v}, with v≠0\mathbf{v}\ne\mathbf{0}. Non-zero multiples give the same eigenvalue. Repeated eigenvalues may or may not supply enough independent vectors. Divide by magnitude to normalise a real vector, and check component equations by multiplication.

If v1,v2\mathbf{v}_1,\mathbf{v}_2 are eigenvectors, arrange them as columns of P\mathbf{P}. Multiplying AP\mathbf{A}\mathbf{P} transforms those columns separately. If D=diag⁡(λ1,λ2)\mathbf{D}=\operatorname{diag}(\lambda_1,\lambda_2), multiplying PD\mathbf{P}\mathbf{D} scales each column by its matching eigenvalue. Therefore AP=PD\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{D}. The same argument works for three columns.

Diagonalisation

A square matrix A\mathbf{A} is diagonalised by an invertible matrix P\mathbf{P} when

P−1AP=Dor equivalentlyA=PDP−1\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{D} \qquad\text{or equivalently}\qquad \mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}

where D\mathbf{D} is diagonal. Its diagonal entries are eigenvalues of A\mathbf{A}, ordered to match the eigenvector columns of P\mathbf{P}.

The columns must be independent so that P−1\mathbf{P}^{-1} exists. An nn by nn matrix is diagonalisable precisely when it has nn independent eigenvectors over the chosen number system. Distinct eigenvalues supply independent eigenvectors; repeated roots require checking. These results are not in the formula booklet.

The number system matters. The quarter-turn R=(0−110)\mathbf{R}=\begin{pmatrix}0&-1\\1&0\end{pmatrix} has no real eigenvectors, so no real diagonalisation. Over C\mathbb{C}, use

P=(11−ii)D=(i00−i)\mathbf{P}=\begin{pmatrix}1&1\\-\mathrm{i}&\mathrm{i}\end{pmatrix} \qquad \mathbf{D}=\begin{pmatrix}\mathrm{i}&0\\0&-\mathrm{i}\end{pmatrix}

Its columns are the complex eigenvectors from the previous lesson, so RP=PD\mathbf{R}\mathbf{P}=\mathbf{P}\mathbf{D}; det⁡P=2i≠0\det\mathbf{P}=2\mathrm{i}\ne0. Thus it is diagonalisable over C\mathbb{C}, although not over R\mathbb{R}.

Key idea

Choose enough independent eigenvectors, put them in columns, and put their eigenvalues in the matching diagonal positions.

The existence of a zero eigenvalue concerns A\mathbf{A}, while independent columns concern P\mathbf{P}.

Construct and check a diagonal form

Start by listing eigenpairs, then select a column order. General diagonalisation does not require unit eigenvectors. The quickest check is usually AP=PD\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{D}, together with det⁡P≠0\det\mathbf{P}\ne0, rather than multiplying three matrices.

Worked example 1: two independent eigenvectors

Question. Find P\mathbf{P} and D\mathbf{D} such that P−1AP=D\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{D}, where A=(3122)\mathbf{A}=\begin{pmatrix}3&1\\2&2\end{pmatrix}.

Plan. Use the eigenpairs from the previous lesson and check the column order.

λ=4:v1=(11)first eigenpairλ=1:v2=(1−2)second eigenpairP=(111−2),D=(4001)match columns to diagonaldet⁡P=−3≠0independent columns\begin{aligned} \lambda=4:&\quad\mathbf{v}_1=\begin{pmatrix}1\\1\end{pmatrix} && \text{first eigenpair}\\ \lambda=1:&\quad\mathbf{v}_2=\begin{pmatrix}1\\-2\end{pmatrix} && \text{second eigenpair}\\ \mathbf{P}&=\begin{pmatrix}1&1\\1&-2\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}4&0\\0&1\end{pmatrix} && \text{match columns to diagonal}\\ \det\mathbf{P}&=-3\ne0 && \text{independent columns} \end{aligned}

Why this step? PD\mathbf{P}\mathbf{D} multiplies the first column by 44 and the second by 11, exactly as A\mathbf{A} does.

Answer. The displayed P,D\mathbf{P},\mathbf{D} give the required diagonalisation.

Check. AP=(414−2)=PD\mathbf{A}\mathbf{P}=\begin{pmatrix}4&1\\4&-2\end{pmatrix}=\mathbf{P}\mathbf{D}. Also P−1=13(211−1)\mathbf{P}^{-1}=\frac13\begin{pmatrix}2&1\\1&-1\end{pmatrix}, confirming that the change of coordinates is invertible.

Change only the column order. The diagonal order must change with it.

Worked example 2: a different valid order

Question. Diagonalise the same A\mathbf{A}, putting its eigenvector for eigenvalue 11 first.

Plan. Swap the two columns and swap the two diagonal entries.

Q=(11−21)eigenvalue 1 firstE=(1004)same orderingdet⁡Q=3≠0still independentAQ=(14−24)=QEcolumn check\begin{aligned} \mathbf{Q}&=\begin{pmatrix}1&1\\-2&1\end{pmatrix} && \text{eigenvalue }1\text{ first}\\ \mathbf{E}&=\begin{pmatrix}1&0\\0&4\end{pmatrix} && \text{same ordering}\\ \det\mathbf{Q}&=3\ne0 && \text{still independent}\\ \mathbf{A}\mathbf{Q}&=\begin{pmatrix}1&4\\-2&4\end{pmatrix}=\mathbf{Q}\mathbf{E} && \text{column check} \end{aligned}

Why this step? The eigenvalues are not assigned permanent positions. They must follow the vectors used in your own matrix.

Answer. Q−1AQ=E\mathbf{Q}^{-1}\mathbf{A}\mathbf{Q}=\mathbf{E}.

Check. Swapping back gives Worked example 1. Either order describes the same transformation in different eigenvector coordinates.

You may also multiply any chosen column by a non-zero constant without changing its matching diagonal entry. For example, doubling the first column doubles that column on both sides of AP=PD\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{D}. The diagonal form survives this change of scale.

Watch out

Wrong: swap the columns of P\mathbf{P} but retain diag⁡(4,1)\operatorname{diag}(4,1). Right: swap the diagonal entries too, giving diag⁡(1,4)\operatorname{diag}(1,4). Matching matters more than any preferred ordering.

Now change just the scale of one column rather than its position.

Check whether repeated roots supply enough vectors

A diagonal matrix can contain repeated entries, so a repeated eigenvalue is not itself a problem. The test is whether all eigenvalues together supply enough independent columns. Solve the eigenspace equations rather than counting repeated polynomial factors.

Worked example 3: diagonalising a repeated eigenvalue

Question. Diagonalise B=(201020003)\mathbf{B}=\begin{pmatrix}2&0&1\\0&2&0\\0&0&3\end{pmatrix}.

Plan. Use its triangular characteristic equation and find two independent vectors for the repeated root.

det⁡(B−λI)=(2−λ)2(3−λ)triangular determinantλ=2:z=0both x,y freeλ=3:z=x, y=0component equationsP=(101010001),D=(200020003)choose independent columns\begin{aligned} \det(\mathbf{B}-\lambda\mathbf{I})&=(2-\lambda)^2(3-\lambda) && \text{triangular determinant}\\ \lambda=2:&\quad z=0 && \text{both }x,y\text{ free}\\ \lambda=3:&\quad z=x,\ y=0 && \text{component equations}\\ \mathbf{P}&=\begin{pmatrix}1&0&1\\0&1&0\\0&0&1\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}2&0&0\\0&2&0\\0&0&3\end{pmatrix} && \text{choose independent columns} \end{aligned}

Why this step? The eigenspace for 22 is a plane. It supplies two independent columns, and the vector for 33 supplies the third.

Answer. The displayed matrices give P−1BP=D\mathbf{P}^{-1}\mathbf{B}\mathbf{P}=\mathbf{D}.

Check. det⁡P=1\det\mathbf{P}=1, and BP=(203020003)=PD\mathbf{B}\mathbf{P}=\begin{pmatrix}2&0&3\\0&2&0\\0&0&3\end{pmatrix}=\mathbf{P}\mathbf{D}.

Change only the upper-middle entry from 00 to 11. The characteristic polynomial stays the same, but one independent eigenvector direction disappears.

Worked example 4: a repeated root that prevents diagonalisation

Question. Determine whether C=(211020003)\mathbf{C}=\begin{pmatrix}2&1&1\\0&2&0\\0&0&3\end{pmatrix} can be diagonalised.

Plan. Count independent solutions of the eigenspace equations for 22 and 33.

det⁡(C−λI)=(2−λ)2(3−λ)same rootsλ=2:y+z=0, z=0⟹y=z=0one free componentλ=3:−y=0, −x+y+z=0⟹y=0, z=xone free component\begin{aligned} \det(\mathbf{C}-\lambda\mathbf{I})&=(2-\lambda)^2(3-\lambda) && \text{same roots}\\ \lambda=2:&\quad y+z=0,\ z=0\quad\Longrightarrow\quad y=z=0 && \text{one free component}\\ \lambda=3:&\quad -y=0,\ -x+y+z=0\quad\Longrightarrow\quad y=0,\ z=x && \text{one free component} \end{aligned}

Why this step? There is only one independent eigenvector for each distinct eigenvalue. Repeating a multiple of the first one cannot supply a third independent column.

Answer. The matrix cannot be diagonalised, over either R\mathbb{R} or C\mathbb{C}: its eigenvectors span only two independent directions, represented by (1,0,0)T(1,0,0)^{\mathrm T} and (1,0,1)T(1,0,1)^{\mathrm T}.

Check. Any matrix formed from three eigenvector columns here must have all entries in its middle row zero, hence determinant zero.

These examples also show why three distinct eigenvalues are sufficient but not necessary: Worked example 3 succeeds with only two distinct values.

Watch out

Wrong: “The root 22 occurs twice, so use its eigenvector twice.” Right: find two independent vectors in its eigenspace. If that eigenspace has only one independent direction, repeating the vector makes P\mathbf{P} singular.

Change the same upper-middle entry once more and test the eigenspace rather than the polynomial alone.

Use unit perpendicular eigenvectors for a symmetric matrix

A real matrix is symmetric when AT=A\mathbf{A}^{\mathrm T}=\mathbf{A}. Its entries reflect across the main diagonal. For such a matrix, eigenvectors u,v\mathbf{u},\mathbf{v} with different eigenvalues λ,μ\lambda,\mu are perpendicular, because

λuTv=(Au)Tv=uTAv=μuTv\lambda\mathbf{u}^{\mathrm T}\mathbf{v} =(\mathbf{A}\mathbf{u})^{\mathrm T}\mathbf{v} =\mathbf{u}^{\mathrm T}\mathbf{A}\mathbf{v} =\mu\mathbf{u}^{\mathrm T}\mathbf{v}

Thus (λ−μ)uTv=0(\lambda-\mu)\mathbf{u}^{\mathrm T}\mathbf{v}=0, and distinct eigenvalues force the scalar product to be zero. A real symmetric matrix has real eigenvalues and a full set of mutually perpendicular unit eigenvectors; repeated eigenspaces allow a perpendicular choice within them too.

Orthogonal diagonalisation

A real matrix P\mathbf{P} is orthogonal when its columns are mutually perpendicular unit vectors. Then

PTP=IP−1=PT\mathbf{P}^{\mathrm T}\mathbf{P}=\mathbf{I} \qquad \mathbf{P}^{-1}=\mathbf{P}^{\mathrm T}

For a real symmetric A\mathbf{A}, choosing orthonormal eigenvector columns gives

D=PTAPA=PDPT\mathbf{D}=\mathbf{P}^{\mathrm T}\mathbf{A}\mathbf{P} \qquad \mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{\mathrm T}

The diagonal order must still match the column order.

Not in the formula booklet: learn it.

“Orthogonal” requires both perpendicularity and unit length. That is the extra step beyond ordinary diagonalisation.

Worked example 5: an orthogonal matrix in two dimensions

Question. Find an orthogonal P\mathbf{P} and diagonal D\mathbf{D} such that D=PTAP\mathbf{D}=\mathbf{P}^{\mathrm T}\mathbf{A}\mathbf{P}, where A=(2112)\mathbf{A}=\begin{pmatrix}2&1\\1&2\end{pmatrix}.

Plan. Find the eigenvectors, normalise them, and match their order.

det⁡(A−λI)=(2−λ)2−1=(λ−3)(λ−1)characteristic equationλ=3:y=x⟹u=12(11)normaliseλ=1:y=−x⟹v=12(1−1)normaliseP=12(111−1),D=(3001)matching order\begin{aligned} \det(\mathbf{A}-\lambda\mathbf{I})&=(2-\lambda)^2-1=(\lambda-3)(\lambda-1) && \text{characteristic equation}\\ \lambda=3:&\quad y=x\quad\Longrightarrow\quad\mathbf{u}=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix} && \text{normalise}\\ \lambda=1:&\quad y=-x\quad\Longrightarrow\quad\mathbf{v}=\frac1{\sqrt2}\begin{pmatrix}1\\-1\end{pmatrix} && \text{normalise}\\ \mathbf{P}&=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}3&0\\0&1\end{pmatrix} && \text{matching order} \end{aligned}

Why this step? The unnormalised columns are perpendicular but would give PTP=2I\mathbf{P}^{\mathrm T}\mathbf{P}=2\mathbf{I}, not the identity.

Answer. These P,D\mathbf{P},\mathbf{D} give the required orthogonal diagonalisation.

Check. Both columns have squared magnitude 11, and their scalar product is (1−1)/2=0(1-1)/2=0; also AP=PD\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{D}.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account