190 CHAPTER 11. MATRICES AND THE INNER PRODUCT
Row reduce this. 1 0 −2 −6 00 1 3 7 00 0 0 0 0
Thus column one of A2 equals −2 times column one of I added to three times column oneof A. Thus consider the polynomial λ
2− 3λ + 2. This seems to work in so far as the firstcolumn of A is concerned and there is no polynomial of smaller degree which will work.Therefore, lets check to see if this sends A to 0. If it does, then it must be the minimalpolynomial. When you do the computations, you find that this indeed does send A to 0and so it is the minimum polynomial. The eigenvalues are 1 and 2. You can now find theeigenvectors for these using row operations.
11.2 Using MatlabIt is routine to find this polynomial and so it is not surprising that MATLAB is able to doit for you. I recommend doing this rather than all the trouble just described. The syntax touse is this:
>> A=[1,2,3;3,-3,1;2,7,1]; minpoly(A) Here you press enter. It gives:1 1 -24 -69These are the coefficients of the minimum polynomial which is
λ3 +λ
2−24λ −69
The matrix you entered was 1 2 33 −3 12 7 1
You open MATLAB and you see >>. Then type in just what is above. The ; at the end afterentering the matrix says for MATLAB to know the matrix but not to rewrite it. You can ofcourse follow the same pattern to enter any square matrix you like. Then of course you arefaced with the problem of finding the roots of the polynomial. Sometimes you can’t do thisexactly. Neither can MATLAB. However, when the polynomial can be factored, MATLABcan do it for you. Here is the syntax.
>> syms x
factor(xˆ2-3*x+2) (here you press enter and what results is:)[x-1, x-2]To get to a new line in MATLAB you press shift enter. You factored x2−3x+2. You
can enter any polynomial you like, but sometimes they can’t be factored exactly. When thishappens, MATLAB will just return the original polynomial. This is its way of saying thatit has no idea how to do it.
11.3 Distance and Unitary MatricesSome matrices preserve lengths of vectors. That is |Ux| = |x| for any x in Cn. Such amatrix is called unitary. Actually, this is not the standard definition. The standard definition