19.5. MATLAB AND EIGENVALUES 419

Proof: It only remains to consider the last claim. This claim follows from the funda-mental theorem of algebra, Theorem 15.14.3. Indeed, the characteristic polynomial is apolynomial of degree n. It has a zero λ 1 by the fundamental theorem of calculus. Thus

det(A−λ I) = (z−λ 1) p2 (z)

where p2 (z) is a polynomial of degree n − 1. Now apply the fundamental theorem ofalgebra to this one and continue this process untill you obtain an expression of the form

det(A−λ I) = (z−λ 1) · · ·(z−λ n)(−1)n

then there are n eigenvalues with some maybe being repeated.Note that if A = S−1BS, then A,B have the same characteristic polynomial, hence the

same eigenvalues. (They might have different eigenvectors and usually will.) To see this,note that from the properties of determinants

det(A−λ I) = det(S−1BS−λS−1IS

)= det

(S−1 (B−λ I)S

)= det

(S−1)det(B−λ I)det(S) = det

(S−1S

)det(B−λ I)

= det(I)det(B−λ I) = det(B−λ I) (19.1)

19.5 MATLAB and EigenvaluesThe problem with eigenvalues and eigenvectors is that you have to factor a polynomial inorder to get the eigenvalues. We can’t do this in general. All we can do is find the eigenval-ues approximately. But an approximate eigenvalue is never enough to get the eigenvectorbecause (A−λ I)−1 will exist if λ is not exactly right.

However, there are numerical methods to do this in the case that the polynomial doesnot factor. I am going to mention how to get the answer using MATLAB.

To find the eigenvalues enter A and follow with ;. Then type eig(A) and press return. Itwill give numerical approximation of the eigenvalues. If you want to have it find the exactvalues, you type eig(sym(A)) and press return. To do this last thing, you need to have thesymbolic math package installed.

For example, if your matirix is 1 1 0−1 0 −12 1 3

 ,

You would type the following: >>A=[1,1,0;-1,0,-1;2,1,3]; and then eig(sym(A)) and re-turn, you will get the eigenvalues 1,1,2 listed in a column. This is correct. The matrixhas a repeated eigenvalue of 1. If you want to get the eigenvectors also, you would type>>A=[1,1,0;-1,0,-1;2,1,3]; and then [V,D]=eig(sym(A)) and enter or if you want numeri-cal answers, which will sometimes be all that is available, you would type [V,D]=eig(A). Itwill find the matrix V such that AV =V D where D is a diagonal. In the case just considered,it will only find two columns for V because this is a defective matrix. In general, however,this would give V−1AV = D and the columns of V are the eigenvectors.

19.6 Matrices and the Dot ProductHere I will revert to consideration of Rn rather than Cn. I do this because this is not abook on linear algebra, only multi-variable calculus and I will give specialized treatments