12.4. MATLAB AND EIGENVALUES 279

Example 12.3.3 Suppose the matrix is

A =

 21 −16 −614 60 127 8 38

Estimate the eigenvalues.

The exact eigenvalues are 35,56, and 28. The Gerschgorin disks are

D1 = {λ ∈ C : |λ −21| ≤ 22} ,

D2 = {λ ∈ C : |λ −60| ≤ 26} ,

andD3 = {λ ∈ C : |λ −38| ≤ 15} .

Gerschgorin’s theorem says these three disks contain the eigenvalues. Now 35 is in D3,56is in D2 and 28 is in D1.

More can be said when the Gerschgorin disks are disjoint but this is an advanced topicwhich requires the theory of functions of a complex variable. If you are interested and havea background in complex variable techniques, this is in [13]

12.4 MATLAB and EigenvaluesTo 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. For example, if you type >>A=[1,1,0;-1,0,-1;2,1,3]; and then eig(sym(A)) and return, you will get the eigenvalues 1,1,2 listed ina column. This is correct. The matrix has a repeated eigenvalue of 1. If you want to get theeigenvectors 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 numerical answers, which will sometimes be all that is available,you would type [V,D]=eig(A). It will find the matrix V such that AV = V D where D is adiagonal. In the case just considered, it will only find two columns for V because this is adefective matrix. In general, however, this would give V−1AV = D and the columns of Vare the eigenvectors.

12.5 Exercises1. State the eigenvalue problem from an algebraic perspective.

2. State the eigenvalue problem from a geometric perspective.

3. Consider the linear transformation which projects all vectors in R2 onto the span ofthe vector (1,2) . Show that the matrix of this linear transformation is(

1/5 2/52/5 4/5

)

Now based on geometric considerations only, show that 1 is an eigenvalue and thatan eigenvector is (1,2)T . Also explain why 0 will also be an eigenvalue.