1 00:00:07,025 --> 00:00:07,650 LINAN CHEN: Hi. 2 00:00:07,650 --> 00:00:09,790 Welcome back to recitation. 3 00:00:09,790 --> 00:00:12,960 In the lecture, you've learned eigenvalues and eigenvectors 4 00:00:12,960 --> 00:00:14,170 of a matrix. 5 00:00:14,170 --> 00:00:17,250 One of the many important applications of them 6 00:00:17,250 --> 00:00:20,720 is solving a higher-order linear differential equation 7 00:00:20,720 --> 00:00:22,760 with constant coefficients. 8 00:00:22,760 --> 00:00:27,340 A typical example is like what I've written on the board here. 9 00:00:27,340 --> 00:00:32,250 y is a function of t, and y and its derivatives 10 00:00:32,250 --> 00:00:34,510 satisfy this equation. 11 00:00:34,510 --> 00:00:38,830 As you can see, it involves y, y prime, and all the way 12 00:00:38,830 --> 00:00:41,370 to its third derivative. 13 00:00:41,370 --> 00:00:45,700 So our first goal is to solve this differential equation 14 00:00:45,700 --> 00:00:50,440 for its general solution using the method of matrix. 15 00:00:50,440 --> 00:00:52,830 So the very first thing that we should do 16 00:00:52,830 --> 00:00:56,640 is to find out which matrix we should be working with. 17 00:00:56,640 --> 00:01:01,380 So after that, we also want to say something about 18 00:01:01,380 --> 00:01:05,030 the explanation of this matrix A*t. 19 00:01:05,030 --> 00:01:08,570 We want to find out the first column of this matrix 20 00:01:08,570 --> 00:01:10,750 exponential. 21 00:01:10,750 --> 00:01:13,940 Why don't you hit the pause now, and try to write down 22 00:01:13,940 --> 00:01:16,420 this matrix A by yourself. 23 00:01:16,420 --> 00:01:19,270 But before you continue, make sure you come back 24 00:01:19,270 --> 00:01:21,370 to this video and check with me you've 25 00:01:21,370 --> 00:01:23,850 got the correct A. I'll see you in a while. 26 00:01:33,940 --> 00:01:37,950 OK, let's work together to transform this problem 27 00:01:37,950 --> 00:01:40,220 into linear algebra. 28 00:01:40,220 --> 00:01:48,770 The idea is to put y double prime, 29 00:01:48,770 --> 00:01:55,560 y prime, and y together as a vector. 30 00:01:55,560 --> 00:01:58,180 And let me call this vector u. 31 00:01:58,180 --> 00:02:07,420 So of course, vector u is also a function in t. 32 00:02:07,420 --> 00:02:09,720 So this is vector u. 33 00:02:09,720 --> 00:02:12,790 If this is u, what's going to be u prime? 34 00:02:12,790 --> 00:02:18,350 OK, u prime is going to be-- so I take derivative 35 00:02:18,350 --> 00:02:23,930 of every coordinate here that's going to be y triple prime, 36 00:02:23,930 --> 00:02:27,170 y double prime, and y prime. 37 00:02:27,170 --> 00:02:31,580 So this is our u prime t. 38 00:02:34,210 --> 00:02:40,670 And my goal is to write u prime as a matrix, 39 00:02:40,670 --> 00:02:46,710 call it A, times vector u itself. 40 00:02:46,710 --> 00:02:49,090 So I want to put a matrix here. 41 00:02:52,720 --> 00:02:56,660 And I want to create this matrix by incorporating 42 00:02:56,660 --> 00:02:59,170 this differential equation. 43 00:02:59,170 --> 00:03:02,590 If you move everything except y triple prime 44 00:03:02,590 --> 00:03:05,060 to the right-hand side of the equation, 45 00:03:05,060 --> 00:03:10,290 you can read y triple prime is equal to negative 2 times 46 00:03:10,290 --> 00:03:14,240 y double prime-- so y triple prime is negative 47 00:03:14,240 --> 00:03:19,960 2 times y double prime-- plus y prime-- that's 48 00:03:19,960 --> 00:03:24,550 plus 1 times y prime-- plus 2y. 49 00:03:24,550 --> 00:03:28,440 That's 2y, right? 50 00:03:28,440 --> 00:03:30,770 That gives you the first row. 51 00:03:30,770 --> 00:03:33,270 Then look at the second coordinate, 52 00:03:33,270 --> 00:03:34,970 this y double prime. 53 00:03:34,970 --> 00:03:37,470 y double prime is simply itself. 54 00:03:37,470 --> 00:03:43,260 So you read y double prime is equal to 1 y double prime, then 55 00:03:43,260 --> 00:03:45,650 0, 0. 56 00:03:45,650 --> 00:03:46,820 That's the second row. 57 00:03:46,820 --> 00:03:49,850 Well, same thing happens to the last row. 58 00:03:49,850 --> 00:03:52,390 y prime is again itself. 59 00:03:52,390 --> 00:03:58,660 So that's 0, 1, and 0. 60 00:03:58,660 --> 00:04:03,680 That is our matrix A. Did you get the right answer? 61 00:04:03,680 --> 00:04:07,160 So we have transformed this equation, 62 00:04:07,160 --> 00:04:11,770 this third-order ordinary differential equation of y 63 00:04:11,770 --> 00:04:16,540 into a first-order differential equation of u(t). 64 00:04:16,540 --> 00:04:19,480 Although u(t) is a vector, but if we 65 00:04:19,480 --> 00:04:22,000 can solve this equation for u, we 66 00:04:22,000 --> 00:04:25,380 have all the information we need for y. 67 00:04:25,380 --> 00:04:30,490 So let's plan on solving this equation. 68 00:04:30,490 --> 00:04:32,855 In order to solve this equation, we 69 00:04:32,855 --> 00:04:38,240 will need the eigenvalues and eigenvectors of this matrix A. 70 00:04:38,240 --> 00:04:40,930 Again, this is a good practice for you. 71 00:04:40,930 --> 00:04:43,220 Why don't you pause the video again, 72 00:04:43,220 --> 00:04:46,330 and try to complete this problem on your own. 73 00:04:46,330 --> 00:04:48,970 When you're ready, I'm going to come back and show you 74 00:04:48,970 --> 00:04:49,820 how I did it. 75 00:05:01,170 --> 00:05:03,520 Let's finish up everything together. 76 00:05:03,520 --> 00:05:07,540 So as we said, we need the eigenvalues and eigenvectors 77 00:05:07,540 --> 00:05:13,395 of matrix A, and that involves computing the determinant 78 00:05:13,395 --> 00:05:15,660 of the following matrix. 79 00:05:15,660 --> 00:05:20,540 So I want to compute the determinant of A minus lambda 80 00:05:20,540 --> 00:05:23,550 times the identity matrix I. 81 00:05:23,550 --> 00:05:25,180 Let's write it out. 82 00:05:25,180 --> 00:05:36,060 That's the determinant of -2 minus lambda, 1 2; 83 00:05:36,060 --> 00:05:42,540 1, negative lambda, 0; and 0, 1, negative lambda. 84 00:05:45,850 --> 00:05:50,290 So we need the determinant of this three by three matrix. 85 00:05:50,290 --> 00:05:52,220 Do it in your favorite way. 86 00:05:52,220 --> 00:05:55,570 You can either use the big summation formula, 87 00:05:55,570 --> 00:06:00,710 or you can do by cofactor along any row or any column. 88 00:06:00,710 --> 00:06:04,140 The correct answer should be this 89 00:06:04,140 --> 00:06:10,570 is equal to 1 minus lambda times 1 plus lambda 90 00:06:10,570 --> 00:06:11,900 times 2 plus lambda. 91 00:06:14,830 --> 00:06:21,790 And this polynomial has three roots: 1, -1, and -2. 92 00:06:21,790 --> 00:06:24,380 These are the eigenvalues we're looking for. 93 00:06:24,380 --> 00:06:26,240 So let me write it here. 94 00:06:26,240 --> 00:06:30,700 Lambda_1 is equal to 1. 95 00:06:30,700 --> 00:06:34,990 Lambda_2 is equal to -1. 96 00:06:34,990 --> 00:06:42,970 And lambda_3 is equal to -2. 97 00:06:42,970 --> 00:06:47,040 So now what we need is the eigenvector corresponding 98 00:06:47,040 --> 00:06:49,620 to each eigenvalue. 99 00:06:49,620 --> 00:06:52,820 Let's take lambda_1 for example. 100 00:06:52,820 --> 00:06:57,130 The eigenvector of A corresponding to lambda_1 is 101 00:06:57,130 --> 00:07:02,390 in the null space of the matrix A minus lambda_1*I, 102 00:07:02,390 --> 00:07:07,230 so in this case it's A minus I. So it's in the null space 103 00:07:07,230 --> 00:07:08,870 of this matrix. 104 00:07:08,870 --> 00:07:12,360 In other words, we are looking for a vector, 105 00:07:12,360 --> 00:07:18,600 let's call it [a, b, c], a column vector a, b, and c, such 106 00:07:18,600 --> 00:07:23,560 that this matrix multiplying [a, b, c] gives me 0. 107 00:07:23,560 --> 00:07:25,960 So if you write it out, that's going 108 00:07:25,960 --> 00:07:39,150 to be A minus I is [-3, 1, 2; 1, -1, 0; 0, 1, -1] 109 00:07:39,150 --> 00:07:44,175 times [a; b; c] is equal to 0. 110 00:07:46,960 --> 00:07:47,460 OK. 111 00:07:47,460 --> 00:07:50,340 Could we choose constants a, b, c 112 00:07:50,340 --> 00:07:53,360 such that this is always true? 113 00:07:53,360 --> 00:07:58,390 Well if you read the last row, so the last dot product, 114 00:07:58,390 --> 00:08:04,030 it says that b has to be equal to c. 115 00:08:04,030 --> 00:08:07,090 And if you read the second row it says 116 00:08:07,090 --> 00:08:09,690 that a has to be equal to b. 117 00:08:12,460 --> 00:08:16,750 Which means a is equal to b is equal to c. 118 00:08:16,750 --> 00:08:20,140 And if this relation is true, the first product 119 00:08:20,140 --> 00:08:23,170 is always going to be 0. 120 00:08:23,170 --> 00:08:26,770 So that simply means we can choose 121 00:08:26,770 --> 00:08:29,780 the first eigenvector, the eigenvector 122 00:08:29,780 --> 00:08:34,690 corresponding to lambda_1, to be x_1 is 123 00:08:34,690 --> 00:08:41,100 equal to [1, 1, 1] transpose. 124 00:08:41,100 --> 00:08:43,760 So we choose the first eigenvector 125 00:08:43,760 --> 00:08:50,290 to be the column vector with all the coordinates being 1. 126 00:08:50,290 --> 00:08:55,370 And you can do the same thing to lambda_2 and lambda_3. 127 00:08:55,370 --> 00:08:58,600 But please allow me to skip the computation here. 128 00:08:58,600 --> 00:09:00,900 I'm going to write out the answer for you. 129 00:09:00,900 --> 00:09:06,040 So x_2 the eigenvector corresponding 130 00:09:06,040 --> 00:09:08,340 to the second eigenvalue, is going 131 00:09:08,340 --> 00:09:13,630 to be equal to 1, -1, and 1. 132 00:09:13,630 --> 00:09:23,190 And x_3 is going to be 4, -2, and 1. 133 00:09:23,190 --> 00:09:26,030 Now we've got everything we need in order 134 00:09:26,030 --> 00:09:30,130 to create the general solutions for u(t) 135 00:09:30,130 --> 00:09:34,720 So we have eigenvalues, we have the corresponding eigenvectors. 136 00:09:34,720 --> 00:09:36,660 What should be u(t)? 137 00:09:36,660 --> 00:09:45,550 The general solution for u(t) is equal to some constant C_1 138 00:09:45,550 --> 00:09:49,280 times e to the power lambda_1*t-- so in this case, 139 00:09:49,280 --> 00:09:50,890 e to the power t. 140 00:09:50,890 --> 00:09:56,250 Then times the first eigenvector, x_1. 141 00:09:56,250 --> 00:10:01,160 Plus some other constant C_2 times e to the power 142 00:10:01,160 --> 00:10:02,140 lambda_2*t-- 143 00:10:02,140 --> 00:10:07,750 so e to the power negative t-- times x_2. 144 00:10:07,750 --> 00:10:09,840 That's the second eigenvector. 145 00:10:09,840 --> 00:10:16,870 Then plus some other constant, C_3 times e to the power 146 00:10:16,870 --> 00:10:22,190 lambda_3t-- so negative 2t-- times x_3. 147 00:10:22,190 --> 00:10:25,740 That gives you the general solution for u. 148 00:10:25,740 --> 00:10:29,080 As we just said, if you know what u is, 149 00:10:29,080 --> 00:10:33,030 you have all the information you need for y. 150 00:10:33,030 --> 00:10:36,340 Just in case you're curious about what y is, 151 00:10:36,340 --> 00:10:38,850 you can just read the last coordinate 152 00:10:38,850 --> 00:10:43,160 of x_1, x_2, and x_3. 153 00:10:43,160 --> 00:10:46,920 And you can see that all of them are 1. 154 00:10:46,920 --> 00:10:57,986 So y(t) is simply equal to C_1 e to the power lambda t plus C_2 155 00:10:57,986 --> 00:11:06,290 e to the power negative t plus C_3 e to the power negative 2t. 156 00:11:06,290 --> 00:11:12,300 And the choice of C_1, C_2, and C_3 is completely arbitrary. 157 00:11:12,300 --> 00:11:16,030 So that completes the first part of this question. 158 00:11:16,030 --> 00:11:19,490 In the second part, we want to say something about 159 00:11:19,490 --> 00:11:21,840 the exponential of A*t. 160 00:11:21,840 --> 00:11:25,180 So let me first give you the recipe to cook up 161 00:11:25,180 --> 00:11:28,680 the exponential of A*t. 162 00:11:28,680 --> 00:11:36,320 The exponential of A*t is equal to the product of three 163 00:11:36,320 --> 00:11:38,050 matrices. 164 00:11:38,050 --> 00:11:42,990 So you usually we denote them by S times e 165 00:11:42,990 --> 00:11:49,140 to the power capital lambda t times S inverse. 166 00:11:49,140 --> 00:11:53,320 And you may ask what S is, and what this matrix is. 167 00:11:53,320 --> 00:12:00,370 So S is the matrix that has x_1, x_2, and x_3 being its column 168 00:12:00,370 --> 00:12:01,560 vectors. 169 00:12:01,560 --> 00:12:09,270 So S is x_1, x_2, and x_3. 170 00:12:09,270 --> 00:12:11,600 Let me copy it down here. 171 00:12:11,600 --> 00:12:19,870 So that's 1, 1, 1; 1 -1, 1; 4, -2, 1. 172 00:12:22,460 --> 00:12:26,780 And the matrix in the middle, e to the power lambda*t is 173 00:12:26,780 --> 00:12:28,610 a diagonal matrix. 174 00:12:28,610 --> 00:12:34,060 So e to the power lambda*t, it's a diagonal matrix, 175 00:12:34,060 --> 00:12:39,300 and its diagonal entries are given by e to the power 176 00:12:39,300 --> 00:12:42,532 lambda_1*t-- so that's e to the power t-- 177 00:12:42,532 --> 00:12:45,770 then e to the power lambda_2*t-- negative t-- 178 00:12:45,770 --> 00:12:48,330 and e to the power lambda_3*t-- negative 2t. 179 00:12:51,490 --> 00:12:53,190 0 everywhere else. 180 00:12:53,190 --> 00:12:55,850 So that's e to the power lambda*t. 181 00:12:55,850 --> 00:12:58,860 Then the exponential of this At is 182 00:12:58,860 --> 00:13:02,490 given by the product of these three matrices. 183 00:13:02,490 --> 00:13:05,310 It looks a bit complicated because it involves 184 00:13:05,310 --> 00:13:09,010 the inverse of S. But luckily, we only 185 00:13:09,010 --> 00:13:12,400 want the first column of the result. 186 00:13:12,400 --> 00:13:22,710 So if we consider this product, we can see: 187 00:13:22,710 --> 00:13:25,370 the product of the first two matrices 188 00:13:25,370 --> 00:13:30,220 is relatively easy, because this is a diagonal matrix, 189 00:13:30,220 --> 00:13:33,730 and we know that S is given by these columns. 190 00:13:33,730 --> 00:13:36,510 So the result of the product of these two 191 00:13:36,510 --> 00:13:39,130 is simply multiplying the columns 192 00:13:39,130 --> 00:13:44,220 of S by these coefficients respectively. 193 00:13:44,220 --> 00:13:47,610 So you expect to get e to the power lambda_t 194 00:13:47,610 --> 00:13:52,230 x_1 times e to the power-- sorry. 195 00:13:52,230 --> 00:13:56,220 The second column should be e to the power negative t, x_2. 196 00:13:56,220 --> 00:13:59,556 The third column should be e to the power negative 2t, x_3. 197 00:14:02,870 --> 00:14:07,570 And here, what we should put is S inverse. 198 00:14:07,570 --> 00:14:10,680 But we don't need everything from S inverse, 199 00:14:10,680 --> 00:14:13,770 because as we just said, we only need 200 00:14:13,770 --> 00:14:17,660 the first column of this result. And the first column 201 00:14:17,660 --> 00:14:20,050 of this product is going to be given 202 00:14:20,050 --> 00:14:23,940 by linear combinations of these columns, 203 00:14:23,940 --> 00:14:27,790 and the coefficients are going to be given by the first column 204 00:14:27,790 --> 00:14:29,430 S inverse. 205 00:14:29,430 --> 00:14:32,720 So our goal should be just to get 206 00:14:32,720 --> 00:14:37,320 the first column of S inverse. 207 00:14:37,320 --> 00:14:40,290 Then what is the first column of S inverse? 208 00:14:40,290 --> 00:14:44,040 Well, the formula for S inverse is 209 00:14:44,040 --> 00:14:47,510 S inverse is going to be the reciprocal of the determinant 210 00:14:47,510 --> 00:14:50,770 of S, so 1 over determinant of S, 211 00:14:50,770 --> 00:14:57,130 times the transpose of a matrix C. This matrix C, 212 00:14:57,130 --> 00:15:02,680 the entries of this matrix C are given by cofactors of matrix S. 213 00:15:02,680 --> 00:15:05,660 And then you take transpose, you divide everything 214 00:15:05,660 --> 00:15:11,270 by the determinant of S. The result will be S inverse. 215 00:15:11,270 --> 00:15:15,700 And we only need the first column of this matrix. 216 00:15:15,700 --> 00:15:18,220 Let's try to write the first column out. 217 00:15:18,220 --> 00:15:20,930 Well again, do it in your favorite way 218 00:15:20,930 --> 00:15:25,830 to compute the determinant of S. The result should be 1 over 6. 219 00:15:25,830 --> 00:15:28,650 So the determinant of S is 6. 220 00:15:28,650 --> 00:15:32,080 Then what is the first column of C transpose? 221 00:15:32,080 --> 00:15:37,360 Well we can read it from here. 222 00:15:37,360 --> 00:15:40,600 This spot, the (1, 1) spot, should be 223 00:15:40,600 --> 00:15:44,560 the cofactor of this spot here. 224 00:15:44,560 --> 00:15:49,800 That negative 1 minus negative 2, which is 1, 225 00:15:49,800 --> 00:15:51,390 so we put 1 here. 226 00:15:55,230 --> 00:16:03,660 Now this spot will be the cofactor of this entry here. 227 00:16:03,660 --> 00:16:08,390 so that's 1 minus negative 2, that's 3. 228 00:16:08,390 --> 00:16:11,940 But this is (1, 2) entry, so you should put a negative sign 229 00:16:11,940 --> 00:16:12,700 in the front. 230 00:16:16,850 --> 00:16:22,590 Then the last spot should be the cofactor of this entry here, 231 00:16:22,590 --> 00:16:26,520 which is 1 minus negative 1, that's 2. 232 00:16:29,220 --> 00:16:30,360 Something else here. 233 00:16:34,240 --> 00:16:35,710 Two warnings. 234 00:16:35,710 --> 00:16:39,700 First, don't forget this transpose sign. 235 00:16:39,700 --> 00:16:44,430 Second, don't forget this negative sign. 236 00:16:44,430 --> 00:16:47,360 We've got the first column of S inverse, 237 00:16:47,360 --> 00:16:49,320 and that's all we need. 238 00:16:49,320 --> 00:16:50,720 So we put it here. 239 00:16:50,720 --> 00:16:57,780 That's 1 over 6, -1/2, and 1/3. 240 00:17:02,750 --> 00:17:04,210 That's good enough for me. 241 00:17:04,210 --> 00:17:08,700 Now I can read out the first column of exponential of A*t. 242 00:17:08,700 --> 00:17:13,050 So the first column of the exponential of A*t, 243 00:17:13,050 --> 00:17:16,060 I'm going to write it here. 244 00:17:16,060 --> 00:17:20,690 That's going to be equal to the linear combination 245 00:17:20,690 --> 00:17:21,990 of these columns. 246 00:17:21,990 --> 00:17:25,154 So that's 1/6 of the first column, 247 00:17:25,154 --> 00:17:30,580 that's e to the power t over 6 times x_1. 248 00:17:30,580 --> 00:17:37,700 Plus this times this, so that's going to be minus 1/2 of e 249 00:17:37,700 --> 00:17:42,040 to the power negative t times x_2. 250 00:17:42,040 --> 00:17:50,660 Then plus 1/3 of e to the power negative 2t times x_3. 251 00:17:50,660 --> 00:17:53,940 That's the first column of the exponential A*t. 252 00:17:53,940 --> 00:17:55,980 And then with the other two columns. 253 00:18:00,750 --> 00:18:02,520 That's the answer. 254 00:18:02,520 --> 00:18:07,740 If you want more practice, you can certainly complete this S 255 00:18:07,740 --> 00:18:11,720 inverse, and then you can also complete the exponential 256 00:18:11,720 --> 00:18:13,280 of A*t. 257 00:18:13,280 --> 00:18:16,360 But I will leave the rest to you. 258 00:18:16,360 --> 00:18:19,120 OK, I hope this example shows you 259 00:18:19,120 --> 00:18:23,160 that linear algebra can be a powerful tool in solving 260 00:18:23,160 --> 00:18:25,760 higher-order ordinary differential equations 261 00:18:25,760 --> 00:18:27,890 with constant coefficients. 262 00:18:27,890 --> 00:18:32,110 And we have demonstrated the standard procedure to do it, 263 00:18:32,110 --> 00:18:34,720 and we also practiced how to calculate 264 00:18:34,720 --> 00:18:37,140 the exponential of a matrix. 265 00:18:37,140 --> 00:18:40,140 Thanks for watching, and see you next time.