Untitled (1)

Maple double check of problem #9 in 8.3

> with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> A:=matrix([[-3,1,2],[1,-3,2],[2,2,0]]);

A := matrix([[-3, 1, 2], [1, -3, 2], [2, 2, 0]])

> eigenvalues(A);

2, -4, -4

> eigenvectors(A);

[2, 1, {vector([1, 1, 2])}], [-4, 2, {vector([-1, 1...

> GramSchmidt({vector([-1,1,0]),vector([-2,0,1])});

{[-2, 0, 1], [-1/5, 1, -2/5]}

These are different than ours. Notice Maple used the second first as the first one in the G-S process. We switch them below.

> GramSchmidt({vector([-2,0,1]),vector([-1,1,0])});

{[-1, 1, 0], [-1, -1, 1]}

We normalize the three eigenvectors, the two for eigenvalue -4 and the one for eigenvalue 2.

> normalize(vector([1,1,2 ]));
normalize(vector([-1,1,0]));
normalize(vector([-1,-1,1]));

vector([1/6*sqrt(6), 1/6*sqrt(6), 1/3*sqrt(6)])

vector([-1/2*sqrt(2), 1/2*sqrt(2), 0])

vector([-1/3*sqrt(3), -1/3*sqrt(3), 1/3*sqrt(3)])

> P:=transpose(matrix([[1/6*sqrt(6), 1/6*sqrt(6), 1/3*sqrt(6)],
[-1/2*sqrt(2), 1/2*sqrt(2), 0],[-1/3*sqrt(3), -1/3*sqrt(3), 1/3*sqrt(3)]]));

P := matrix([[1/6*sqrt(6), -1/2*sqrt(2), -1/3*sqrt(...

This is the same as the one we got by hand. Is in really orthogonal? Does in diagonalize A as the theory says it should?

> inverse(P);

matrix([[1/6*sqrt(6), 1/6*sqrt(6), 1/3*sqrt(6)], [-...

Indeed P inverse equals P transpose.

> evalm(transpose(P)&*A&*P);

matrix([[2, 0, 0], [0, -4, 0], [0, 0, -4]])

Check!

We use the jordon command to diagonialize A and construct P.

>

> jordan(A,'P');

matrix([[-4, 0, 0], [0, 2, 0], [0, 0, -4]])

> evalm(P);

matrix([[-7/6, 1/6, -2], [-1/6, 1/6, 0], [2/3, 1/3,...

jordan diagonalized A differently, and did not normalize P, nor is its P orthogonal.