Skip to main content

Diagonalization of a Matrix

Say that we have a n×nn\times n matrix AA with nn independent eigenvectors (say x1,x2,,xn\vec{x}_1,\vec{x}_2,\cdots,\vec{x}_n).
We put these eigenvectors (x1,x2,,xn\vec{x}_1,\vec{x}_2,\cdots,\vec{x}_n) in a matrix (say SS).

S=[x1x2xn]S=\begin{bmatrix} \vdots & \vdots & \cdots & \vdots \\ \vec{x}_{1} & \vec{x}_{2} & \cdots & \vec{x}_{n} \\ \vdots & \vdots & \cdots & \vdots \\ \end{bmatrix}
Axi=λixi;{xi is eigenvectorλi is eigenvalueA\vec{x}_i=\lambda_i\vec{x}_i;\quad \left\{\begin{matrix} \vec{x}_i\text{ is eigenvector}\\ \lambda_i\text{ is eigenvalue} \end{matrix}\right.

Let's calculate ASAS

note
AS=A[x1x2xn]AS = A \begin{bmatrix} \vdots & \vdots & \cdots & \vdots \\ \vec{x}_{1} & \vec{x}_{2} & \cdots & \vec{x}_{n} \\ \vdots & \vdots & \cdots & \vdots \\ \end{bmatrix}
AS=[Ax1Ax2Axn]\Rightarrow AS = \begin{bmatrix} \vdots & \vdots & \cdots & \vdots \\ A\vec{x}_{1} & A\vec{x}_{2} & \cdots & A\vec{x}_{n} \\ \vdots & \vdots & \cdots & \vdots \\ \end{bmatrix}
AS=[λ1x1λ2x2λnxn]\Rightarrow AS = \begin{bmatrix} \vdots & \vdots & \cdots & \vdots \\ \lambda_1\vec{x}_{1} & \lambda_2\vec{x}_{2} & \cdots & \lambda_n\vec{x}_{n} \\ \vdots & \vdots & \cdots & \vdots \\ \end{bmatrix}
AS=[x1x2xn][λ1000λ2000λn]say Λ\Rightarrow AS = \begin{bmatrix} \vdots & \vdots & \cdots & \vdots \\ \vec{x}_{1} & \vec{x}_{2} & \cdots & \vec{x}_{n} \\ \vdots & \vdots & \cdots & \vdots \\ \end{bmatrix} \underbrace{\begin{bmatrix} \lambda_1 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n \\ \end{bmatrix}}_{\text{say }\Lambda}

AS=SΛAS=S\Lambda
because SS has independent columns so S1S^{-1} exists, so

danger
Λ=S1AS\begin{matrix} \displaystyle \Lambda =S^{-1}AS \end{matrix}

This is Diagonalization.

We can also get a factorization of AA

danger
A=SΛS1\begin{matrix} \displaystyle A=S\Lambda S^{-1} \end{matrix}

Power of a matrix

Now let's see how A=SΛS1A=S\Lambda S^{-1} helps us in calculating AkA^k for k={1,2,3,}k=\{1,2,3,\cdots\}
We know that,

Axi=λixi;{xi is eigenvectorλi is eigenvalueA\vec{x}_i=\lambda_i\vec{x}_i;\quad \left\{\begin{matrix} \vec{x}_i\text{ is eigenvector}\\ \lambda_i\text{ is eigenvalue} \end{matrix}\right.

Now let's calculate eigenvectors and eigenvalues of A2A^2.
AAxi=λi(Axi)AA\vec{x}_i=\lambda_i (A \vec{x}_i)
A2xi=λi2xi\Rightarrow A^2\vec{x}_i=\lambda_i^2\vec{x}_i
So eigenvectors of A2A^2 remains same.
But eigenvalues of A2A^2 becomes λ2\lambda^2.

We can also get it by A=SΛS1A=S\Lambda S^{-1}.

note

A=SΛS1A=S\Lambda S^{-1}
A2=SΛ(S1S)ΛS1\Rightarrow A^2=S\Lambda (S^{-1}S)\Lambda S^{-1}
A2=SΛIΛS1\Rightarrow A^2=S\Lambda \mathcal{I}\Lambda S^{-1}
A2=SΛΛS1\Rightarrow A^2=S\Lambda \Lambda S^{-1}
A2=SΛ2S1\Rightarrow A^2=S\Lambda^2 S^{-1}
where, Λ2=[λ12000λ22000λn2]\Lambda^2=\begin{bmatrix} \lambda_1^2 & 0 & \cdots & 0 \\ 0 & \lambda_2^2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n^2 \\ \end{bmatrix}

Now we can get formula for kthk^{\text{th}} power of AA.

danger
Ak=SΛkS1\begin{matrix} \displaystyle A^k = S\Lambda^k S^{-1} \end{matrix}
info

So eigenvectors of AkA^k remains same as the eigenvectors of AA.
But eigenvalues of AkA^k becomes λk\lambda^k.

So now we can find power of matrices quickly, if we have the eigenvectors (independent) of that matrix.

When we call a matrix AA stable?

info

A matrix AA is stable if Ak0A^k\to 0 as kk\to\infty.
And Ak0A^k\to 0 as kk\to\infty if,
λi<1;|\lambda_i| \lt 1;\quad  i{1,2,n}\forall\ i\in\{1,2,\cdots n\}

When a matrix AA is Diagonalizable?

info

Diagonalizable matrix has nn independent eigenvectors.
So AA is diagonalizable if, all λ\lambda's are different.
λiλj; ij\lambda_i\neq\lambda_j;\quad \forall \ i\neq j

info

If all the eigenvalues are different then all the eigenvectors are independent.

info

But reverse is not true, independence of eigenvectors does not implies that all eigenvalues are different.

note

Example
Say A=I3×3=[100010001]A=\mathcal{I}_{3\times 3}=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}
So when we apply transformation of I\mathcal{I} nothing changes so every vector is an eigenvector for I\mathcal{I}.
But there is only one eigenvalue and that is 11.

uk+1=Auk\vec{u}_{k+1}=A\vec{u}_k

Say we have a vector u0\vec{u}_0 and a matrix(non-singular) AA, with nn independent eigenvectors.
We iteratively apply transformation AA on u0\vec{u}_0.

uk+1=Auk\vec{u}_{k+1}=A\vec{u}_k

u1=Au0\vec{u}_{1}=A\vec{u}_0
u2=A2u0\vec{u}_2=A^2\vec{u}_0
uk=Aku0\vec{u}_k=A^k\vec{u}_0

How can we find uk\vec{u}_k for an arbitrary large kk

u\vec{u} lives in the column space of AA, and AA has nn independent eigenvectors so we can say that u\vec{u} lives in the vector space spanned by these eigenvectors.
so u\vec{u} is the linear combination of these eigenvectors.
say the eigenvectors of AA are x1,x2,,xn\vec{x}_1,\vec{x}_2,\cdots,\vec{x}_n and eigenvalues of AA are λ1,λ2,,λn\lambda_1,\lambda_2,\cdots,\lambda_n
So we can say that,
u0=c1x1+c2x2++cnxn\vec{u}_0=c_1\vec{x}_1+c_2\vec{x}_2+\cdots+c_n\vec{x}_n
Au0=c1Ax1+c2Ax2++cnAxn\Rightarrow A\vec{u}_0=c_1A\vec{x}_1+c_2A\vec{x}_2+\cdots+c_nA\vec{x}_n
Au0=c1λx1+c2λx2++cnλxn\Rightarrow A\vec{u}_0=c_1\lambda\vec{x}_1+c_2\lambda\vec{x}_2+\cdots+c_n\lambda\vec{x}_n
Aku0=c1λkx1+c2λkx2++cnλkxn\Rightarrow A^{k}\vec{u}_0=c_1\lambda^{k}\vec{x}_1+c_2\lambda^{k}\vec{x}_2+\cdots+c_n\lambda^{k}\vec{x}_n
Aku0=ΛkSc\Rightarrow A^{k}\vec{u}_0=\Lambda^k S \vec{c}

Λ=[λ1000λ2000λn];S=[x1x2xn];c=[c1c2cn]\Lambda=\begin{bmatrix} \lambda_1 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n \\ \end{bmatrix};\quad S=\begin{bmatrix} \vdots & \vdots & \cdots & \vdots \\ \vec{x}_{1} & \vec{x}_{2} & \cdots & \vec{x}_{n} \\ \vdots & \vdots & \cdots & \vdots \\ \end{bmatrix};\quad \vec{c}=\begin{bmatrix} c_1\\c_2\\ \vdots \\c_n \end{bmatrix}

So,

danger
uk=Aku0=ΛkS c\begin{matrix} \displaystyle \vec{u}_k = A^{k}\vec{u}_0=\Lambda^k S\ \vec{c} \end{matrix}

Fibonacci example

Fibonacci sequence: 0,1,1,2,3,5,0,1,1,2,3,5,\cdots
How can we find FkF_k for an arbitrary large kk.
Fk+2=Fk+1+FkF_{k+2}=F_{k+1}+F_k
Now let's write it in form of uk+1=Auk\vec{u}_{k+1}=A\vec{u}_k

say uk=[Fk+1Fk]\vec{u}_k= \begin{bmatrix} F_{k+1}\\F_k\\ \end{bmatrix}

and uk+1=Auk\vec{u}_{k+1}=A\vec{u}_k

uk+1=A[Fk+1Fk]\Rightarrow \vec{u}_{k+1}=A\begin{bmatrix} F_{k+1}\\F_k\\ \end{bmatrix}

A=[1110]\Rightarrow A=\begin{bmatrix} 1&1\\1&0\\ \end{bmatrix}

What are it's eigenvalues and eigenvectors.

note

det(AλI)=1λ11λ\text{det}(A - \lambda\mathcal{I})=\begin{vmatrix} 1-\lambda & 1 \\ 1 & -\lambda \\ \end{vmatrix}

det(AλI)=λ2λ1\text{det}(A - \lambda\mathcal{I})=\lambda^2-\lambda-1
for det(AλI)=0\text{det}(A - \lambda\mathcal{I})=0 we get,

λ1=1+52\lambda_1 = \frac{1+\sqrt{5}}{2}

λ2=152\lambda_2 = \frac{1-\sqrt{5}}{2}
We get our eigenvalues λ1,λ2\lambda_1, \lambda_2.
(AλI)x=0(A-\lambda\mathcal{I})\vec{x}=0

[1λ11λ]x=0\begin{bmatrix} 1-\lambda & 1 \\ 1 & -\lambda \\ \end{bmatrix} \vec{x}=0
by solving it we get,
x=[λ1]\vec{x}=\begin{bmatrix} \lambda\\ 1 \end{bmatrix}
So our eigenvectors are
x1=[λ11],\vec{x}_1=\begin{bmatrix} \lambda_1\\ 1 \end{bmatrix},\quad x2=[λ21]\vec{x}_2=\begin{bmatrix} \lambda_2\\ 1 \end{bmatrix}

Now we get our eigenvectors and eigenvalues.
u\vec{u} lives in the vector space spanned by these eigenvectors.
so u\vec{u} is the linear combination of these eigenvectors.
we found the eigenvectors of AA x1,x2\vec{x}_1,\vec{x}_2 and eigenvalues of AA are λ1,λ2\lambda_1,\lambda_2
So we can say that,
u0=c1x1+c2x2\vec{u}_0=c_1\vec{x}_1+c_2\vec{x}_2
Au0=c1Ax1+c2Ax2\Rightarrow A\vec{u}_0=c_1A\vec{x}_1+c_2A\vec{x}_2
Au0=c1λ1x1+c2λ2x2\Rightarrow A\vec{u}_0=c_1\lambda_1\vec{x}_1+c_2\lambda_2\vec{x}_2
So,

info
uk=Aku0=c1(1+52)kx1+c2(152)kx2\vec{u}_k=A^{k}\vec{u}_0=c_1\left(\frac{1+\sqrt{5}}{2}\right)^{k}\vec{x}_1+c_2\left(\frac{1-\sqrt{5}}{2}\right)^{k}\vec{x}_2

Now let's find c1,c2c_1,c_2.

we know u0=[F1F0]\vec{u}_0=\begin{bmatrix} F_{1}\\F_0\\ \end{bmatrix}

u0=[10]\Rightarrow \vec{u}_0=\begin{bmatrix} 1\\0\\ \end{bmatrix}

And we know that u0=c1x1+c2x2\vec{u}_0=c_1\vec{x}_1+c_2\vec{x}_2 so,

u0=c1[λ11]+c2[λ21]\vec{u}_0=c_1\begin{bmatrix} \lambda_1\\ 1 \end{bmatrix}+c_2\begin{bmatrix} \lambda_2\\ 1 \end{bmatrix}

c1[λ11]+c2[λ21]=[10]\Rightarrow c_1\begin{bmatrix} \lambda_1\\ 1 \end{bmatrix}+c_2\begin{bmatrix} \lambda_2\\ 1 \end{bmatrix}=\begin{bmatrix} 1\\0\\ \end{bmatrix}

Now we got system of equations,

c1λ1+c2λ2=1c_1\lambda_1 + c_2\lambda_2 = 1

c1+c2=0c_1 + c_2 = 0

by solving we get, c1=1λ1λ2c_1=\frac{1}{\lambda_1-\lambda_2} and c2=1λ1λ2c_2=\frac{-1}{\lambda_1-\lambda_2}

λ1λ2=1+52152=5\lambda_1-\lambda_2 = \frac{1+\sqrt{5}}{2} - \frac{1-\sqrt{5}}{2}=\sqrt{5}

we know that uk=Aku0=c1λ1kx1+c2λ2kx2\vec{u}_k = A^k\vec{u}_0=c_1\lambda_1^k\vec{x}_1+c_2\lambda_2^k\vec{x}_2

uk=1λ1λ2(λ1kx1λ2kx2)\Rightarrow \vec{u}_k =\frac{1}{\lambda_1-\lambda_2}\left(\lambda_1^k\vec{x}_1-\lambda_2^k\vec{x}_2\right)

uk=1λ1λ2(λ1k[λ11]λ2k[λ21])\Rightarrow \vec{u}_k =\frac{1}{\lambda_1-\lambda_2}\left( \lambda_1^k\begin{bmatrix} \lambda_1\\ 1 \end{bmatrix}- \lambda_2^k\begin{bmatrix} \lambda_2\\ 1 \end{bmatrix}\right)

uk=1λ1λ2([λ1k+1λ1k][λ2k+1λ2k])\Rightarrow \vec{u}_k =\frac{1}{\lambda_1-\lambda_2}\left( \begin{bmatrix} \lambda_1^{k+1}\\ \lambda_1^k \end{bmatrix}- \begin{bmatrix} \lambda_2^{k+1}\\ \lambda_2^k \end{bmatrix}\right)

We know that, uk=[Fk+1Fk]\vec{u}_k= \begin{bmatrix} F_{k+1}\\F_k\\ \end{bmatrix}
So,

Fk=λ1kλ2kλ1λ2F_k=\frac{\lambda_1^k - \lambda_2^k}{\lambda_1-\lambda_2}

λ1=1+52\lambda_1 = \frac{1+\sqrt{5}}{2} and λ2=152\lambda_2 = \frac{1-\sqrt{5}}{2} so

danger
Fk=15((1+52)k(152)k)\begin{matrix} \displaystyle F_k=\frac{1}{\sqrt{5}}\left( \left(\frac{1+\sqrt{5}}{2}\right)^k - \left(\frac{1-\sqrt{5}}{2}\right)^k \right) \end{matrix}
info

For large k,k,\quad (152)k0\left(\frac{1-\sqrt{5}}{2}\right)^{k}\approx 0
So

Fk15((1+52)k)F_k\approx \frac{1}{\sqrt{5}}\left( \left(\frac{1+\sqrt{5}}{2}\right)^k \right)

1+52\frac{1+\sqrt{5}}{2} is known as Golden Ratio