Professional Documents
Culture Documents
Experiment 3
Cayley-Hamilton’s theorem
Department of Mathematics
1 Aim
2 Mathematical Description
Ax = λx, (2.1)
where λ is a scalar.
The determinant det(A − λI) on the left hand side of (2.2) is an nth degree poly-
nomial, and is known as the characteristic equation of A.
Theorem 2.1 (Cayley-Hamilton Theorem). Every square matrix A satisfies its
characteristic equation.
Thus if
c1 λn + c2 λn−1 + · · · + cn λ + cn+1 = 0 (2.3)
Example 3.1.
Write a Matlab code to verify Cayley-Hamilton Theorem for a square matrix of
1 2 3
order n. Then verify it for A = 2 −1 4 ·
−1 0 1
solution.
(a) Code
clear
clc
A= input ( ' Enter the matrix A : ' )
DimA= s i z e ( A )
charp = poly ( A )
P= zeros ( DimA ) ;
for i = 1 : DimA ( 1 ) + 1
P = P+ charp ( i ) *A ˆ ( DimA(1)+1 − i ) ;
end
disp ( ' RHS o f the c h a r a c t e r i s t i c equation = ' )
disp ( round ( P ) )
i f round ( P ) = = 0
disp ( ' Caylay−Hamilton theorem i s v e r i f i e d ' )
end
(b) Input
Enter the matrix A : [ 1 2 3 ; 2 −1 4; −1 0 1 ]
(c) Output
A =
1 2 3
2 −1 4
−1 0 1
DimA =
3 3
charp =
1.0000 −1.0000 −2.0000 16.0000
RHS o f the c h a r a c t e r i s t i c equation =
0 0 0
0 0 0
0 0 0
Caylay−Hamilton theorem i s v e r i f i e d
4 Self-check Exercises
Exercise 4.1.
Verify Cayley-Hamilton Theorem for each of the following matrices using Matlab:
!
1 1
1. A =
−2 4
!
2 0
2. A =
1 −3
!
5 −2
3. A =
4 −1
!
1 1
4. A =
1 0
!
−3 4
5. A =
4 3
Exercise 4.2.
Verify Cayley-Hamilton Theorem for each of the following matrices using Matlab:
2 2 0
1. A = 2 1 1
−7 2 −3
1 2 1
2. A = 6 −1 0
−1 −2 −1
0 −1 −3
3. A = 2 3 3
−2 1 1
2 2 −2
4. A = 2 −1 4
−2 4 −1
1 2 0
5. A = 2 −1 0
0 0 1
5 Concept-based Exercises
Exercise 5.1.
Given a square matrix A of order 3, write a Matlab code to find its determinant.
Then use it to verify if A is invertible.
1 2 1
1. A = 2 1 1
1 1 2
1 2 3
2. A = 3 4 5
4 5 6
−5 4 2
3. A = 4 −5 2
2 2 −8
Exercise 5.2.
Given a square matrix A of order 3, write a Matlab code to find its inverse through
Caley-Hamilton theorem. Hence verify it for
2 1 1
1. A = 1 2 1
1 1 2
−5 4 2
2. A = 4 −5 2
2 2 −8
1 3 1
3. A = 3 1 3 ·
1 1 −2