Math 317: Linear Algebra Homework 3 Solutions Fall 2015 The following problems are for additional practice and are not to be turned in: (All problems come from Linear Algebra: A Geometric Approach, 2nd Edition by ShifrinAdams.) Exercises: Section 2.1: 1–5, 7, 8, 14 Section 2.2: 1–7, 10, 11 Turn in the following problems. 1. Divide the interval [0, 1] into five equal subintervals, and apply the finite difference method in order to approximate the solution of the two-point boundary value problem y 00 (t) = 125t, y(0) = y(1) = 0, at the four interior grid points. Compare your approximate values at the grid points with the exact solution at the grid points. Note: You should not expect very accurate approximations with only four interior grid points. The exact solution is 125 3 (t − t). 6 Solution: Following the discussion from class, we start by subdividing the interval [0, 1] into five subintervals. Note that h = 1−0 = 51 Using the naming 5 convention that we introduced in class, we have t0 = 0, y0 = y(t0 ), t1 = 1/5, y1 = y(t1 ), t2 = 2/5, y2 = y(t2 ), t3 = 3/5, y3 = y(t3 ), t4 = 4/5, y4 = y(t4 ) and t5 = 1, y5 = y(t5 ). Notice that y0 = y(0) = 0 and y5 = y(1) = 0 from our boundary conditions and thus our unknowns are y1 , y2 , y3 and y4 . Using the following approximation from class (Note that h = 1/5) y 00 (t) ≈ y(t + h) − 2y(t) + y(t − h) = 125t =⇒ h2 y(t + h) − 2y(t) + y(t − h) = h2 ∗ 125t = 5t we obtain the following system of equations: y2 − 2y1 + y0 y3 − 2y2 + y1 y4 − 2y3 + y2 y5 − 2y4 + y3 = 5(1/5) = 5(2/5) = 5(3/5) = 5(4/5) , 1 Math 317: Linear Algebra Homework 3 Solutions Fall 2015 which in matrix form (recall that y0 = y5 = 0) is given by: −2 1 0 0 y1 1 1 −2 1 y2 2 0 = 0 1 −2 1 y3 3 0 0 1 −2 y4 4. To find the solution, we can perform Gaussian elimination to obtain: −2 1 0 0 1 −2 1 0 [A|b] = 0 1 −2 1 0 0 1 −2 1 1 0 0 1 2 → 0 0 3 4 0 0 0 0 1 0 0 0 0 1 −4 −7 −8 −6 Thus we have that y1 = −4 y2 = −7 y3 = −8 y4 = −6. Comparing to the exact solution, we find that y(1/5) = −4, y(2/5) = −7, y(3/5) = −8, y(4/5) = −6. 2. Divide [0, 1] into n + 1 equal subintervals and apply the finite difference approximation method to derive the linear system associated with the two-point boundary value problem y 00 (t) − y 0 (t) = f (t), y(0) = y(1) = 0. We proceed as in class and begin by first subdividing the interval [0, 1] into n + 1 b−a equal subintervals so that h = n+1 . To convert the differential equation to a linear system of equations, we use the following approximations for y 00 (t) and y 0 (t): 2 Math 317: Linear Algebra Homework 3 Solutions Fall 2015 y(t + h) − 2y(t) + y(t − h) h2 y(t + h) − y(t) y(t + h) − y(t − h) or y 0 (t) ≈ 2h h y 00 (t) ≈ Using the naming convention, yi = y(ti ) and fi = f (ti ) and the fact that ti = ti−1 + h we obtain yi+1 − 2yi + yi−1 h2 yi+1 − yi−1 yi+1 − yi y 0 (ti ) ≈ or , 2h h y 00 (ti ) ≈ which yields the following system of equations (by replacing y 00 (t) − y 0 (t) = f (t) with its approximation) with unknowns given by y1 , y2 , . . . , yn (y0 = yn+1 = 0): y0 − 2y1 + y2 − h2 (y2 − y0 ) y1 − 2y2 + y3 − h2 (y3 − y1 ) h = −2y1 + (1 − )y2 = h2 f1 2 h h = (1 − )y1 − y2 + (1 − )y1 = h2 f2 2 2 .. . h h = (1 − )yn−2 − yn−1 + (1 − )yn = h2 fn−1 2 2 h yn−1 − 2yn + yn+1 − h2 (yn−1 − yn+1 ) = (1 − )yn − 1 − yn = h2 fn . 2 yn−2 − 2yn−1 + yn − h2 (yn−2 − yn ) This yields the following matrix equation: y h2 f 1 1 −2 1 − h2 0 0 0 ... 0 2 h h y h f 1 − 2 −2 1 − 2 2 2 0 0 ... 0 . . h h 0 1 − 2 −2 1 − 2 0 ... 0 .. .. . .. .. .. .. .. .. . .. = ... . . . . . . . . . . .. .. .. ... ... .. .. .. . . . . . . . h h 0 0 0 . . . 1 − 2 −2 1 − 2 yn−1 h2 fn−1 0 0 0 0 . . . 1 − h2 −2 yn h2 fn 3. Section 2.1, Problem 6 3 Math 317: Linear Algebra Homework 3 Solutions Fall 2015 We wish to prove or give a suitable counterexample for the following claims for n×n matrices: (a) If AB = CB and B 6= 0, then A = C. 1 2 0 False. Consider the matrices A = ,B= 2 3 1 1 2 2 2 2 0 Then AC = = and CB = 2 3 2 3 3 0 but A 6= C. 0 0 2 2 2 2 and C = . 2 3 2 0 0 2 0 = 3 1 0 3 0 (b) If A2 = A, then A = 0 or A = I. 0 0 0 0 0 0 0 0 2 False. Let A = . Then A = AA = = = A but 0 1 0 1 0 1 0 1 A 6= 0 and A 6= I. (c) (A + B)(A − B) = A2 − B 2 False. In order for this statement to be true, we would need AB = BA, since (A + B)(A − B) = A2 − AB + BA − B 2 . However, in general matrix multiplication is not To see this,consider thematrices, communative. A= 1 2 −1 0 1 0 −1 −2 and B = . Then AB = but BA = . −3 1 1 0 4 0 1 2 (d) If AB = CB and B is nonsingular, then A = C. True. To prove this, we suppose that AC = BC and that B is nonsingular. Since B is nonsingular, we know that for any b ∈ Rn there is a unique x ∈ Rn such that Bx = b. Since this is true for any b ∈ Rn , if I let 1 0 b1 = (1, 0, 0, . . . , 0), then we know there is an x1 so that Bb = 0. Using .. . 0 the fact that AB = CB we have that 1 1 0 0 AB = CB =⇒ ABx1 = CBx1 =⇒ A 0 = C 0 . .. .. . . 0 0 4 Math 317: Linear Algebra Homework 3 Solutions Fall 2015 1 0 By definition of matrix multiplication, A 0 = first column of A, and .. . 0 1 0 C 0 = first column of C. So the first column of C is precisely the first .. . 0 column of A. To show that the ith column of A is equal to the ith column of C, we choose bi = (0, 0, . . . , 1, 0, . . . 0) where 1 is the ith position of bi . Then there is an xi such that Bxi = bi . Using the same procedure as above, we can show that the ith column of A is equal to the ith column of C. Since every column in A is the same as every column in C, it must be the case that A = C. (e) If AB = BC and B is nonsingular, then A = C. 1 2 This claim is false. Consider the following matrices: A = , B = 3 4 1 0 1 −2 and C = . Note that B is nonsingular, as it has rank 2 0 −1 −3 4 (it is in echelon form and has 2 nonzero rows). We also see that AB = BC, but A 6= C. 4. Section 2.1, Problem 10 We wish to show that if A and B are nonsingular n×n matrices, then the product AB is nonsingular. Proof : We show that AB is nonsingular by showing that ABx = 0 =⇒ x = 0. Suppose that ABx = 0. Then ABx = A(Bx) = 0 =⇒ Bx = 0 since A is nonsingular. Now B is also nonsingular, so Bx = 0 =⇒ x = 0. Thus, ABx = 0 =⇒ x = 0 and so AB is nonsingular. 5. Section 2.1, Problem 11 We prove the following statements: (a) If A is an m × n matrix and B is an n × m matrix such that BA = In , then if for some b ∈ Rm , Ax = b has a solution, then that solution is unique. 5 Math 317: Linear Algebra Homework 3 Solutions Fall 2015 Proof : To prove this, let us suppose that there are two such solutions to Ax = b, call them x1 and x2 . Then Ax1 = b and Ax2 = b. Multiplying both expressions by B, we obtain BAx1 = Bb =⇒ In x2 = Bb =⇒ x1 = Bb. Similarly, BAx2 = Bb =⇒ In x2 = Bb =⇒ x2 = Bb. So x1 = x2 and hence the solution is unique. (b) If A is an m × n matrix, are C is an n × m matrix such that AC = Im , then Ax = b is consistent for every b ∈ Rm . Proof: We claim that for every b ∈ Rm , x = Cb is a solution to Ax = b. We verify that this is indeed the case as follows: Ax = A(Cb) = (AC)b = Im b = b. (c) If A is an m × n matrix and B and C are n × m matrices such that BA = In and AC = Im , then B = C. Proof: Suppose that A is an m × n matrix and B and C are n × m matrices such that BA = In and AC = Im . Then B = BIm = B(AC) = (BA)C = In C = C. 6. (a) Suppose that A and B are two n × n upper triangular matrices. Prove that the product AB is upper triangular. Proof : Suppose that A and B are n × n upper triangular matrices. Then all entries of A and B below the diagonal are 0. That is, aij = 0 = bij if i > j. We we need to show is that the (i, j) entry of AB is equal to 0 as long as i > j. By definition, (i, j) entry of AB = (row i of A) · (column j of B) = [ai1 , ai2 , . . . , ain ] · [b1j , b2j , . . . , bnj ] = ai1 b1j + ai2 b2j + . . . + ain bnj . Assume that i > j. We show that the (i, j) entry of AB is 0. It would clearly suffice to show that either aik or bkj is 0 for all k. Consider two possibilities. k > j and k ≤ j. If k > j, then bkj represents an entry below the main diagonal of B. Therefore, bkj = 0 and so the summand aik bkj = 0. Now if k ≤ j, then since j < i, i > k. Therefore, aik represents an entry below the main diagonal of A, and aik = 0. Thus, aik bkj = 0. Since aik bkj = 0 for all k, we see that (i, j) entry of AB = ai1 b1j + ai2 b2j + . . . + ain bnj = 0, 6 Math 317: Linear Algebra Homework 3 Solutions Fall 2015 and so AB is upper triangular as required. (b) If A and B are two n × n upper triangular matrices, what are the diagonal entries of AB? When i = j, the only nonzero term in the product (row i of A)·(column j of B) is aii bii . (c) Is it true that the product of two n × n lower triangular matrices is again lower triangular? Justify your answer. Yes, you can just repeat the proof of (a) using the fact that i < j now instead of i > j. 7