Artificial Intelligence 🤖
Matrices
Diagonalisation of matrices

Diagonalisation of matrices

Diagonal matrices are particularly convenient for eigenvalue problems since the eigenvalues of a diagonal matrix coincide with the diagonal entries {aii}\left\{a_{i i}\right\} and the corresponding eigenvector is simply the ith i^{\text {th }} coordinate vector. Diagonalised matrices are useful in determining matrix exponents which are in turn useful in describing solutions to linear systems of differential equations.

Consider a 3×33 \times 3 matrix AA with three distinct eigenvalues, λ1,λ2\lambda_{1}, \lambda_{2}, and λ3\lambda_{3} with eigenvectors e1,e2\boldsymbol{e}_{1}, \boldsymbol{e}_{2}, and e3\boldsymbol{e}_{3}, respectively. We write a matrix PP whose columns are the eigenvectors,

P=(e1e2e3)P=\left(\begin{array}{lll} \boldsymbol{e}_{1} & \boldsymbol{e}_{2} \boldsymbol{e}_{3} \end{array}\right)

What happens when we pre-multiply by AA ? We have

A(e1e2e3)=(Ae1Ae2Ae3)A\left(\boldsymbol{e}_{1} \boldsymbol{e}_{2} \boldsymbol{e}_{3}\right)=\left(\begin{array}{lll} A \boldsymbol{e}_{1} & A \boldsymbol{e}_{2} & A \boldsymbol{e}_{3} \end{array}\right)

which implies, using Ae=λeA \boldsymbol{e}=\lambda \boldsymbol{e},

A(e1e2e3)=(λ1e1λ2e2λ3e3)=(e1e2e3)(λ1000λ2000λ3).\begin{aligned} A\left(\boldsymbol{e}_1 \boldsymbol{e}_2 \boldsymbol{e}_3\right) &= \left(\lambda_1 \boldsymbol{e}_1 \lambda_2 \boldsymbol{e}_2 \lambda_3 \boldsymbol{e}_3\right) \\ & = \left(\begin{array}{ccc} \boldsymbol{e}_{1} & \boldsymbol{e}_{2} & \boldsymbol{e}_{3} \end{array}\right)\left(\begin{array}{ccc} \lambda_{1} & 0 & 0 \\ 0 & \lambda_{2} & 0 \\ 0 & 0 & \lambda_{3} \end{array}\right) . \end{aligned}

We define

D=(λ1000λ2000λ3)D=\left(\begin{array}{ccc} \lambda_{1} & 0 & 0 \\ 0 & \lambda_{2} & 0 \\ 0 & 0 & \lambda_{3} \end{array}\right)

This gives us the equation

AP=PD.A P=P D .

We can take the inverse of PP on the right on both sides of the equation to get,

A=PDP1.A=P D P^{-1} .

This is called the diagonalisation of matrix AA.

We consider the matrix

A=(5/21/21/21/27/21/2113)A=\left(\begin{array}{ccc} 5 / 2 & 1 / 2 & -1 / 2 \\ -1 / 2 & 7 / 2 & 1 / 2 \\ -1 & 1 & 3 \end{array}\right)

We calculate the characteristic equation,

det(AλI)=5/21/21/21/27/21/2113=0\operatorname{det}(A-\lambda I)=\left|\begin{array}{ccc} 5 / 2 & 1 / 2 & -1 / 2 \\ -1 / 2 & 7 / 2 & 1 / 2 \\ -1 & 1 & 3 \end{array}\right|=0

which, after some algebraic manipulation, gives us

(4λ)(λ2)(λ3)=0(4-\lambda)(\lambda-2)(\lambda-3)=0

First we compute the eigenvector with eigenvalue λ=2\lambda=2. We need to solve for the roots of

(111131111)(xyz)=(000)\left(\begin{array}{ccc} 1 & 1 & -1 \\ -1 & 3 & 1 \\ -1 & 1 & 1 \end{array}\right)\left(\begin{array}{l} x \\ y \\ z \end{array}\right)=\left(\begin{array}{l} 0 \\ 0 \\ 0 \end{array}\right)

Note that we have multiplied the first two rows by 2 to ease computations. Since AλIA-\lambda I is singular, we know that one of the equations must be redundant. We choose the following two equations to proceed,

(111111)(xyz)=(00).\left(\begin{array}{ccc} 1 & 1 & -1 \\ -1 & 1 & 1 \end{array}\right)\left(\begin{array}{l} x \\ y \\ z \end{array}\right)=\left(\begin{array}{l} 0 \\ 0 \end{array}\right) .

We undertake (R2+R1R2)\left(R_{2}+R_{1} \rightarrow R_{2}\right) to simplify the equations,

(111020)(xyz)=(00)\left(\begin{array}{ccc} 1 & 1 & -1 \\ 0 & 2 & 0 \end{array}\right)\left(\begin{array}{l} x \\ y \\ z \end{array}\right)=\left(\begin{array}{l} 0 \\ 0 \end{array}\right)

The second row immediately gives that y=0y=0 and the first row that x=zx=z so the eigenvector is

e1=(101)\boldsymbol{e}_{1}=\left(\begin{array}{l} 1 \\ 0 \\ 1 \end{array}\right)

Following the same steps with the other two eigenvalues we obtain

e2=(110) and e3=(011)\boldsymbol{e}_{2}=\left(\begin{array}{l} 1 \\ 1 \\ 0 \end{array}\right) \text { and } \boldsymbol{e}_{3}=\left(\begin{array}{l} 0 \\ 1 \\ 1 \end{array}\right)

for λ=3\lambda=3 and λ=4\lambda=4, respectively. We can now form the matrix PP in Eq. (10.100),

P=(110011101)P=\left(\begin{array}{lll} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{array}\right)

Then, APA P is given by

(5/21/21/21/27/21/2113)(110011101)=(230034204).\left(\begin{array}{ccc} 5 / 2 & 1 / 2 & -1 / 2 \\ -1 / 2 & 7 / 2 & 1 / 2 \\ -1 & 1 & 3 \end{array}\right)\left(\begin{array}{lll} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{array}\right)=\left(\begin{array}{lll} 2 & 3 & 0 \\ 0 & 3 & 4 \\ 2 & 0 & 4 \end{array}\right) .

Equation (10.106) is equal to PDP D,

(230034204)=(110011101)(200030004)\left(\begin{array}{lll} 2 & 3 & 0 \\ 0 & 3 & 4 \\ 2 & 0 & 4 \end{array}\right)=\left(\begin{array}{lll} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{array}\right)\left(\begin{array}{lll} 2 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 4 \end{array}\right)

where DD is given by,

D=(200030004)D=\left(\begin{array}{lll} 2 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 4 \end{array}\right)

Applications of Diagonalisation

Let us consider a diagonal 3×33 \times 3 matrix,

D=(100010002)D=\left(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 2 \end{array}\right)

What happens when we square the matrix? We obtain,

D2=(100010002)(100010002)=(100010004)D^{2}=\left(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 2 \end{array}\right)\left(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 2 \end{array}\right)=\left(\begin{array}{lll} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 4 \end{array}\right)

We observe that matrix powers of diagonal matrices correspond simply to powers of the diagonal entries. Let us consider what happens when we square both sides of Eq. (10.102),

A2=PDP1PDP1=PD2P1.A^{2}=P D P^{-1} P D P^{-1}=P D^{2} P^{-1} .

We see that we can repeatedly multiply by the same expression and PP and P1P^{-1} cancel in the middle of the product such that,

An=PDnP1A^{n}=P D^{n} P^{-1}

If we let D=Diag(λ1,λ2,λ3)D=\operatorname{Diag}\left(\lambda_{1}, \lambda_{2}, \lambda_{3}\right), then Dn=Diag(λ1n,λ2n,λ3n)D^{n}=\operatorname{Diag}\left(\lambda_{1}^{n}, \lambda_{2}^{n}, \lambda_{3}^{n}\right) which we can put between PP and P1P^{-1} to ease the calculation of the power of AA.

In addition to powers of AA we can also use matrix diagonalisation to easily calculate matrix exponentials. Recall the power series expansion of the exponential given by Eq. (6.20),

ex=n=0xnn!e^{x}=\sum_{n=0}^{\infty} \frac{x^{n}}{n !}

We define the expression etAe^{t A} through the series expansion,

etA=n=0tnn!Ane^{t A}=\sum_{n=0}^{\infty} \frac{t^{n}}{n !} A^{n}

We show how diagonalisation helps us compute the expression etAe^{t A}. We can replace AnA^{n} with PDnP1P D^{n} P^{-1} in Eq. (10.111) which gives,

etA=n=0tnn!PDnP1e^{t A}=\sum_{n=0}^{\infty} \frac{t^{n}}{n !} P D^{n} P^{-1}

In this case, the distributive law of matrix multiplication allows us to write,

etA=P(n=0tnn!Dn)P1.e^{t A}=P\left(\sum_{n=0}^{\infty} \frac{t^{n}}{n !} D^{n}\right) P^{-1} .

We observe that we have etDe^{t D} in between PP and P1P^{-1} and so we obtain,

etA=PetDP1e^{t A}=P e^{t D} P^{-1}

Finally, for D=Diag(λ1,λ2,λ3)D=\operatorname{Diag}\left(\lambda_{1}, \lambda_{2}, \lambda_{3}\right), we have etD=Diag(etλ1,etλ2,etλ3)e^{t D}=\operatorname{Diag}\left(e^{t \lambda_{1}}, e^{t \lambda_{2}}, e^{t \lambda_{3}}\right).

Note that the derivation is not rigorous, since we need to consider convergence properties of these series and define what it means for a matrix sum to converge. The interested reader may wish to think how to extend the concept of partial sums and the convergence of series to the convergence of a series of matrices.

Example

Let

A=(2/32/34/31012/31/34/3)A=\left(\begin{array}{ccc} -2 / 3 & 2 / 3 & 4 / 3 \\ 1 & 0 & 1 \\ 2 / 3 & 1 / 3 & -4 / 3 \end{array}\right)

diagonalise AA and hence calculate A5A^{5}.

Solution We need to express AA as the diagonalisation A=PDP1A=P D P^{-1} in order to calculate matrix powers. To compute DD we need the eigenvalues and for PP we need the corresponding eigenvectors. Once we have PP we need to compute its inverse. The eigenvalues are obtained from the characteristic equation,

2/32/34/31012/31/34/3=(2+λ)(1λ)(1+λ)\left|\begin{array}{ccc} -2 / 3 & 2 / 3 & 4 / 3 \\ 1 & 0 & 1 \\ 2 / 3 & 1 / 3 & -4 / 3 \end{array}\right|=(2+\lambda)(1-\lambda)(1+\lambda)

which gives the eigenvalues 2,1,1-2,-1,1 and DD as

D=(200010001)D=\left(\begin{array}{ccc} -2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{array}\right)

To find the eigenvector for λ=2\lambda=-2, we solve (AλI)x=0(A-\lambda I) \boldsymbol{x}=\mathbf{0},

(4/32/34/31212/31/32/3)(xyz)=(000)\left(\begin{array}{ccc} 4 / 3 & 2 / 3 & 4 / 3 \\ 1 & 2 & 1 \\ 2 / 3 & 1 / 3 & 2 / 3 \end{array}\right)\left(\begin{array}{l} x \\ y \\ z \end{array}\right)=\left(\begin{array}{l} 0 \\ 0 \\ 0 \end{array}\right)

as always, one equation is redundant leaving us with one degree of freedom. The eigenvector is computed as e1=(1,0,1)\boldsymbol{e}_{1}=(1,0,-1)^{\top}. Similarly, we obtain the other two eigenvectors corresponding to the eigenvalues λ=1,1\lambda=-1,1. For λ=1\lambda=-1, we obtain e2=(2,3,1)\boldsymbol{e}_{2}=(2,-3,1)^{\top} and for λ=1,e2=(2,3,1)\lambda=1, \boldsymbol{e}_{2}=(2,3,1)^{\top}. Using the eigenvectors as the columns of PP we have,

P=(122033111)P=\left(\begin{array}{ccc} 1 & 2 & 2 \\ 0 & -3 & 3 \\ -1 & 1 & 1 \end{array}\right)

Next, we compute the inverse of PP using Gauss-Jordan

(122100033010111001)\left(\begin{array}{ccc|ccc} 1 & 2 & 2 & 1 & 0 & 0 \\ 0 & -3 & 3 & 0 & 1 & 0 \\ -1 & 1 & 1 & 0 & 0 & 1 \end{array}\right)

By performing the following row transformations, (R3+R1)(R3),(R3/3)(R3)\left(R_{3}+R_{1}\right) \rightarrow\left(R_{3}\right),\left(-R_{3} / 3\right) \rightarrow\left(R_{3}\right), (R1+2R2)(R1),(R33R2)(R3),(6R2+R3)(R2),(6R14R2)(R1)\left(R_{1}+2 R_{2}\right) \rightarrow\left(R_{1}\right),\left(R_{3}-3 R_{2}\right) \rightarrow\left(R_{3}\right),\left(6 R_{2}+R_{3}\right) \rightarrow\left(R_{2}\right),\left(6 R_{1}-4 R_{2}\right) \rightarrow\left(R_{1}\right), (R2/6)(R2),(R3/6)(R3)\left(R_{2} / 6\right) \rightarrow\left(R_{2}\right),\left(R_{3} / 6\right) \rightarrow\left(R_{3}\right) we obtain the identity on the RHS and the inverse on the LHS,

(1001/302/30101/61/61/60011/61/61/6).\left(\begin{array}{ccc|ccc} 1 & 0 & 0 & 1 / 3 & 0 & -2 / 3 \\ 0 & 1 & 0 & 1 / 6 & -1 / 6 & 1 / 6 \\ 0 & 0 & 1 & 1 / 6 & 1 / 6 & 1 / 6 \end{array}\right) .

Now, to calculate A5A^{5} we raise D5D^{5} and multiply by PP on the left and P1P^{-1} on the right,

A5=(122033111)(3200010001)(1/302/31/61/61/61/61/61/6)=(32/32/364/310132/31/364/3)A^{5}=\left(\begin{array}{ccc} 1 & 2 & 2 \\ 0 & -3 & 3 \\ -1 & 1 & 1 \end{array}\right)\left(\begin{array}{ccc} -32 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{array}\right)\left(\begin{array}{ccc} 1 / 3 & 0 & -2 / 3 \\ 1 / 6 & -1 / 6 & 1 / 6 \\ 1 / 6 & 1 / 6 & 1 / 6 \end{array}\right)=\left(\begin{array}{ccc} -32 / 3 & 2 / 3 & 64 / 3 \\ 1 & 0 & 1 \\ 32 / 3 & 1 / 3 & -64 / 3 \end{array}\right)

From the procedure followed in Example 10.11, we can calculate matrix exponents. For instance, to compute etAe^{t A} for matrix AA given in Example 10.11, we compute etDe^{t D} as,

etD=(e2t000et000et)e^{t D}=\left(\begin{array}{ccc} e^{-2 t} & 0 & 0 \\ 0 & e^{-t} & 0 \\ 0 & 0 & e^{t} \end{array}\right)

The matrix exponent etAe^{t A} is then calculated from etA=PetDP1e^{t A}=P e^{t D} P^{-1}.

Geometric and algebraic multiplicities

Consider the matrix,

A=(1101)A=\left(\begin{array}{ll} 1 & 1 \\ 0 & 1 \end{array}\right)

Its characteristic equation gives

det(AλI)=(1λ)2=0\operatorname{det}(A-\lambda I)=(1-\lambda)^{2}=0

which gives the eigenvalue 1 repeated twice. We cannot diagonalise this matrix since the only diagonalisable form is the identity matrix for which,

A=PIP1=PP1=IA=P I P^{-1}=P P^{-1}=I

and this results in a contradiction. To find eigenvectors, we have (AλI)x=0(A-\lambda I) \boldsymbol{x}=\mathbf{0} which gives

(0100)(xy)=(00)\left(\begin{array}{ll} 0 & 1 \\ 0 & 0 \end{array}\right)\left(\begin{array}{l} x \\ y \end{array}\right)=\left(\begin{array}{l} 0 \\ 0 \end{array}\right)

The solution is y=0y=0 and so the eigenvector is (1,0)(1,0)^{\top}. This motivates the following definition.

Algebraic and geometric multiplicities equation

The algebraic multiplicity of an eigenvalue is the number of times it is repeated as a root of the characteristic equation. In the example above, λ=1\lambda=1 has algebraic multiplicity two. The geometric multiplicity of an eigenvalue is the number of linearly independent eigenvectors that are associated with the eigenvalue. In the example above the geometric multiplicity of 1 is one.

Exercises

  1. Diagonalise A=(13/21/2121212)A=\left(\begin{array}{ccc}-1 & 3 / 2 & 1 / 2 \\ -1 & 2 & 1 \\ -2 & 1 & 2\end{array}\right) and hence find A6A^{6} and etAe^{t A}.
  2. Diagonalise A=(200820303)A=\left(\begin{array}{ccc}2 & 0 & 0 \\ 8 & -2 & 0 \\ -3 & 0 & 3\end{array}\right) and hence find A5A^{5} and etAe^{t A}.