






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Bent E. Petersen
Filename: 254w2001_eigenvects_examp.mws
Linear Algebra supplement for Vector Calculus 1.
In this worksheet I give a few examples of eigenvalues and eigenvectors of matrices in the first part. In the
second part I provide the answeres, as given by Maple, to the problems in the Mth 254 Study Guide (Parks
2000-01 revision).
If you try a few of these examples by hand you will develop a deep appreciation for Maple, or a similar tool.
> restart;
> with(linalg):
Warning, new definition for norm
Warning, new definition for trace
> A1:=matrix(3,3,[-1,2,2,2,2,2,-3,-6,-6]);
> eigenvals(A1);
A1 has distinct eigenvalues. Thus A1 is diagonizable. Let's diagonalize it explicitly.
> v1:=eigenvects(A1);
v1 :=[ -3 1 {, , [ -1 0 1, , ]}], [ 0 1 {, , [ 0 -1 1, , ]}],[ -2 1 {, , [ -2 1 0, , ]}]
> s1:={}: for k from 1 to 3 do s1:=s1 union op(3,op(k,[v1])): od:
unassign('k'): s1;
> S1:=matrix(3,0,[]);
S1 :=array( 1 .. 3 , 1 ..0 [ ], )
> S1:=augment(S1,op(s1));
> inverse(S1) & A1 & S1: D1:=evalm(%);**
There is an easier way to do these calculations. Let's start over. First we compute the eigenvaules of A1 and
put them in a diagonal matrix. We can do this as follows:
> D1b:=diag(eigenvals(A1));
D1b :=
Now if A1 is diagonizable the it will be 'similar' to D1b - so we ask Maple to check:
> issimilar(A1,D1b,'P1b');
true
The return value indicates A1 is diagonizable. In this case P1b has been assigned a matrix which plays the
role of the inverse of S1 above. let's check it;
> evalm(P1b); S1b:=inverse(P1b);
S1b :=
It doesn't look the same, but let's check that it works:
> inverse(S1b) & A1 & S1b: evalm(%);**
> eigenvals(A3);
Again we have an eigenvalue (1) with algebraic multiplicity 2. We do not yet know if A3 is diagonizable or
not. Let's compute the eigenvectors.
> s3:=eigenvects(A3);
s3 :=[ 1 2 {, , [ 1 1 1, , ]}],[ 2 1 {, , [ 0 1 1, , ]}]
Oops. We see the eigenvalue 1 has geometric multiplicity 1 (only one eigenvector for 1 is listed by Maple).
Thus A3 is not diagonizable. The "closest" we can get it the Jordan canonical form
> jordan(A3);
You probably suspect we could have used the jordan() function above to verify the diagonizability of A1 and
A2. If so, you are correct, but it would have been less fun.
> jordan(A1);
> jordan(A2);
This time consider a symmetric matrix. We know that a symmetric matrix has real eigenvalues and is
diagonizable whether it has repeated eigenvalues or not.
> A4:=matrix(4,4,[0,1,-1,2,1,1,0,-1,-1,0,-1,1,2,-1,1,0]);
If we compute the exact eigenvalues we get a nearly incomprehensible expression, so let's compute
approximate eigenvalues instead.
> evalf(eigenvals(A4),16);
Those imaginary parts should not be there! They are due to roundoff as you can see by doing the calculation
at several precisions. For example
> evalf(eigenvals(A4),22);
That A4 is diagonizable we can verify by computing the Jordan canonical form
> evalf(jordan(A4));
0 0 -3.323404277 0
0 0 0 -.
Here is another symmetric example:
> A5:=matrix(4,4,[0,1,2,3,1,0,1,2,2,1,0,1,3,2,1,0]);
> jordan(A5);
> M04:=matrix(2,2,[-5,1,-5,-3]);
> eigenvects(M04);
> M05:=matrix(2,2,[-6,2,2,-3]);
> eigenvects(M05);
> M06:=matrix(2,2,[6,2,2,3]);
> eigenvects(M06);
> M07:=matrix(3,3,[5,2,2,2,-2,0,2,0,-2]);
> eigenvects(M07);
> M08:=matrix(3,3,[5,3,3,3,2,0,3,0,2]);
> eigenvects(M08);
> M09:=matrix(3,3,[-7,0,3,0,-7,2,3,2,5]);
> eigenvects(M09);
> M10:=matrix(3,3,[1,0,1,0,1,2,1,2,5]);
> eigenvects(M10);
Once we know the eigenvalues of the symmetric matrix of a quadratic form we can write down the
diagonalized version of the quadratic form. In general we are after more. We want to know an explicit change
of variables that diagonalizes the quadratic form. With a little coaching, Maple can solve this sort of problem.
I'll show you one way of doing it here, but there may be better ways. If you use Maple, you should
experiment.
> Q11:=-6x^2+4xy-3y^2;**
Q11 :=− 6 x + −
2 4 x y 3 y
2
> M11:=hessian(Q11/2,[x,y]);
> D11:=diag(eigenvals(M11));
> issimilar(M11,D11,P11);
true
We would like to use the inverse of P11 to define our change of variables, but we have to normalize the
columns of the inverse first. Let's call the result S
> normalize(col(inverse(P11),1)),normalize(col(inverse(P11),2)):
S11:=augment(matrix(2,0,[]),%);
> sub11:=evalm(S11 & matrix(2,1,[u,v]));*
sub11 :=
5 u
5 v
5 u
5 v
> subs(x=sub11[1,1], y=sub11[2,1], Q11); 'Q11'=expand(%);
5 u
5 v
2
4
5 u
5 v
5 u
5 v 3
5 u
5 v
2
Q11 =− 7 u −
2 2 v
2
> M:=hessian(Q/2,[x,y,z]);
> D0:=diag(eigenvals(M));
> issimilar(M,D0,P);
true
> normalize(col(inverse(P),1)),normalize(col(inverse(P),2)),norma
lize(col(inverse(P),3)): S:=augment(matrix(3,0,[]),%);
> sub:=evalm(S & matrix(3,1,[u,v,w]));*
sub :=
21 u 6
v
w
21 u
( 17 + 85 ) 85 v
( − 17 + 85 ) 85 w
21 u
( 5 + 85 ) 85 v
( − 5 + 85 ) 85 w
> T:=subs(x=sub[1,1], y=sub[2,1], z=sub[3,1], Q);
2 12 %5 %4 24 %4 %3 6 %5 %3 6 %
2 6 %
2
21 u
( 5 + 85 ) 85 v
( − 5 + 85 ) 85 w
21 u
( 17 + 85 ) 85 v
( − 17 + 85 ) 85 w
21 u 6
v
w
It is not obvious that we have diagonalized Q, so let's expand T
> T:=expand(T);
T 6 u
2 1608
v
2 85
w
2 85
v
2
w
2
Now it is obvious, but it would be nice if we could collect the terms as well:
> collect(T,[u,v,w]);
6 u
2
v
2
w
2
The coefficients do not look like the original eigenvalues, so let's check them:
> c2:=subs(u=0,v=1,w=0,T);
c2 := 1608 +
> is(c2=D0[2,2]);;
true
> c3:=subs(u=0,v=0,w=1,T);
c3 := 13260 −
> is(c3=D0[3,3]);
true
In spite of appearances the coefficients are correct.