### Review - Foxes and Rabbits and Eigenvalues and Eigenvectors for the Projection Matrix

Review Recall that the equation
Ax = lambda x
allows us to turn matrix multiplication into scalar multiplication. The eigenvectors are those x that satisfy the equation. While the 0 vector always works, we look for nontrivial solutions. The eigenvalues lambda are the scaling factors - ie we stay on the same line through the origin, and lambda tells us how we scale along that line.

1. Let's say that foxes and rabbits interact via the following matrix
A := Matrix([[21/40,3/20],[-3/16,39/40]]);
Execute the Eigenvectors(A); command
2. Explain why the eigenvectors form a basis for R2.
3. Write out the eigenvector decomposition for the system.
4. Use the decomposition to explore what will happen to the populations in the longterm, and what kind of vector(s) the system will travel along to achieve that longterm behavior, and then fill in the blanks:
If ___ equals 0 then we die off along the line____ [corresponding to the eigenvector____], and otherwise we [choose one: die off or grow or hit and then stayed fixed] along the line____ [corresponding to the the eigenvector____].

5. Recall that the matrix takes (x,y) to (1/2 x + 1/2 y, 1/2 x +1/2 y), ie projected onto the y=x line. If we look at light rays perpendicular to the y=x line, this matrix gives us the shadow a vector makes onto the y=x line, which has many applications in mathematics and physics. In other words, given a starting vector, we drop the perpendicular to the y=x line, and the base of the right triangle we form is the projection vector.

Execute with(LinearAlgebra): Enter M into Maple. Use commands like
M.Vector([-1, 1]);
to test M on different column vectors like (1,0), (0,1), (1,1), and (-1,1). Notice that any vectors on the lines y=x and y=-x, with basis representatives (1,1) and (-1,1), are eigenvectors for M. In addition, (-1,1) or anything else on the line y=-x gets sent to (0,0) which is still on the same line through the origin, so the eigenvalue is 0, and anything on y=x, like (1,1) gets fixed by M, so the eigenvalue is 1.]
6. Input the matrix
A:=Matrix([[(cos(theta))^2,cos(theta)*sin(theta)],[cos(theta)*sin(theta),((sin(theta))^2)]]);
7. Execute Eigenvectors(A); Notice that Maple won't give us the Eigenvectors when a variable is in the matrix.
8. However, we can execute Eigenvalues(A); so execute this.
Notice that the eigenvalues are 0 and 1, just like in problem 5, so we can guess that this is a generalized projection matrix onto other lines.

theta=Pi/2 When theta is Pi/2, the line of projection is the y-axis

theta=Pi/2

What are the eigenvectors and eigenvalues in this case? You should be able to identify them from the picture.
Execute
theta := Pi/2
in Maple, and then execute
Eigenvectors(A);
and compare with the above picture. The eigenvalue of 1 corresponds to vectors on the line of projection, and the eigenvalue of 0 corresponds to vectors perpendicular to the line of projection.

The matrix A projects vectors onto the line through the origin that makes an angle of theta degrees with the positive x-axis [in number 1 above, the line was y=x, ie theta was 45 degrees from the positive x-axis. In this case sin and cos are sqrt(2)/2, so the matrix has all entries of 1/2 like M does].

9. Let's use a bit of trigonometry to determine the equation of the line of projection for A for a general theta:

Notice that theta is labeled in the picture above, and I have created a right triangle to the x-axis so that we can use the trigonometry of the unit circle. The hypotenuse is the line of projection for A. Why is the x-value of point P in the picture above cos(theta)? Why is the y-value sin(theta)? Use this to show that the slope of the hypotenuse from (0,0) to P=(cos(theta), sin(theta)) is tan(theta). Since the y-intercept occurs at (0,0), this would tell us that the line of projection is y=tan(theta) x.
10. If we use the trigonometry of the unit circle, we can find the eigenvectors for A for any theta even though Maple cannot. Form P as the matrix of the corresponding eigenvectors as columns

Explain why the first column is an eigenvector corresponding to the eigenvalue of 1, and why the second column is an eigenvector corresponding to an eigenvector of 0. Hint: Where do the vectors lie in relation to the line of projection y=tan(theta) x. We found that the eigenvectors for the projection matrix A which projects onto a line of general angle theta was
P=

11. What geometric transformation is P? Input P into Maple. How about MatrixInverse(P)?
12. Notice that the determinant of P is 1, so if we set up the system Px=0, the only solution would be the trivial solution. Hence the columns of P are linearly independent and so A is diagonalizable. Form
A:=Matrix([[(cos(theta))^2,cos(theta)*sin(theta)],[cos(theta)*sin(theta),((sin(theta))^2)]]);

Diag:=simplify(MatrixInverse(P).A.P)

What familiar geometric transformation is Diag?

13. Notice that P.Diag.MatrixInverse(P) = A by matrix algebra and # 12. Writing out a transformation in terms of a P, the inverse of P, and a diagonal matrix will prove very useful in computer graphics, as we will see tomorrow and Thursday. Fill in the blanks below. Recall that we read matrix composition from right to left.

P.Diag.MatrixInverse(P) = A

If we want to project a vector onto the y=tan(theta) x line, first we can perform MatrixInverse(P) which takes a vector and rotates it counterclockwise by theta. Next we perform Diag, which projects onto the line _____________ . And finally we perform P, which rotates ___________________ by theta.