% Problem P1

Problem set #4: 4.13, 4.14, 4.16, 4.17, 4.19, 4.20, 4.21, 4.22, 4.23 (a)(b)
4.13. Considering the Cayley-Hamilton theorem, show that the inverse of a nonsingular nn
matrix A can be written as a matrix polynomial of degree n  1. Using this approach, determine
the inverse of the matrix.
1  1 4 
A = 3 2
1


2 1  1
Is this method efficient for computation?
Solution
Let f() = n + an-1n-1 + ... + a1 + a0 = 0
be the characteristic equation of A. Since A is a nonsingular matrix, i  0; that is, every
eigenvalue is nonzero, and (1)na0 = |A|  0.
A n + an-1A n-1 + ... + a1A + a0I = 0  I = 
A-1 = 
1
(A n + an-1A n-1 + ... + a1A)
a0
1
(A n-1 + an-1A n-2 + ... + a1I)
a0
>> A=[1 -1 4;3 2 1;2 1 -1]
A=
1 -1 4
3 2 1
2 1 -1
>> poly(A)
ans =
1.0000 -2.0000 -7.0000 12.0000
1
A-1 =  (A 2  2A  7I)
12
>> id=eye(3)
id =
1 0 0
0 1 0
0 0 1
>> Ai=-(A*A-2*A-7*id)/12
Ai =
0.2500 -0.2500 0.7500
-0.4167 0.7500 -0.9167
0.0833 0.2500 -0.4167
>> Ai=inv(A)
Ai =
0.2500 -0.2500 0.7500
-0.4167 0.7500 -0.9167
0.0833 0.2500 -0.4167
This method is more efficient than using the
formula A-1 = Aa/|A| to determine the inverse
matrix. However this method is not as efficient
as the Gauss-Jordan technique to invert a
matrix.
The Gauss-Jordan technique augments the given matrix with the identity matrix of the same
order. One then reduces the original matrix to the identity matrix by elementary row
transformations, performing the same operations on the augmentation columns. When the
identity matrix stands as the left half of the augmented matrix, the inverse of the matrix stands as
the right half.
4.14. It is not obvious that the eigenvalues of an nn real symmetric matrix are real, since the
roots of the nth-order characteristic equation with real coefficients are, in general, complex
numbers. Prove that the eigenvalues of a real symmetric matrix are real.
Hint: Assume that there are complex eigenvalues  with complex conjugates * and show that 
= * so that the eigenvalues are real.
Solution
Suppose that x is an eigenvector of A corresponding to the eigenvalue , we have
Ax = x
Take the complex conjugate of both sides
Ax = x  A x = * x  A x = * x since A is a real matrix
(Ax)T x = (x)T x  xT(AT x ) = xT x
xT(A x ) = xT x  xT(* x ) = xT x
*xT x = xT x   = * so that the eigenvalues are real
4.16
Compute A543 for the matrix
  3  4
A= 
3 
2
Solution
( 1)(+ 1) = 0  1= 1; 2=  1
A543 = (1)543
( A  1I)  3  4
( A  2I)
+ (2)543
= 
( 1  2 )
( 2  1 )
3 
2
>> e1=1;e2=-1;
>> ii=eye(2)
ii =
1 0
0 1
>> e1^543*(A-e2*ii)/(e1-e2)+e2^543*(A-e1*ii)/(e2-e1)
ans =
-3 -4
2 3
>> A^543
ans =
-3 -4
2 3
4.17 Write a MATLAB script using the Symbolic Math Toolbox to compute
a b 
A2  (a + d)A + (ad  bc) = 0, where A = 

c d 
Solution
% Problem 4.17
syms a b c d
Asym=[a b; c d]
I1=eye(2);
re1=Asym*Asym-(a+d)*Asym+(a*d-b*c)*I1
simplify(re1)
>> p4d17
Asym =
[ a, b]
[ c, d]
re1 =
[ a^2-(a+d)*a+a*d, a*b+b*d-(a+d)*b]
[ c*a+d*c-(a+d)*c, d^2-(a+d)*d+a*d]
ans =
[ 0, 0]
[ 0, 0]
>>
4.19
Find an orthonormal set of eigenvectors for the matrix
 9  2  2  4 0
 2 11 0
2 0


A =  2 0
7  2 0


  4 2  2 9 0
 0
0
0
0 3
Solution
>> A=[9 -2 -2 -4 0;-2 11 0 2 0;-2 0 7 -2 0;-4 2 -2 9 0;0 0 0 0 3];
>> [E,v]=eig(A)
E=
0 -0.5774 0.3486 0.4603 -0.5774
0 -0.0000 0.8088 0.1117 0.5774
0 -0.5774 0.1117 -0.8088 -0.0000
0 -0.5774 -0.4603 0.3486 0.5774
1.0000
0
0
0
0
>> v1=E(:,2); v2=E(:,2); v3=E(:,3); v4=E(:,4); v5=E(:,5);
>> disp(v1')
0 0 0 0
>> disp(v2')
-0.5774 -0.0000
>> disp(v3')
0.3486 0.8088
>> disp(v4')
0.4603 0.1117
>> disp(v5')
-0.5774 0.5774
>>
1
-0.5774 -0.5774
0
0.1117 -0.4603
0
-0.8088
0.3486
0
-0.0000
0.5774
0
4.20
Show that similar matrices A and B have the same eigenvalues. Thus, you must show that
det(A  I) = det(B  I)
Solution
P-1BP = A
A similarity transformation has the important property that the eigenvalues of the transformed
matrix are the same as those of the original matrix.
|A  I| = |P-1BP  I|
|A  I| = |P-1BP  P-1PI| = |P-1BP  P-1I P|
|A  I| = |P-1(B  I)P|
Since |ABC| = |A| |B| |C|, the above expression becomes
|A  I| = |P-1| |(B  I)| |P| = |P-1 P| |(B  I)| = |(B  I)|
4.21
Find the determinant and eigenvalues of the matrix in
1  1 0
3 5
0
A= 
1
0 0

0 0  1
0
0

5

1
by partitioning it into 22 matrices.
Solution
B 0 
1  1
 1 5
0 0
A= 
, where B = 
,C= 
,0= 




3 5 
  1 1
0 0
 0 C
|A| = |B||C| =
1 1 1
3
5
5 1 1
= 86 = 48
(1 )(5 ) + 3 = 0  1= 4; 2= 2
(1 )(1 ) + 5 = 0  3= 1 + 2.2361i; 4= 1  2.2361i
>> A=[1 -1 0 0;3 5 0 0;0 0 1 5;0 0 -1 1]
A=
1 -1 0 0
3 5 0 0
0 0 1 5
0 0 -1 1
>> det(A)
ans =
48
>> eig(A)
ans =
2.0000
4.0000
1.0000 + 2.2361i
1.0000 - 2.2361i
4.22
Solve for the eigenvalues and the eigenvectors for the matrix
 
m
A=  1
 
 m2
 
m1 


m2 
Write a MATLAB script to solve the problem using the Symbolic Math Toolbox.
Solution
 
 

2
 



=0
  
  
 m1
  m2
 m1m2

2
2
 
  +
2 +  

=0
m
m
m
m
m
m
1 2
1 2
2 
 1

 

1= 0; 2=  

 m1 m2 
 
m
1= 0   1
 
 m2
x1 = c A11 =  c
c
 
m1   x1  0
=

    x2  0
m2 



c
; x2 = c A12 = – c
 x1 = – c
m2
m2
m2

m

 
   2
2=  


 m1 m2 
 m2
x1 = c A11
c
1
1


m1 


m1 
 x1  0
 x  = 0
 2  
 m 


  2 
c
= c ; x2 = c A12 = – c
 x2 = – c
m1
m1
m2
m2 

1


>> syms b m1 m2
>> A=[-b/m1 b/m1;b/m2 -b/m2]
A=
[ -b/m1, b/m1]
[ b/m2, -b/m2]
>> [E,v]=eig(A)
E=
[
1, -1/m1*m2]
[
1,
1]
v=
[
[
0,
0]
0, -b*(m1+m2)/m1/m2]
4.23 a. b.
a. Find the eigenvalues and eigenvectors for the 33 identity matrix. Generalize the result for an
nn identity matrix.
b. Using a 22 example, show that two matrices with the same eigenvalues are not necessarily
similar.
Solution
a.
1 0 0
I = 0 1 0  (1 )3 = 0   = 1 (three times) and we are free to pick the


0 0 1
independent eigenvectors  (x1)T = [ 1 0 0], (x2)T = [ 0 1 0], (x3)T = [ 0 0 1]
For an nn identity matrix  = 1 (n times), and the eigenvectors are n unit vectors.
b.
We need to find two matrices with the same eigenvalues. Using the formula
p() = |A  I| = ()n + cn-1()n-1 + ... + c1() + c0 = 0
where
n
cn-1 = tr(A) = trace of A =
a
i 1
ii
= the sum of the elements on the diagonal of A
c0 = |A|
For a 22 matrix, 2 + c1() + c0 = 0
n
Let c1 =
a
i 1
ii
= 3, c0 = |A| = 2 so that 1=  1; 2=  2
Two matrices with the same eigenvalues can then be obtained
1  2
A= 
,B=
3  4
4
2
 3  5


2 3 
Let P = 
 P-1 =

0  1
.5 1.5
 0  1


2 3  1  2 .5 1.5  5.5 32.5 
0  1 3  4  0  1 =  1.5  8.5  B  A and B are not similar.


 

