3. Find all eigenvectors and eigenvalues of the folling matrix:

[ 4 0 1 ]
[ 2 3 2 ]
[ 1 0 4 ]

Let's look at the characteristic polynomial of this matrix: det(A-aI)

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

[ 4-a 0 1 ]
[ 2 3-a 2 ]
[ 1 0 4-a ]

> B:=det(A);

B := 45 - 39 a + 11 a2 - a3


The roots of this equation are the eigenvalues of A.

> C:=solve(B);

C := 5, 3, 3

So a=5 and a=3 are the eigenvalues of the matrix.

To find the eigenvectors , we need to find the solutions of the homogenous system (A-aI)*w=0.

Let a=5

> a1:=matrix([[4,0,1],[2,3,2],[1,0,4]]);

a1 := [ 4 0 1 ]
[ 2 3 2 ]
[ 1 0 4 ]

> a2:=matrix([[5,0,0],[0,5,0],[0,0,5]]);

a2 := [ 5 0 0 ]
[ 0 5 0 ]
[ 0 0 5 ]

> a3:=evalm(a1-a2);

a3 := [ -1 0 1 ]
[ 2 -2 2 ]
[ 1 0 -1 ]

Then the system of equations (A-aI)*w has the form:

					     -x + z = 0
				       2x - 2y + 2z = 0
					      x - z = 0

where w=(x,y,z)

> a4:=gaussjord(a3);

a4 := [ 1 0 -1 ]
[ 0 1 -2 ]
[ 0 0 0 ]

The general solution is:

						x=t
						y=2t
						z=t


This solution gives the set of all eigenvalues with the eigenvalue 5. It is a subspace spanned by the vector b1=(1,2,1)

Now let a=3.
> b1:=evalm(a1);

b1 := [ 4 0 1 ]
[ 2 3 2 ]
[ 1 0 4 ]

b2:=matrix([[3,0,0],[0,3,0],[0,0,3]]);

b2 := [ 3 0 0 ]
[ 0 3 0 ]
[ 0 0 3 ]


b3:=evalm(b1-b2);

b3 := [ 1 0 1 ]
[ 2 0 2 ]
[ 1 0 1 ]

The system (A-aI)*w has the form

					      x + z = 0
					    2x + 2z = 0
					      x + z = 0

where w=(x,y,z)

> b4:=gaussjord(b3);

[ 1 0 1 ]
[ 0 0 0 ]
[ 0 0 0 ]


The general solution is:

						x=-t
						y=t
						z=t

Thus the set of eigenvectors with eigenvalue 3 forms a subspace spanned by the vector b2=(-1,1,1).

So the eigenvectors are (1,2,1) and (-1,1,1) (and their non-zero multiples).