Talk on Chapter 6 Eigenvalues and Eigenvectors

(Linear Algebra Fall 1999)

Setup (Needed for using Maple, not for viewing)

Raw start (if without wqstools)

Introduction.

Consider a linear transformation [Maple Math] from a vector space [Maple Math] to itself and fix a basis [Maple Math] for [Maple Math] . We have seen that there is an associated n by n matrix [Maple Math] for [Maple Math] which gives us a formula to compute the coordinate vector [Maple Math] as [Maple Math] for any given vector [Maple Math] . The transformation itself can be then conveniently written as
[Maple Math] .

We have also seen that if we change the basis to [Maple Math] for some n by n invertible matrix [Maple Math] , then the matrix for [Maple Math] changes to the matrix [Maple Math] which is said to be similar to [Maple Math] and we would like to investigate when this new matrix can be diagonal.

The columns of the matrix [Maple Math] turned out to be eigenvectors of [Maple Math] belonging to the corresponding eigenvalue on the resulting diagonal matrix. We study the details of these topics next.

Eigenvectors and Eigenvalues

We defined a vector [Maple Math] to be an eigenvector for the matrix [Maple Math] if [Maple Math] is nonzero and [Maple Math] for some scalar [Maple Math] . The corresponding scalar [Maple Math] is said to be the eigenvalue that [Maple Math] belongs to.

How do we find eigenvectors and eigenvalues? First note that if we consider the matrix [Maple Math] , then [Maple Math] must be a nonzero vector in its null space. So, the matrix [Maple Math] must be singular and we know a very simple test for this, namely [Maple Math] . If we expand this determinant and simplify the expression, then it is easy to that we get a polynomial in [Maple Math] of degree [Maple Math] , where [Maple Math] has size n by n.

Indeed, the resulting polynomial is known as the characteristic polynomial charpoly(A,lambda) and is a builtin function. Actually, it is more customary to use the
[Maple Math] where the two coefficients [Maple Math] and [Maple Math] have nice interpretations.

The coefficient [Maple Math] can be readily computed as the sum of all the main diagonal entries of [Maple Math] . You have already seen the formulas for the determinant.

Thus, all the eigenvalues are given by roots of the equation [Maple Math] and we know that this equation has n roots, at least if we go to complex numbers as needed and account for multiplicities.

We see some quick examples.

> A:=matrix(2,2,[1,4,2,3]);charpoly:=factor(det(lambda*diag(1$2)-A));
eigenvals(A);

[Maple Math]

[Maple Math]

[Maple Math]

So, the eigenvalues are [Maple Math] .

> A:=matrix(3,3,[.2,.4,0,.4,.8,0,0,0,1]);
charpoly:=factor(det(lambda*diag(1$3)-A));
eigenvals(A);

[Maple Math]

[Maple Math]

[Maple Math]

Because of the decimal points, maple went into numerical mode. However, the actual eigenvalues are simply 0,1. Note that 1 is a double eigenvalue! Maple can also find the eigenvectors, or you can use your skill with null spaces!

> eigenvects(A);

[Maple Math]

> nullspace(A-diag(1$3));

[Maple Math]

>

Thus, the calculation of the eigenvalues and eigenvectors is at least easy to describe, though it can be difficult in practice, since it involves solving a complicated determinant, then solving a polynomial (nonlinear) equation and then several null space calculations. We can also run into complex roots and numerical difficulties. It is because of these complications that this is considered a difficult task and there are alternate numerical procedures described in the book. We outline several tricks below.

Properties of eigenvectors

For a given scalar [Maple Math] , we define the eigenspace [Maple Math] to be the set of all vectors [Maple Math] such that [Maple Math] or [Maple Math] . Thus [Maple Math] is simply the nullspace of [Maple Math] . All nonzero vectors of [Maple Math] are eigenvectors of [Maple Math] belonging to [Maple Math] . Of course, unless [Maple Math] is an eigenvalue, the space [Maple Math] shall be the zero vector space and won't produce any eigenvector!

Consider two distinct scalars [Maple Math] and take bases for their eigenspaces to be [Maple Math] and [Maple Math] , respectively. We can show that the vectors together are still independent and give a basis for the sum of the two eigenspaces. To see this, we write a linear combination of all these vectors as [Maple Math] equated to 0, where [Maple Math] is the sum of the terms coming from { [Maple Math] } and [Maple Math] is the sum from the terms { [Maple Math] }.
We now get two equations:
[Maple Math] and by applying the transformation [Maple Math] . It is easy to deduce that [Maple Math] and hence by hypothesis, all the coefficients are zero!

This easily generalizes to several eigenvectors to give us the result that if we take all the eigenvalues of a matrix [Maple Math] and put the bases of their eigenspaces together, then we get an independent set of vectors.

Diagonalization: when can we achieve it?

In particular, in the lucky situation when [Maple Math] has [Maple Math] distinct eigenvalues, then taking one eigenvector each, we get [Maple Math] independent vectors [Maple Math] , belonging to eigenvalues [Maple Math] respectively. Then setting [Maple Math] to be the matrix with columns [Maple Math] , we clearly see that [Maple Math] where [Maple Math] . Thus, the matrix [Maple Math] is diagonalizable!

We had already seen an example of a nondiagonalizable matrix where [Maple Math] . Here [Maple Math] is the only eigenvalue with multiplicity [Maple Math] , but the eigenspace [Maple Math] has dimension 1, with basis [Maple Math] .

There is also the case of complex roots, for example the matrix
[Maple Math] , whose eigenvalues come out to be [Maple Math] the two square roots of [Maple Math] . Actually, this matrix is diagonalizable with [Maple Math] . You can check it. However, it cannot be diagonalized with any real matrix. Indeed, in real vectors, it has no eigenvector, since geometrically, it is a clockwise rotation about the origin by [Maple Math] radians and so no nonzero vector can be mapped to a multiple of itself!

Thus, we know two ways in which we can get stuck: if there are nonreal eigenvalues or if there are repeated eigenvalues.

Symmetric matrices are good (diagonalizable)!

If the matrix [Maple Math] is a symmetric matrix, then we can show that all eigenvalues are real and the matrix indeed is diagonalizable. We take this up next. What we present is one complete proof which is only briefly indicated in the book.

First, suppose that [Maple Math] is a symmetric matrix and has one real eigenvalue [Maple Math] , with a real eigenvector [Maple Math] , say. Let [Maple Math] be an orthonormal complement of the space spanned by [Maple Math] . Suppose that we choose an orthonormal basis [Maple Math] for [Maple Math] so that together with [Maple Math] , we get an orthonormal basis for all of [Maple Math] . We claim that with respect to the basis [Maple Math] , the matrix changes to [Maple Math] where [Maple Math] is a symmetric matrix operating on [Maple Math] .
Indeed, write the basis
[Maple Math] , where [Maple Math] is the usual standard basis in [Maple Math] . Then from the orthonormality of the basis [Maple Math] , we see that the matrix [Maple Math] is itself orthogonal, i.e. [Maple Math] . Thus the matrix [Maple Math] transforms to [Maple Math] and is clearly a symmetric matrix. From the fact that [Maple Math] is nothing but [Maple Math] , we see that the first column of the transformed matrix is [Maple Math] . By symmetry of the transformed matrix, we easily see that it must have the announced shape!

Now, it is not hard to see that we can continue working on the new symmetric matrix [Maple Math] and deduce the final result that the matrix [Maple Math] can be diagonalized.

Thus it only needs to be proved that any eigenvalue of a (real) symmetric matrix is real. Suppose that [Maple Math] has a complex eigenvalue [Maple Math] and a corresponding complex eigenvector [Maple Math] . Then it also must have a conjugate eigenvalue [Maple Math] and a corresponding eigenvector [Maple Math] obtained by conjugating all the entries of [Maple Math] .
We clearly have
[Maple Math] and [Maple Math] . This last equation gives, when transposed, [Maple Math] .
The quantity
[Maple Math] can be computed as [Maple Math] times [Maple Math] to get the value [Maple Math] , but by computing it as [Maple Math] times [Maple Math] , we see it to be [Maple Math] . Since [Maple Math] is clearly nonzero, being the sum of squares of the absolute values of components of [Maple Math] , we see that [Maple Math] . Thus [Maple Math] is real! Now, we can always pick a real eigenvector for a real [Maple Math] , since it is simply a part of the basis for the null space of [Maple Math] .

More properties of symmetric matrices.

Symmetric matrices have many nice properties which we now collect together for reference.

We have already seen that all the eigenvalues of a (real) symmetric matrix are real. We can also show that eigenvectors belonging to different eigenvalues are automatically perpendicular to each other. For this, suppose that [Maple Math] is symmetric and has eigenvectors [Maple Math] belonging to different eigenvalues [Maple Math] respectively. Compute [Maple Math] in two different ways as above to get an equation [Maple Math] . Since [Maple Math] are distinct, we must have [Maple Math] or that [Maple Math] are perpendicular.

Thus, in order to get an orthonormal basis of eigenvectors of [Maple Math] , all we do is first pick orthonormal bases for the different eigenspaces and then just put them together in one combined basis. Getting an orthonormal basis for the eigenspace of a single eigenvalue [Maple Math] , all we do is pick some basis first and then make it orthonormal by the old Gram-Schmidt process, which we already know.

In particular, the diagonalizing matrix [Maple Math] can be chosen to be orthogonal, i.e. [Maple Math] , where [Maple Math] .

As a consequence, note that if the symmetric matrix has only one eigenvalue [Maple Math] , then it must be simply the scalar matrix [Maple Math] . This is because, by theory, A= [Maple Math] , but the last expression is simply [Maple Math] .

Symmetric matrices, inner products and related topics

Symmetric matrices can be used to define a kind of dot product or inner product on [Maple Math] . To understand this, let us review what properties a dot product should have.

Clearly a dot product should have
Symmetry:
[Maple Math]
Linearity: (
[Maple Math] ). [Maple Math] = [Maple Math] . [Maple Math] + [Maple Math] . [Maple Math] , [Maple Math] ( [Maple Math] )=( [Maple Math] ). [Maple Math]
Properness:
[Maple Math] and [Maple Math] iff [Maple Math] .

If we have the first two properties, then the usual algebra of dot products works and with the last property, we can define length and angles properly.

If we take any symmetric matrix [Maple Math] and define [Maple Math] , then the first two properties are easy to check. The last property of properness needs much more checking and this is what we are investigating.

The last property translates to two subproperties:
Nonnegativity:
[Maple Math] and
Definiteness:
[Maple Math] iff [Maple Math] .
We say that the matrix
[Maple Math] is positive definite, if it has both these subproperties. It is positive semidefinite, if only the nonnegativity holds. Finally, we say that [Maple Math] is indefinite, if there are negative as well as positive self dot products.

We can change [Maple Math] to [Maple Math] and talk about negative definite and negative semidefinite as well!

First, we note that we can replace the matrix [Maple Math] by a similar matrix [Maple Math] where [Maple Math] without affecting the properties. But then [Maple Math] acquires a diagonal appearance and then we have very simple tests for either of these definiteness. Namely, if the diagonal entries are assumed to be [Maple Math] , then we have:
[Maple Math] is positive definite iff all [Maple Math] are positive
[Maple Math] is positive semidefinite iff all [Maple Math] are nonnegative
[Maple Math] is said to be indefinite if we have mixed signs among the entries.
Similar tests are easily made for negative versions.

But the above test is expensive, for we need to build an orthonormal basis, which always involves lot of work. Calculating eigenvalues is no easy task either. We do know a simpler method already, which we now invoke.

We know that we can take our matrix [Maple Math] and write it as [Maple Math] where [Maple Math] is a diagonal matrix and [Maple Math] is an invertible lower trianglular matrix. We learnt this process while we did the alternate form of the Gram-Schmidt process in a special lecture. At that time, we built a symmetric matrix by taking dot products of a sequence of vectors, now we are starting with a symmetric matrix already!

If we look at the columns [Maple Math] of [Maple Math] , then we see that in our current dot product, they are a set of mutually perpendicular (meaning zero dot product) vectors. Thus, for the matrix to be positive definite, all self dot products must be positive, i.e., the diagonal entries must be all positive. Moreover it is not hard to see that for any combination [Maple Math] , the self dot product comes out to be [Maple Math] , where [Maple Math] denotes our current dot product. This is easily seen to be positve for nonzero vectors [Maple Math] .

Actually, there is an even simpler way of expressing this result. We can convince ourselves that the product of the first [Maple Math] diagonal entries [Maple Math] for the resulting matrix [Maple Math] is simply the first [Maple Math] by [Maple Math] determinant in [Maple Math] . (This presumes that we don't swap any rows along the way, and we can always arrange this to be the case). So, if this sequence of determinants can be calculated alternately, then we can state the test as checking that all these determinants are positive. These are sometimes called principle minors.
For example:

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

[Maple Math]

> [det(submatrix(A,1..1,1..1)),det(submatrix(A,1..2,1..2)),
det(submatrix(A,1..3,1..3))];

[Maple Math]

So, [Maple Math] is positive definite!

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

[Maple Math]

> [det(submatrix(A,1..1,1..1)),det(submatrix(A,1..2,1..2)),
det(submatrix(A,1..3,1..3))];

[Maple Math]

> factor(%);

[Maple Math]

>

So, we can say what values of [Maple Math] will keep this matrix positive definite or positive semidefinite or indefinite.
For
[Maple Math] or for [Maple Math] , we will get indefinite,
for
[Maple Math] or [Maple Math] , we will get positive semidefinite and positive definite otherwise!

Application to the critical points of multivariate functions

One of the main uses of this analysis is calculation of the behavior of a multivariate function near a critical point. To illustrate the method, consider a function [Maple Math] which has a zero at the origin and its first two partials [Maple Math] and [Maple Math] are also zero. Then a Taylor expansion gives a second order approximation [Maple Math]
for small
[Maple Math] . This is a quadratic form [Maple Math] and can be represented as a dot product [Maple Math] which uses the matrix [Maple Math] . Thus the test for positive definiteness is [Maple Math] and [Maple Math] . If you note that [Maple Math] , [Maple Math] and [Maple Math] , you will recognize the test for a local minimum.

Positive semidefiniteness corresponds to a minimum with some critical directions, while indefiniteness corresponds to a saddle point.

The concepts of negative definiteness etc. correspond to local maximum.

Similar tests are easily made in higher dimensions, since we already have the concept worked out in linear algebra.

The expression in [Maple Math] above is a quadratic form in two variables. In general, a quadratic form in several variables, gives a symmetric matrix where the square terms go along the main diagonal and product terms of two varibles go in the appropriate corners after division by [Maple Math] . We can perform the analysis of positive and negative values of the quadratic form in a similar fashion.

The SVD and pseudoinverse.

As already explained, we have no hope of finding a diagonal form for the matrix of a transformation from [Maple Math] to [Maple Math] , in case the two dimensions are different. Also it does not make sense to try and use the same basis for the domain as well as the target, since these don't even have the same dimension. So, we allow a choice of bases [Maple Math] for [Maple Math] and [Maple Math] for [Maple Math] and try to make the matrix as simple as possible. We have also indicated roughly how this is achieved. Now we describe it in detail.

First we show an example.
Consider a matrix
[Maple Math] . This gives a transormation from [Maple Math] to [Maple Math] , given by [Maple Math] in the standard bases for respective spaces.
We compute the matrix
[Maple Math] and find a basis of [Maple Math] , consisting of eigenvectors for the symmetric matrix [Maple Math] , which we know to exist now. We will see that the part of the basis corresponding to the eigenspace of [Maple Math] shall be a basis for the null space of [Maple Math] and the rest will map to a set of orthogonal vectors in the target space. Here are the calculations.

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

[Maple Math]

> M:=evalm(transpose(A)&*A);

[Maple Math]

> lis:=eigenvects(M);

[Maple Math]

> S:=transpose(matrix(3,3,[lis[3][3][1],lis[2][3][1],lis[1][3][1]]));

[Maple Math]

> AA:=evalm(A&*S);

[Maple Math]

> evalm(transpose(AA)&*AA);

[Maple Math]

> evalm(transpose(S)&*S);

[Maple Math]

>

This shows that if we choose the vectors [Maple Math] given by the three columns of [Maple Math] are mutually perpendicular. So, [Maple Math] will give an orthonormal basis for [Maple Math] , such that [Maple Math] are mutually perpendicular and give a basis of [Maple Math] . We can set [Maple Math] as a basis of the target [Maple Math] and the resulting matrix has a nice diagonal form. Explicitly, we set the basis of [Maple Math] by the columns of [Maple Math] below and the the basis of [Maple Math] by the columns of [Maple Math] below. The matrix of the transformation is also shown.

> G:=evalm(S&*diag(1/sqrt(2),1/sqrt(6),1/sqrt(3)));

[Maple Math]

> H:=augment(col(AA,1)/norm(col(AA,1),2),col(AA,2)/norm(col(AA,2),2));

[Maple Math]

> evalm(A&*G);

[Maple Math]

> ans:=matrix(2,3,[1,0,0,0,sqrt(3),0]);

[Maple Math]

> evalm(H&*ans);

[Maple Math]

Let us record the whole procedure for future use.

Assume that we have a map from [Maple Math] to [Maple Math] . Assume that in the standard bases, it is given by a matrix [Maple Math] .

The matrix [Maple Math] is a symmetric n by n matrix. It can be diagonalized. Find an orthonormal basis [Maple Math] for [Maple Math] consisting of eigenvectors of [Maple Math] . Arrange the vectors so that the last [Maple Math] vectors are in the eigenspace of [Maple Math] , i.t. in the null space of [Maple Math] , where [Maple Math] is the rank of [Maple Math] . Call the resulting basis [Maple Math] .

Calculate [Maple Math] . Make an orthonormal basis for [Maple Math] consisting of [Maple Math] for [Maple Math] . Fill it up, if needed, by [Maple Math] vectors to complete an orthonormal basis for the [Maple Math] . Call the resulting basis [Maple Math] .

Then the matrix of the transformation in the bases [Maple Math] is given by [Maple Math] . Here [Maple Math] is a diagonal entries which are simply square roots of the eigenvalues of [Maple Math] , matching the corresponding vectors.

Thus, for our example, the final matrix is [Maple Math] .

The so-called pseudoinverse shall be [Maple Math] .

Let us do one more example.

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

[Maple Math]

> M:=evalm(transpose(A)&*A);

[Maple Math]

> lis:=eigenvects(M);

[Maple Math]

> S:=transpose(matrix(3,3,[lis[2][3][1],lis[2][3][2],lis[1][3][1]]));

[Maple Math]

The first two columns of [Maple Math] are from the same eigenvalue 3 and so need not be orthogonal. Indeed they are not.

We check their mutual dot products and take the one evident step of the Gram-Schmidt algorithm.

> evalm(transpose(S)&*S);

[Maple Math]

> S1:=addcol(S,1,2,1/2);
S2:=evalm(transpose(S1)&*S1);

[Maple Math]

[Maple Math]

So, now we can build our [Maple Math] .
For
[Maple Math] we take the three columns of [Maple Math] , which we normalize by dividing by the norm.
For
[Maple Math] we take the images of the first two columns of [Maple Math] , normalized and we need to fill in one extra vector to make an orthonormal basis.

> AA:=evalm(A&*S1);

[Maple Math]

> evalm(transpose(AA)&*AA);

[Maple Math]

We picked the third column for [Maple Math] by inspection.

> H:=augment(col(AA,1)/norm(col(AA,1),2),col(AA,2)/norm(col(AA,2),2),
matrix(3,1,[1/sqrt(3),-1/sqrt(3),-1/sqrt(3)]));

[Maple Math]

> evalm(transpose(H)&*H);

[Maple Math]

>

>

> G:=evalm(S1&*diag(1/sqrt(S2[1,1]),1/sqrt(S2[2,2]),1/sqrt(S2[3,3])));

[Maple Math]

> evalm(A&*G);

[Maple Math]

> evalm(transpose(%)&*%);

[Maple Math]

> ans:=matrix(3,3,[sqrt(3),0,0,0,sqrt(3),0,0,0,0]);

[Maple Math]

>

> evalm(H&*ans);

[Maple Math]

Thus the final matrix in the new bases [Maple Math] is [Maple Math] . This is verified by the identity [Maple Math] .

Finally, we explain the pseudoinverse of the matrix which is simply [Maple Math] . You shuld work out the spaces [Maple Math] as explained in the lecture on Chapter 7.

Pseudoinverse

As explained above, we have a transformation [Maple Math] from [Maple Math] to [Maple Math] and we have found bases [Maple Math] respectively as follows.

First, let [Maple Math] be the matrix of [Maple Math] in some standard bases.

The basis [Maple Math] of [Maple Math] is [Maple Math] which is known to be orthonormal. Further, we have arranged it so that [Maple Math] form a set of orthonormal eigenvectors for [Maple Math] and [Maple Math] for [Maple Math] .

The orthonormal basis for [Maple Math] is [Maple Math] and is chosen so that [Maple Math] and is orthonormal. Then the matrix form [Maple Math] in the bases [Maple Math] is given by [Maple Math] where [Maple Math] is a diagonal matrix with diagonal entries [Maple Math] .

Then the pseudoinverse is given by first taking the transpose of [Maple Math] and then replacing the entries [Maple Math] by their inverses [Maple Math] . Denote this by [Maple Math] .

Then the transformation given by the matrix [Maple Math] gives the projection of [Maple Math] into the space [Maple Math] in the basis [Maple Math] . The reverse product [Maple Math] gives the projection of [Maple Math] into [Maple Math] in the basis [Maple Math] .