## Written Homework Assignment Solutions

1.1:
(6) Draw the vector from the point (0,0) to the point (0,4), then draw the vector from (0,4) to (5/21/2, 4+5/21/2) (this is just the vector which is 5 units long and at an angle of 45 degrees). The total displacement vector is the vector from (0,0) to (5/21/2, 4+5/21/2).
```(16)
-3(a-c)+2(a+2b)+3(c-b) = Distributive law
-3a+3c+2a+4b+3c-3b = Commutative law
-3a+2a+4b-3b+3c+3c = Distributive law
-a+b+6c
```
(20) Draw a line through the points (0,0) and (-2,3). This gives the axis along the vector u. Now draw a line through the points (0,0) and (2,1). This gives the axis along the vector v. Now draw the parallelogram determined by the points (2,-3) (which comes from -u), (-4,-2) (which comes from -2v), and (0,0). The fourth point of the parallelogram is (-4+2,-2-3) = (-2,-5), which gives w.

(22) This is like (20): find the parallelogram whose sides are on the lines through u and v and whose fourth point is (2,9), which is given by w. You'll see it looks like you have to go along the u-line by a total of 2u and along the v line a total of 3v. Thinking of u and v as row vectors (since they're easier to type than the column vectors the book uses) we check: 2u+3v = 2(-2,3)+3(2,1)=(-4+6,6+3)=(2,9)=w, so w = 2u+3v.

1.2:

(2) u.v=(3,-2).(4,6)=3*4-2*6=0

(8) ||u|| = (u.u)1/2 = (32+(-2)2)1/2 = 131/2

(14) d(u,v) = ||u-v|| = ||(-1,-8)|| = 651/2

(18) -3 = u.v = ||u||*||v||*cos(t), so the cosine of the angle t is negative, so the angle is obtuse.

(34) projuv = (u.v/u.u)u = (4/2)u = (2,-2)

46(b) ||u+v|| = ||u|| - ||v|| if and only if u+v=0, or v=0, or neither is 0 but the angle between them is 180 degrees.
Proof: ||u+v|| = ||u|| - ||v|| if and only if ||u|| = ||u+v|| + ||v||. Squaring both sides gives: u.u = (u+v).(u+v) + v.v + 2||u+v||*||v|| which simplifies to 0 = v.(u+v) + ||u+v||*||v||, or to -v.(u+v) = ||u+v||*||v||, hence -||u+v||*||v||*cos(t) = ||u+v||*||v||. This is true if and only if either u+v=0, or v=0, or neither is 0 but the angle between them is 180 degrees (i.e., cos(t) = -1).

Here is an alternate solution, using our answer for 46(a) from class. (Recall that in class we showed that ||u+v|| = ||u|| + ||v|| if and only if u=0, or v=0, or neither is 0 but the angle between them is 0.)
46(b) ||u+v|| = ||u|| - ||v|| if and only if u+v=0, or v=0, or neither is 0 but the angle between them is 180 degrees.
Proof: ||u+v|| = ||u|| - ||v|| if and only if ||u+v|| + ||v|| = ||u|| if and only if ||u+v|| + ||-v|| = ||u|| if and only if ||a|| + ||b|| = ||a+b||, where a=u+v, and b=-v. Using our answer to 46(a), we see ||a|| + ||b|| = ||a+b|| if and only if a=0, or b=0, or neither is 0 but the angle between them is 0. I.e., u+v=0, or -v=0, or neither is 0 but the angle between u+v and -v is 0. But -v=0 is the same thing as v=0, and the angle between the angle between u+v and -v being 0 is the same thing as the angle between u+v and v being 180 degrees.

1.3:

18(a) The direction vector d for the line l is the normal vector for the plane P, so l is perpendicular to P.

(32) Pick a point P on the line L. Let p be the vector from the origin to P. Let v be the vector from P to Q. Project v onto a direction vector d for the line l; i.e., let u be projdv. Then the vector p + u is the vector from the origin to the point R. We can take P = (1,1,1), since from the equation given for the line, we know (1,1,1) is a point on the line. And we can take d = (-2,0,3), since that also is given by the equation of the line. So v = (0,1,0) - (1,1,1) = (-1,0,-1), and u = (-1/13)(-2,0,3), and R is (1,1,1)+(-1/13)(-2,0,3) = (1/13)(15,13,10).

(34) Here pick a point P on the plane (say P = (1,0,0)). Let p be the vector from the origin to P. Let v be the vector from P to Q = (0,0,0), so v = Q-P = (-1,0,0). Project v onto a normal vector n for the plane; i.e., let u be projnv. >From the equation for the plane we see that n = (1,-2,2), so u = (-1/9)(1,-2,2). Let q be the vector from the origin to Q; here q = 0. Then the vector q + u = (1/9)(1,-2,2) is the vector from the origin to the point R.

(44) Just find the absolute value of the angle between the normals; i.e., the cosine of the acute angle is |(3,-1,2).(1,4,-1)|/(||(3,-1,2)||*||(1,4,-1)||) = 3/(14*18)1/2. We get the angle by taking the arc-cosine.

48(a) Just project v = (1,0,-2) onto the normal n = (1,1,1), and subtract that from v; i.e., v - projnv = (1,0,-2) - (-1/3)(1,1,1) = (1/3)(4,1,-5) is the answer.

2.1:

(16) The two lines have different slopes so they intersect at one point. Solving shows that point to be x=3, y=-2.

(32) Let's use w, x, y, and z as our variableas:
v-w+3y+z=2
v+w+2x+y-z=4
w+2y+3z=0

2.2:

(14)
```[-2 -4  7]
[-3 -6 10]
[ 1  2 -3]
Put bottom row on top:
[ 1  2 -3]
[-2 -4  7]
[-3 -6 10]
Add twice top row to middle row,
and three times top row to bottom row:
[ 1  2 -3]
[ 0  0  1]
[ 0  0  1]
Subtract middle row from bottom row:
[ 1  2 -3]
[ 0  0  1]
[ 0  0  0]
This is now in row echelon form.
Add 3 times middle row to top row:
[ 1  2  0]
[ 0  0  1]
[ 0  0  0]
This is now in reduced row echelon form.
```

(18) The way to do this one is to transform both to reduced row echelon form, R. Since A and B are row equivalent, they have the same reduced row echelon form. Now you know how to change A to R, and B to R. Use the operations you found to go from A to R, and use the inverse of the operations you found, in the reverse order, to go from R back to B. This shows how to go from A to B; i.e., go via R. Using R1 <-> R2, R2 - 2R1, R3 + R1, R3 + R2, -R2 will convert A into
```[1 1 0]
[0 2 1]
[0 0 0].
```
Likewise, R1 <-> R3, (1/2)R1, R3 - R2, R2 - 3R1, R3 + 2R2, will convert B into the same matrix,
```[1 1 0]
[0 2 1]
[0 0 0].
```
Thus R1 <-> R2, R2 - 2R1, R3 + R1, R3 + R2, -R2 will convert A into
```[1 1 0]
[0 2 1]
[0 0 0]
```
and now R3 - 2R2, R2 + 3R1, R3 + R2, 2R1, R1 <-> R3 will convert
```[1 1 0]
[0 2 1]
[0 0 0]
```
back into B.

(28) The augmented matrix for the system of equations is
```[ 2  3 -1  4 | 0]
[ 3 -1  0  1 | 1]
[ 3 -4  1 -1 | 2].
```
Using the operations R3 - R2, R2 - 2R1, R1 - 2R2, R1 <-> R2, R2 + 4R3, -R2, R3 + 3R2, (1/2)R3, R2 + R3, R1 - R3, R1 + 4R2, converts this matrix into
```[ 1  0  0  1 | 1/2]
[ 0  1  0  2 | 1/2]
[ 0  0  1  4 | 5/2].
```
The variables are w, x, y and z, so the giving the leading varibales in terms of the free variable z, the solution is y = (5/2) - 4z, x = 1/2 - 2z, and w = 1/2 - z. In vector form, the solution is
```[w]   [1/2]    [-1]
[x] = [1/2] + z[-2]
[y]   [5/2]    [-4]
[z]   [ 0 ]    [ 1]
```

(42) The augmented matrix for the system of equations is
```[ 1 -2  3 | 2 ]
[ 1  1  1 | k ]
[ 2 -1  4 | k2].
```
The row operations R2 - R1, R3 - 2R1, R3 - R2 converts this into
```[ 1 -2  3 |      2    ]
[ 0  3 -2 |    k-2    ]
[ 0  0  0 | k2 - k - 2].
```

(a) Having no solution means having a leading entry in the augmented column; i.e., we need k2 - k - 2 NOT to be 0. Since k2 - k - 2 = (k-2)(k+1), this means there is no solution exactly when k is neither 2 nor -1.
(b) Having a unique solution means having no free variable, but no matter what k is, z is a free variable, so there is no value of k for which the solution is unique.
(c) By (a) and (c), we see that there are infinitely many solutions exactly when k is 2 or -1.

2.3:

(8) Just see if you can solve
```[ 1  2  3 | 10]
[ 4  5  6 | 11]
[ 7  8  9 | 12]
```
The fact is that b is in the span of the columns of A if and only if this system is consistent. It is consistent. If we call our variables x, y and z, then x = -28/3, y=29/3, z-0 is a solution. This even tells us how to write b in terms of the columns of A: (-28/3)u + (29/3)v + 0w = b, where u, v and w are the columns of A.

(12) By the theorem in class all we need to do is check that the matrix whose columns are the given vectors has rank 3, which it does, since the matrix row reduces to
```[ 1  0  0]
[ 0  1  0]
[ 0  0  1].
```

(20) (a) To show that span(S) is contained in span(T), we have to show that every element of span(S) is an element of span(T). So let w be an element of span(S). Thus w is a linear combination of u1, ..., uk, since S is defined to be the set {u1, ..., uk}, and span(S) is defined to be the set of all linear combinations of the vectors in the set S. Hence there are scalars c1, ..., ck such that w = c1u1 + ... + ckuk. But T = {u1, ..., uk, uk+1, ..., um}, so w = c1u1 + ... + ckuk + 0uk+1 + ... + 0um; i.e., w is a linear combination of the elements of T, hence w is in span(T). Thus every element of span(S) is in span(T), so the set span(S) is contained in the set span(T).
(b) Every vector in span(T) is in Rn, since we're only talking about vectors in Rn. Thus span(T) is contained in Rn. If Rn = span(S), we have: span(S) is contained in span(T), which is contained in Rn = span(S). Thus span(S) and span(T) contain each other, hence they must be the same set.

(24) We are given three column vectors. I'll write them as row vectors; they are (2, 2, 1), (3, 1, 2) and (1, -5, 2). To check if they are linearly dependent and to find a dependence if they are, make an augmented matrix out of them with augmented column all zeros, and solve the system by row reducing:
```[ 2  3  1 | 0]
[ 2  1 -5 | 0]
[ 1  2  2 | 0].
```
This row reduces to:
```[ 1  0 -4 | 0]
[ 0  1  3 | 0]
[ 0  0  0 | 0].
```
This has a nonzero solution. If we call the variables x, y and z, one nonzero solution is z = 1, x = 4 and y = -3. This means that 4(2, 2, 1) - 3(3, 1, 2) + (1, -5, 2) = (0,0,0). This is a dependence relationship, which we could write this way, showing that the third vector is a linear combination of the first two: (1, -5, 2) = -4(2, 2, 1) + 3(3, 1, 2).

3.1:

(10) Since F is a 2x1 matrix and D is a 2x2 matrix, we see DF is a 2x1 matrix, and we cannot multiply a 2x1 matrix F times another 2x1 matrix DF, so F(DF) is not defined.

(18) We want to find 2x2 matrices B and C such that Ab = AC but B is not equal to C, where A is as given below. (There are many different answers!)
```A=[2 1], and take B=[ 2 0] and C=[0 0].
[6 3]             [-1 0]       [0 0]
Then AB and AC both are the 0 matrix.
```
(30) Assume that A and B are matrices such that the product AB is defined. If the rows of A are linearly dependent, prove that the rows of AB are also linearly dependent.
Proof. As we discussed in class, rows of A are linearly dependent if and only if there is a nonzero row vector v such that vA = 0. But multiplying through by B gives vAB = 0B = 0, so by the same fact from class, the rows of AB are linearly dependent.

```(36) We want to calculate B2001, where
B=[c -c] and where c = 1/21/2.
[c  c]
First note that B2 is

[0 -1] and that B4 = (B2)2 is
[1  0]

[-1  0], so B8 = (B4)2 is
[ 0 -1]

[1  0] = I2. Thus B2001 =
[0  1]

B8*250 + 1 = (B8)250B
=I2B = B.
```

3.2:

(6) We must solve the system of linear equations given by xA1 + yA2 + zA3 = B. We can do this by setting up and row reducing the appropriate augmented matrix. (Alternatively, this is an easy system one to solve by inspection. Note that A1 and A3 both have a 0 in the lower left corner, whereas A2 has a 1 there. Thus IF there is a solution, y must be -4, which is the entry of B in this spot. Since A1 has a 0 in the upper right spot and A3 has a 1, taking into account that yA2 =-4A2 has a 4 at this spot, we see z = -1. Now we see that x = 3 is needed for the other two spots, hence B = 3A1 - 4A2 - A3 is the answer.)

(14) Let A1, A2 and A3 be the given three matrices. We must determine if there is any nonzero solution to xA1 + yA2 + zA3 = 0. If not, then the matrices A1, A2 and A3 are linearly independent. Otherwise, they are linearly dependent. We must write down an augmented matrix for this system of equations and solve it. Doing so shows that there is a free variable, hence a nonzero solution. For example, we can take x = -3, y = z = 1. Thus the matrices are linearly dependent.

3.3:

(12) Solve the equation
```[1 -1][x1] = [1]. Answer: [1 -1]-1 = (1/3)[ 1 1], so
[2  1][x2]   [2]          [2  1]                     [-2 1]

[x1] = (1/3)[ 1 1][1] = [1].
[x2]        [-2 1][2]   [0]
```
(52) Find A-1 for the given matrix A. Answer: Row reduce [A | I3]. Since A row reduces to I3, [A | I3] row reduces to [I3 | A-1]. Here is what we get for A-1:
```[ 2  3 -3]
[-1 -2  2]
[ 4  6 -7]
```

3.5:

(20) The matrix A =
```[ 2 -4  0  2  1]
[-1  2  1  2  3]
[ 1 -2  1  4  4]
```
row reduces to R=
```[ 1 -2  0  1  1/2]
[ 0  0  1  3  7/2]
[ 0  0  0  0   0 ]
```
Thus the nonzero rows of R give a basis for row(A), and columns 1 and 3 of A (i.e., the columns of R with leading 1's) give a basis for col(A). The vector form of the solution of Ax = x is
```    [x]    [ 2]    [-1]    [-1/2]
[y]    [ 1]    [ 0]    [  0 ]
x = [z] = y[ 0] + w[-3] + u[-7/2]
[w]    [ 0]    [ 1]    [  0 ]
[u]    [ 0]    [ 0]    [  1 ]
```
so
```[-2]  [-1]  [-1/2]
[ 1]  [ 0]  [  0 ]
[ 0], [-3], [-7/2]
[ 0]  [ 1]  [  0 ]
[ 0]  [ 0]  [  1 ]
```
form a basis for null(A).

(28) Let A be the matrix whose columns are the given vectors, in the given order. When you row reduce A to get a row echelon matrix R, you see that the leading 1's are in columns 1, 2 and 3. Thus columns 1, 2 and 3 of A give a basis for col(A), which is just the span of the given vectors.

(34) The columns of a matrix A by definition span col(A). So if the columns of A are linearly independent, then they are a linearly independent spanning set for col(A), hence, by definition, a basis for col(A).

(40) A 4x2 matrix A has 4 row vectors in R2, so by Theorem 2.8, p. 99, these 4 row vectors must be linearly dependent.

(42) A 4x2 matrix A could row reduce to have either 0, 1 or 2 leading 1's. It's easy to write down row echelon matrices for each possibility. Thus the number of free variables for the corresponding homogeneous system of linear equations has either 2, 1 or 0 free variables, respectively. Thus null(A) is either 2, 1 or 0.

(44) Our matrix A is
```[ a  2 -1]
[ 3  3 -2]
[-2 -1  a]
```
It row reduces to
```[ 1  2       a-2]
[ 0  3      3a-4]
[ 0  2a-2 (a-1)2]
```
If a=1, this is:
```[ 1  2 -1]
[ 0  3 -1]
[ 0  0  0]
```
which has rank 2. If a is not 1, we can divide the bottom row by a-1 and continue row reducing, to get:
```[ 1  0  -a + 2/3]
[ 0  1   a - 4/3]
[ 0  0   3a - 5 ]
```
This has rank 2 if a = 5/3, and rank 3 if a is not 5/3.

(48) The vectors do not form a basis since they are not linearly independent, as we can see by adding them up. The sum of the four vectors is the 0 vector. You can also make a matrix having the given vectors as columns. When you row reduce you find that there is a free variable, which again shows that the vectors are not linearly independent.

(50) Let u be the first vector in B, and let v be the second vector. The coordinate vector for w is [a b], where a and b give a solution to the 2x2 system w = au + bv. Solving the system shows a=7 and b=-4, so [7, -4] are the B-coordinates for w.

(58) (a) Prove that rank(AB) <= rank(A).
Proof: Let E be a product or elementary matrices such that EA=R is in reduced row echelon form, and the number of nonzero rows of R is just rank(A). Now consider EAB = RB. Each of the rows of R which is zero gives a zero row of RB. Thus the number of nonzero rows of RB (call this number r) is less than or equal to the number of nonzero rows of R (when we multiply by B a nonzero row of R could become a zero row in RB, so the number of zero rows could get bigger when we multiply by B, it just can't get smaller). I.e., r <= rank(A). Row reducing RB could make even more rows become zero rows, but if we leave the zero rows alone, it never makes a zero row nonzero, so rank(RB) <= r. Since AB and RB are row equivalent, we know rank(AB) = rank(RB). Putting it all together gives: rank(AB) = rank(RB) <= r <= rank(A), hence rank(AB) <= rank(A).
(b) Say A is a nonzero matrix (so rank(A) > 0) but B is the zero matrix (so AB is also the zero matrix, hence rank(AB) = 0). Then rank(AB) < rank(A).

3.6:

(4) By definition, using row vectors because they're easier to type than column vectors, T((x, y)) = (-y, x+2y, 3x-4y). Now consider T(c(a, b) + d(x,y)). It is, by definition, T(c(a, b) + d(x,y)) = T((ca+dx,cb+dy)) = (-(cb+dy),(ca+dx)+2(cb+dy),3(ca+dx)-4(cb+dy)). Using the usual rules or vector addition we can rewrite this as: (-(cb+dy),(ca+dx)+2(cb+dy),3(ca+dx)-4(cb+dy)) = (-(cb),(ca)+2(cb),3(ca)-4(cb))+(-(dy),(dx)+2(dy),3(dx)-4(dy)) = c(-(b),(a)+2(b),3(a)-4(b))+d(-(y),(x)+2(y),3(x)-4(y)) = cT((a, b)) + dT((x, y)). This shows that T is linear.

(10) To see that T is not linear notice that T((0, 0)) = (1, -1). But T(2(0, 0)) = T((0, 0)) = (1, -1). Thus 2T((0, 0)) is not equal to T(2(0, 0)), so T is not linear.

(30)
```[ST] =
[ 2  -1]
[-1  -1]

but [S] =
[2  0]
[0 -1]

and [T] =
[1 -1]
[1  1], so

[S][T] =
[ 2  -2]
[-1  -1].

I.e., [ST] = [S][T].
```

4.2:

(10) Expand along the first column to get (I'll use t instead of theta because theta is hrad to get on the web): cos(t) (cos2(t) + sin2(t)) = cos(t).

(12) Expand along the first column to get -b(a*0-e*0) = 0.

(14) Expand along the second column and then along the top row to get:
```     |2  3 -1|
-(-1)|1  2  2| = (1)(2(-8)-3(-7)+(-1)(-3)) = 8.
|2  1 -3|
```
(26) Here det(A) = 0, since the top and bottom rows are linearly dependent.

(46) The matrix A is invertible if and only if det(A) is not zero. But det(A) here is: -k4 - k3 + 2k2. This factors as -k2(k+2)(k-1), so det(A) is nonzero (and hence A is invertible) if and only if k is not 0, -2 or 1.

(50) det(2A) = 2ndet(A) = 2n3.

(52) det(AAT) = det(A)det(AT) = det(A)det(A) = (det(A))2

(58)
```    | 5 -1|                 | 2  5|
|-1  3|   14            | 1 -1|   -7
x = _______ = ___ = 2,  y = _______ = ___ = -1
| 2 -1|    7            | 2 -1|    7
| 1  3|                 | 1  3|
```

4.1:

(4) By just multiplying Av, we see we get Av = 3v. Since v is a nonzero vector, this shows that v is an eigenvector of eigenvalue 3.

(6) Here Av = 0. Since v is a nonzero vector, it is an eigenvector of eigenvalue 0.

(12) We need to solve A - 2I = 0. By row reducing, we find that all solutions are multiples of v = (0, 1, 1), this v is an eignevector of eigenvalue 2.

4.3:

(6) (a) The characteristic polynomial is det(A-tI). By computing the determinant and factoring, we get: -(t+1)(t-3)(t+1).
(b) The eigenvalues are thus -1, -1, and 3 (so -1 has algebraic multiplicity 2, and 3 has algebraic multiplicity 1 and thus also geometric multiplicity 1).
(c) A basis for the eigenspace for 3 is given by any eigenvector with eigenvalue 3. We can get one either by solving A-3I = 0 or by inspection: (2,3,2). A basis for the eigenspace for -1 consists of either 1 or 2 vectors (since the algebraic multiplicity is 2). This time we must solve A-(-1)I = 0. The basis for the nullspace is the basis for our eigenspace. We get { (0,1,0), (1,0,-1) }.
(d) Part (c) showed that the geometric multiplicity of -1 is 2.

(10) The matrix A and also A-tI are upper triangular, so their determinants are given by multiplying the diagonal entries.
(a) Thus det(A-tI) = (2-t)(1-t)(3-t)(2-t).
(b) The eigenvalues are thus: 2, 1, 3, and 2. So 2 has algebraic multiplicity 2 and 1 and 3 have algebraic multiplicity 1 (and also geometric multiplicity 1).
(c) A basis for the t=1 eigenspace is given by (1, -1, 0, 0). A basis for the t=3 eigenspace is given by (3, 2, 1, 0). A basis for the t=2 eigenspace is given by {(1, 0, 0, 0), (0, 1, -1, 1)}.
(d) Part (c) shows that the geometric multiplicity of 2 is 2.

(18) Note that we can write x in terms of eigenvectors as x = v1 - v2 + 2v3. Thus Akx = Akv1 - Akv2 + 2Akv3 = (-1/3)kv1 - (1/3)kv2 + 2(1)kv3. As k gets large, the powers of -1/3 and of 1/3 go to 0, leaving 2(1)kv3 = 2v3.

4.4:

(2) The matrices A and B are
```[ 3 -1], [ 2 1].
[-5  7]  [-4 6]
```
By Theorem 4.22, p. 299, we see that A and P are not similar, since the eigenvalues for A are 2 and 8, but for B they are 4 and 4. (A useful fact is that the determinant of a square matrix is the product of the eigenvalues, while the trace, which is the sum of the entries on the diagonal, is the sum of the eigenvalues. You can use this to check your work when you find eigenvalues. For 2x2 matrices you can even often guess the eigenvalues. For example, the trace of A is 10 and its determinant is 16. Thus the eigenvalues must be 2 and 8.)

(6) The eigenvalues for the matrix
```[1 1 1]
[0 0 1]
[1 1 0]
```
are 2, 0 and -1. The corresponding eigenvectors are:
```[3]  [ 1]  [ 0]
[1], [-1], [ 1]
[2]  [ 0]  [-1]
```
(8) The matrix A is
```[5 2].
[2 5]
```
Since it is real and symmetric we know it is diagonalizable. The determinant is 21 and the trace is 10, so we can guess that the eigenvalues are 3 and 7. (We could also work it out by computing det(A-tI).) The corresponding eigenvectors are:
```[ 1]  [ 1]
[-1], [ 1]
```
Thus P and D are:
```[ 1 1], [ 3 0].
[-1 1]  [ 0 7]
```
(10) The matrix
```    [3 1 0]
A = [0 3 1]
[0 0 3]
```
has only one eigenvalue, 3, and rank(A-3I) = 2 so nullity(A-3I) = 1, hence dim E3 = 1. Thus Theorem 4.27 tells us that A is not diagonalizable, since the geometric multiplicity of 3 is 1 but the algebraic multiplicity is 3.

(20) Here we have
```    [2 1 2]
A = [2 1 2]
[2 1 2]
```
The eigenvalues are 0, 0 and 5 and the corresponding eigenvectors are:
```[ 1]  [ 1]  [1]
[ 0], [-2], [1].
[-1]  [ 0]  [1]
```
Thus P, D and P-1 are:
```[ 1  1  1]  [ 0  0  0]       [2  1  -3]
[ 0 -2  1], [ 0  0  0], (1/5)[1 -2   1].
[-1  0  1]  [ 0  0  5]       [2  1   2]
```
Now A8 = PD8P-1 is easy to work out. It turns out to be 57A.

5.1:

(10) Since v1.v2 = 0, v1.v3 = 0, and v2.v3 = 0, the vectors v1, v2, and v3 are orthogonal to each other. They are also nonzero, so they are linearly independent by Theorem 5.1, p. 366. Thus the matrix A = [v1 | v2 | v3 ] is a 3x3 matrix of rank 3. Thus A is invertible, so by Theorem 3.27, p. 204, the columns of A (i.e., the vectors v1, v2, and v3) give a basis of R3. We already checked that these basis vectors are orthogonal, so it is an orthogonal basis of R3. The coordinate vector of w with respect to this basis is just (2, -1/2, -1/2), since 2 = w.v1/v1.v1, -1/2 = w.v2/v2.v2, and -1/2 = w.v3/v3.v3.

(20) To check if the given matrix (call it A) is orthogonal, just check to see if each column is orthogonal to each of the other columns (they are), and if each column is a unit vector (they all are). Thus A is an orthogonal matrix, so A-1 = AT.

(26) If Q is an orthogonal matrix and if A is obtained from Q by rearranging the rows of Q, prove that A is an orthogonal matrix.

Proof: Since Q is orthogonal, we know QT is also (by Theorem 5.7, p. 373). But rearranging the rows of Q to get A is the same as rearranging the columns of QT to get AT. But a matrix is orthogonal if and only if its columns form an orthonormal set, and rearranging the columns doesn't change whether the columns form an orthonormal set. Thus if QT is orthogonal, then so is AT, hence (by Theorem 5.7) so is (AT)T = A.

(28) (a) Let A be an orthogonal 2x2 matrix. We know the first column, [a b]T, of A is a unit vector, since all of the columns of an orthogonal matrix are unit vectors. We also know the second column, [c d]T, is orthogonal to [a b]T, hence ac+bd = 0. If a is not 0, then we can solve to get [c d] = [-bd/a d] = (d/a)[-b a]. Since [c d] is also a unit vector, we see (a2 + b2) = [a b].[a b]= 1 = [c d].[c d] = (d/a)2[-b a].[-b a] = (d/a)2(b2 + a2), hence (d/a)2 = 1, so d/a is 1 or -1. Thus [c d] is [-b a] (if d/a = 1) or [b -a] (if d/a = -1), which is what we wanted to show. We still must consider the case that a = 0. In that case b is 1 or -1, hence from [a b].[c d] = 0, we get d = 0, so c = 1 or -1; i.e., d = a and c is either b or -b, so [c d] is either [b -a] or [-b a], as we wanted to show.
(b) Since [a b]T is a unit vector, the point (a, b) in the plane is on the unit circle, so (a, b) = (cos(x), sin(x)) for some angle x between 0 and 2pi. By (a), [c d] is either [-sin(x) cos(x)] or [sin(x) -cos(x)].
(c) The case that [c d] = [-sin(x) cos(x)] is the case that A defines a rotation (see p. 215). The matrix A defines a reflection TA : R2 -> R2 if there is a vector v such that TA(v) = v, and a vector u orthogonal to v such that TA(u) = -u. (In this case, TA is just reflection across the line through the vector v.) To say this is the same as saying that 1 and -1 are eigenvalues of A with orthogonal eigenvectors v and u. Thus, if [c d] = [sin(x) -cos(x)] we must check that the eigenvalues of A are 1 and -1 and that the eigenvectors v and u are orthogonal. But if [c d] = [sin(x) -cos(x)], then the characteristic polynomial for A is (cos(x)-t)(-cos(x)-t)-(sin(x))(sin(x)), which simplifies to t2-cos2(x)-sin2(x) or t2-1. Thus the eigenvalues are 1 and -1, and by multiplying by A and simplifying we can check that [-sin(x) cos(x)-1] is an eigenvector of eigenvalue 1, and [sin(x) -cos(x)-1] is an eigenvector of eigenvalue -1. Since [-sin(x) cos(x)-1].[sin(x) -cos(x)-1] = 0, this shows that TA is a reflection.
(d) What we did above shows that if [c d] = [-b a], then TA is a rotation, while if [c d] = [b -a], then TA is a reflection.

5.2:

(2) The orthogonal complement Wperp to the set W of vectors (x,y) such that 3x+4y=0 is just the set of vectors (a,b) such that (a,b).(x,y)=0 whenever 3x+4y=0. But a vector (x,y) satisfies 3x+4y=0 if and only if (x,y)=c(-4,3) for some scalar c, so Wperp is just all (a,b) such that c(a,b).(-4,3)=0 for all scalars c; i.e., Wperp is the solution set of (a,b).(-4,3)=0. But this is just -4a+3b=0, whose solution set is all vectors c(3,4), where c is any scalar. Thus Wperp is the set of multiples of (3,4).

(12) To find a basis for the orthogonal complement of W (note: I will denote the orthogonal complement of W by Wperp, since the symbol used in the book isn't available to all web browsers), use the fact that if W is the span of a finite set of vectors, then Wperp = null(A), where A is the matrix whose rows are those vectors. Since we know how to get a basis for the nullspace of a matrix, we also know how to get a basis for Wperp. In this case A is
```[1 -1  3 -2]
[0  1 -2  1]
```
Row reducing and solving Ax = 0, and then writing the solution in vector form gives us a basis for null(A). We get: {[-1 2 1 0]T, [1 -1 0 1]T}.

(16) The orthogonal projection of v onto the subspace spanned by u1 and u2 is (since u1 and u2 are orthogonal): v.u1/(u1.u1) + v.u2/(u2.u2), which is just (2/3)u1 + (2/2)u2 = (5/3, -1/3, 2/3).

(22) First find a = projWv, then find b = v - a. The decomposition is v = a + b, since a is in W and b is in Wperp. We are given W as a span of two vectors, call them c and d, but these vectors are nonzero and orthogonal, so they comprise an orthogonal basis of W. Thus a = (v.c/c.c)c + (v.d/d.d)d = 2c + 3d. In this case, it turns out that a = v, so b = 0.

(26) Let {v1, ..., vn} be an orthogonal basis for Rn. Let W = span(v1, ..., vk). Then vk+1, ..., vn is an orthogonal basis for Wperp.
Proof: Since {vk+1, ..., vn} is an orthogonal set of nonzero vectors, it is a linearly independent set. We now just have to show it spans Wperp. First let's check that {vk+1, ..., vn} is a subset of Wperp. Since each of vk+1, ..., vn is orthogonal to each of v1, ..., vk (and hence to every linear combination of v1, ..., vk), we see that each of vk+1, ..., vn is orthogonal to every element in the span of v1, ..., vk; i.e., to every element of W. Thus each of vk+1, ..., vn is in Wperp. Now let u be any element of Wperp. Then u = (u.v1/v1.v1)v1 + ... + (u.vn/vn.vn)vn. But u.vi = 0 for 1 <= i <= k, so in fact this sum is u = (u.vk+1/vk+1.vk+1)vk+1 + ... + (u.vn/vn.vn)vn, hence u is in the span of vk+1, ..., vn. I.e., the set {vk+1, ..., vn} is a linearly independent subset of Wperp which spans Wperp. Thus it is a basis for Wperp, as claimed.

5.3:

(6) Here x1 = (2, -1, 1, 2) and x2 = (3, -1, 0, 4). We will call our orthogonal basis vectors u1 and u2. So Gram-Schmidt gives us u1 = x1 and u2 = x2 - (u1.x2/u1.u1)u1 = (1/2)(0, 1, -3, 2), but we can take u2 = (0, 1, -3, 2), if we prefer.

(8) First find the projection of v = (1, 4, 0, 2) into the subspace W spanned by x1 = (2, -1, 1, 2) and x2 = (3, -1, 0, 4). Using our orthogonal basis from problem (6), the projection is w = (v.u1/u1.u1)u1 + (v.u2/u2.u2)u2 = (1/35)(14, 13, -53, 54). Let p = v - w = (1/35)(21, 127, 53, 16). The the required decomposition is v = w + p.

(12) Find an orthogonal basis for R4 that contains a = (2, 1, 0, -1) and b = (1, 0, 3, 2): First we need to start with a spanning set for R4, so we take {a, b, (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)}. We start with a and b; since they're orthogonal, Gram-Schmidt will give them back to us. We add on the standard basis. The 6 vectors together span R4, since the standard basis vectors do by themselves. Now we apply Gram-Schmidt as in class to this set. We'll call the orthogonal basis vectors we get u1 through u4. As always, u1 is the first vector (since it is nonzero); i.e., u1 = a. Using the Gram-Schmidt method (plug in and see) gives u2 = b. (Whenever the second vector is orthogonal to the first, this is automatic.) Next, using the formula, we get u3 = (1/42)(11, -14, -9, 8), but we use u3 = (11, -14, -9, 8) instead, since (as discussed in class), it works just as well but has no fractions. Finally, u4 = (1/22)(0, 3, -2, 3), but we can take u4 = (0, 3, -2, 3) instead if we like.

As an alternative, find an orthogonal basis for span(a, b). (This is easy here, since a and b are already orthogonal.) Then find an orthogonal basis for null(A), where A is the matrix whose rows are a and b. Everything in null(A) is automatically orthogonal to a and b, so we just need to apply Gram-Schmidt to whatever basis we find for null(A).

5.4:

(6) The eigenvalues of the matrix are 2, 7 and -3. Note that the trace is 6, which agrees with the sum of the eigenvalues. Corresponding eigenvectors are [4 0 -3], [3 5 4], and [3 -5 4]. The results of section 5.4 tells us that these eigenvectors should be orthogonal, and a quick check shows that they are. The matrix Q is obtained by dividing each eigenvector by its length, and using it as a column of Q. The eigenvalues give the diagonal entries of D.

(8) The eigenvalues of the matrix are -1, -1 and 5. Note that the trace is 3, which agrees with the sum of the eigenvalues. Corresponding eigenvectors are [1 -1 0], [1 0 -1], and [1 1 1]. The first two eigenvectors need not be orthogonal to each other (and the ones I just gave are not), but by the results of section 5.4 both are orthogonal to the third. Before we can get Q, we need to find an orthogonal basis of E-1, which we can do with Gramn-Schmidt. I get [1 -1 0] and [1 1 -2]. Thus our orthogonal basis of eigenvectors is: [1 -1 0], [1 1 -2], [1 1 1]. Divide each one by its length; Q is then the matrix whose columns are these orthogonal unit vectors, and D is the diagonal matrix whose diagonal entries are -1, -1 and 5.

(14) If A is invertible, orthogonally diagonalizable and real, show that A-1 is too.
Proof: So we are assuming that QTAQ = D, where Q is an orthogonal matrix and D is diagonal. Thus QTA-1Q= Q-1A-1(Q-1)-1= (Q-1AQ)-1=(QTAQ)-1 = D-1, which shows that A-1 is orthogonally diagonalizable.

(24) We are given eigenvalues 0, -4 and -4, and corresponding eigenvectors [4 5 -1], [-1 1 1] and [2 -1 3]. Let D be the diagonal matrix whose diagonal entries are 0, -4 and -4. Divide each eigenvector by its length, and make a matrix Q whose columns are these unit vectors. Then Q is orthogonal, and A = QDQT is a real symmetric matrix with the given eigenvalues and eigenvectors.

6.1:

(36) The set W={a+bx+cx2: abc=0} is not a subspace of the vector space of all polynomials: 1+1x+0x2 and 0+0x+1x2 are in W but (1+1x+0x2)+(0+0x+1x2) = 1+1x+1x2 is not in W, so W is not closed under vector addition.

(54) The polynomial 1+1x+1x2 is not in the span of {1-2x, x-x2, -2+3x+x2}. We can see this by trying to solve a(1-2x) + b(x-x2) + c(-2+3x+x2) = 1+1x+1x2. Expanding the left hand side gives (a-2c) + (b-2a+3c)x + (c-b)x2 = 1+1x+1x2, hence a-2c = 1, b-2a+3c=1 and c-b=1. This system of equations is inconsistent. (Either use the usual method of writing the system in matrix form and row reducing, or notice that 1=b-2a+3c = -2(a-2c)-(c-b) = -2(1)-1 = -3.)

(56) The answer is: h(x) = cos(2x) is in Span(sin2(x), cos2(x)). Use the trig identity: cos(2x) = cos2(x) - sin2(x).

(62) The polynomials 1+1x+2x2, 2+1x+2x2 and -1+1x+2x2 do not span the vector space P2. Each of the polynomials 1+1x+2x2, 2+1x+2x2 and -1+1x+2x2 is in Span(1, x+2x2), but x is not in Span(1, x+2x2), hence x is in Span(1+1x+2x2, 2+1x+2x2, -1+1x+2x2), so Span(1+1x+2x2, 2+1x+2x2, -1+1x+2x2) cannot be all of P2. (To see that x is not in Span(1, x+2x2), say x = a(1) + b(x+2x2). Plug 0 in for x, to get 0 = a + b(0). This shows that a = 0. Now plug -1/2 in for x, to get -1/2 = 0(1) + b(0) = 0.)