Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

30.2: Diagonalization

( \newcommand{\kernel}{\mathrm{null}\,}\)

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
import sympy as sym
from urllib.request import urlretrieve

sym.init_printing()
urlretrieve('https://raw.githubusercontent.com/colbrydi/jupytercheck/master/answercheck.py', 
            'answercheck.py');
%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
import sympy as sym
from urllib.request import urlretrieve

sym.init_printing()
urlretrieve('https://raw.githubusercontent.com/colbrydi/jupytercheck/master/answercheck.py', 
            'answercheck.py');
Reminder

The eigenvalues of triangular (upper and lower) and diagonal matrices are easy:

  • The eigenvalues for triangular matrices are the diagonal elements.
  • The eigenvalues for the diagonal matrices are the diagonal elements.

Diagonalization

Definition

A square matrix A is said to be diagonalizable if there exist a matrix C such that D=C1AC is a diagonal matrix.

Definition

B is a similar matrix of A if we can find C such that B=C1AC.

Given an n×n matrix A, can we find another n×n invertable matrix C such that when D=C1AC is diagonal, i.e., A is diagonalizable?

  • Because C is invertible, we have

C1AC=D

CC1AC=CD

AC=CD

  • Generate C as the columns of n linearly independent vectors (x1xn) We can compute AC=CD as follows:

A[x1x2xn]=AC=CD=[x1x2xn][λ10000λ200000λn]

  • Then we check the corresponding columns of the both sides. We have

Ax1=λ1x1Axn=λxn

  • A has n linear independent eigenvectors.
  • A is saied to be similar to the diagonal matrix D, and the transformation of A into D is called a similarity transformation.

A simple example

Consider the following:

A=[71034],C=[2513]

Do This

Find the similar matrix D=C1AC of A.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

#Put your answer to the above question here.
#Put your answer to the above question here.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer

checkanswer.matrix(D, '8313fe0f529090d6a8cdb36248cfdd6c');
from answercheck import checkanswer

checkanswer.matrix(D, '8313fe0f529090d6a8cdb36248cfdd6c');
Do This

Find the eigenvalues and eigenvectors of A. Set variables e1 and vec1 to be the smallest eigenvalue and it’s associated eigenvector and e2, vec2 to represent the largest.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

#Put your answer to the above question here.
#Put your answer to the above question here.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer
checkanswer.float(e1, "e4c2e8edac362acab7123654b9e73432");
from answercheck import checkanswer
checkanswer.float(e1, "e4c2e8edac362acab7123654b9e73432");

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer
checkanswer.float(e2, "d1bd83a33f1a841ab7fda32449746cc4");
from answercheck import checkanswer
checkanswer.float(e2, "d1bd83a33f1a841ab7fda32449746cc4");

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer
checkanswer.eq_vector(vec1, "d28f0a721eedb3d5a4c714744883932e", decimal_accuracy = 4)
from answercheck import checkanswer
checkanswer.eq_vector(vec1, "d28f0a721eedb3d5a4c714744883932e", decimal_accuracy = 4)

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer
checkanswer.eq_vector(vec2, "09d9df5806bc8ef975074779da1f1023", decimal_accuracy = 4)
from answercheck import checkanswer
checkanswer.eq_vector(vec2, "09d9df5806bc8ef975074779da1f1023", decimal_accuracy = 4)
Theorem

Similar matrices have the same eigenvalues.

Proof

Assume B=C1AC is a similar matrix of A, and λ is an eigenvalue of A with corresponding eigenvector x. That is, Ax=λx. Then we have B(C1x)=C1AC(C1x)=C1Ax=C1(λx)=λ(C1x). That is C1x is an eigenvector of B with eigenvalue λ.

A second example

Do This

Consider A=[4635].

Find a matrix C such that C1AC is diagonal.

Hint: use the function diagonalize in sympy.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

#Put your answer to the above question here. 
#Put your answer to the above question here. 

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

#Check the output type
assert(type(C)==sym.Matrix)
#Check the output type
assert(type(C)==sym.Matrix)

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer
checkanswer.matrix(C,'ba963b7fef354b4a7ddd880ca4bac071')
from answercheck import checkanswer
checkanswer.matrix(C,'ba963b7fef354b4a7ddd880ca4bac071')

The third example

Do This

Consider A=[5331].

Can we find a matrix C such that C1AC is diagonal.

Hint: find eigenvalues and eigenvectors using sympy.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

#Put your answer to the above question here. 
#Put your answer to the above question here. 

Dimensions of eigenspaces and diagonalization

Definition

The set of all eigenvectors of a n×n matrix corresponding to a eigenvalue λ, together with the zero vector, is a subspace of Rn. This subspace spaces is called eigenspace.

  • For the third example, we have that the characteristic equation (λ2)2=0.
  • Eigenvalue λ=2 has multiplicity 2, but the eigenspace has dimension 1, since we can not find two lineare independent eigenvector for λ=2.

The dimension of an eigenspace of a matrix is less than or equal to the multiplicity of the corresponding eigenvalue as a root of the characteristic equation.

A matrix is diagonalizable if and only if the dimension of every eigenspace is equal to the multiplicity of the corresponding eigenvalue as a root of the characteristic equation.

The fourth example

Do This

Consider A=[2112].

Can we find a matrix C such that C1AC is diagonal.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

#Put your answer to the above question here. 
#Put your answer to the above question here. 

This page titled 30.2: Diagonalization is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Dirk Colbry via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?