1 00:00:01,280 --> 00:00:02,440 GILBERT STRANG: OK. 2 00:00:02,440 --> 00:00:08,900 So today is a specific way to solve linear differential 3 00:00:08,900 --> 00:00:09,690 equations. 4 00:00:09,690 --> 00:00:12,970 I'll take second order equations as a good example. 5 00:00:12,970 --> 00:00:16,600 This way is called variation of parameters, 6 00:00:16,600 --> 00:00:22,970 and it will lead us to a formula for the answer, an integral. 7 00:00:22,970 --> 00:00:26,730 So that's the big step, to get from the differential equation 8 00:00:26,730 --> 00:00:30,070 to y of t equal a certain integral. 9 00:00:30,070 --> 00:00:32,310 That integral will involve the right hand 10 00:00:32,310 --> 00:00:34,440 side, of course, the source. 11 00:00:34,440 --> 00:00:37,320 And if we can do the integration, 12 00:00:37,320 --> 00:00:39,900 then we get a complete answer. 13 00:00:39,900 --> 00:00:43,900 But in any case, we get a nice form for the answer. 14 00:00:43,900 --> 00:00:45,130 OK. 15 00:00:45,130 --> 00:00:47,850 So what's the idea? 16 00:00:47,850 --> 00:00:51,260 So we're looking for a particular solution. 17 00:00:51,260 --> 00:00:53,810 Today is about a particular solution. 18 00:00:53,810 --> 00:00:59,140 We have to know two null solutions to get started. 19 00:00:59,140 --> 00:01:04,319 So we must know these, y1 and y2, null solutions, 20 00:01:04,319 --> 00:01:06,690 with f equals 0. 21 00:01:06,690 --> 00:01:09,870 And of course we do know two null solutions 22 00:01:09,870 --> 00:01:14,850 when those coefficients b and c are constants. 23 00:01:14,850 --> 00:01:19,050 And we'll do it as a good example, the most important 24 00:01:19,050 --> 00:01:20,570 example. 25 00:01:20,570 --> 00:01:24,170 But maybe sometimes we can find the null solutions 26 00:01:24,170 --> 00:01:28,890 when B and t are changing in time, time varying, 27 00:01:28,890 --> 00:01:31,740 and that's all to the good. 28 00:01:31,740 --> 00:01:34,500 Those problems are not easy to solve. 29 00:01:34,500 --> 00:01:37,340 But it's really constant coefficients 30 00:01:37,340 --> 00:01:39,250 that we know it works. 31 00:01:39,250 --> 00:01:39,750 OK. 32 00:01:39,750 --> 00:01:41,620 What's the idea? 33 00:01:41,620 --> 00:01:48,430 So the idea is to use y1 and y2, the null solutions. 34 00:01:48,430 --> 00:01:53,570 If we multiply by constants, we get another null solution 35 00:01:53,570 --> 00:01:55,230 by linearity. 36 00:01:55,230 --> 00:02:00,380 But the idea is to multiply them by functions. 37 00:02:00,380 --> 00:02:03,610 The varying, those constants are not constant, 38 00:02:03,610 --> 00:02:06,120 they are varying parameters. 39 00:02:06,120 --> 00:02:09,600 So this would be the form of the solution. 40 00:02:09,600 --> 00:02:14,820 And we want to find a c1 and a c2 depending on t, 41 00:02:14,820 --> 00:02:19,500 so that the differential equation above it is solved. 42 00:02:19,500 --> 00:02:22,560 So of course, I'm going to plug that into the differential 43 00:02:22,560 --> 00:02:27,550 equation and find out the conditions on c1 and c2. 44 00:02:27,550 --> 00:02:33,450 May I just jump to the result? 45 00:02:33,450 --> 00:02:36,090 This will satisfy that equation. 46 00:02:38,670 --> 00:02:41,920 We know that y1 and y2 satisfy it 47 00:02:41,920 --> 00:02:44,660 with a 0 on the right-hand side. 48 00:02:44,660 --> 00:02:48,500 So we just have to-- So it's c1 of t and c2 49 00:02:48,500 --> 00:02:53,510 of t that are going to deal with the f. 50 00:02:53,510 --> 00:02:59,400 So here is the result after putting it in there. 51 00:02:59,400 --> 00:03:06,600 I discover that c1 prime, the derivative of t, 52 00:03:06,600 --> 00:03:16,900 comes into it times y1 plus c2 prime times y2 equaling 0 53 00:03:16,900 --> 00:03:21,550 will give me one equation for c1 prime and c2 prime. 54 00:03:21,550 --> 00:03:25,570 The other equation for c1 prime times-- 55 00:03:25,570 --> 00:03:34,290 We'll multiply y1 prime plus c2 prime y2 prime. 56 00:03:34,290 --> 00:03:37,020 Of course, prime means the derivative. 57 00:03:37,020 --> 00:03:41,250 And that, when I'm plugging all this into the equation, 58 00:03:41,250 --> 00:03:44,620 I'm going to see an f of t on the right-hand side. 59 00:03:44,620 --> 00:03:49,050 I have two equations at each time. 60 00:03:49,050 --> 00:03:54,540 At each time instant I have two ordinary linear equations. 61 00:03:54,540 --> 00:03:59,110 They're straight lines in the c1, c2 plane. 62 00:03:59,110 --> 00:04:00,050 They intersect. 63 00:04:00,050 --> 00:04:03,040 We know how to solve-- The most basic problem 64 00:04:03,040 --> 00:04:07,140 of linear algebra, solve two equations and two unknowns. 65 00:04:07,140 --> 00:04:10,140 And we do that for each t, and we get an answer. 66 00:04:10,140 --> 00:04:16,589 So this leads us to c1 and c2 and they depend on t. 67 00:04:20,779 --> 00:04:22,740 Because-- Well, actually it leads us 68 00:04:22,740 --> 00:04:26,050 to c1 prime and c2 prime, the derivatives. 69 00:04:26,050 --> 00:04:30,970 It just happens that when we plug it in, the c1 and the c2 70 00:04:30,970 --> 00:04:36,630 themselves disappear because these were null solutions. 71 00:04:36,630 --> 00:04:40,570 So we know that c1 constant would be good, 72 00:04:40,570 --> 00:04:45,480 but when we put it in there, we get equations that 73 00:04:45,480 --> 00:04:48,160 involve c1 prime at each time. 74 00:04:48,160 --> 00:04:49,650 So I'll take that away. 75 00:04:49,650 --> 00:04:51,000 At each time. 76 00:04:51,000 --> 00:04:51,650 All right. 77 00:04:51,650 --> 00:04:55,020 Two equations, two unknowns, we solved it. 78 00:04:55,020 --> 00:04:57,150 OK. 79 00:04:57,150 --> 00:05:01,920 And then when we solve them, we put them back in to y of t 80 00:05:01,920 --> 00:05:04,310 and can now just write the answer. 81 00:05:04,310 --> 00:05:05,070 I'll just write. 82 00:05:05,070 --> 00:05:10,440 So I'm not doing all the gory calculations. 83 00:05:10,440 --> 00:05:12,440 I'm just going to write the answer. 84 00:05:12,440 --> 00:05:21,560 So y of t is going to be-- Just to be sure, I'm looking here. 85 00:05:21,560 --> 00:05:26,960 That's what I'm going to write, and I'm going to part c1 and c2 86 00:05:26,960 --> 00:05:32,060 into that-- c1 and c2 come from these two equations. 87 00:05:32,060 --> 00:05:33,170 OK. 88 00:05:33,170 --> 00:05:39,320 So I have a y1 of t times c1. 89 00:05:39,320 --> 00:05:43,910 Now, the c1 that comes out of that happens to be-- Well, 90 00:05:43,910 --> 00:05:47,790 c1 prime comes out of it, so I have to integrate. 91 00:05:47,790 --> 00:05:51,640 I have to integrate c1 prime. 92 00:05:51,640 --> 00:06:03,875 So c1 prime that comes out of that is a minus y2 times the f, 93 00:06:03,875 --> 00:06:07,540 dt, and then there is a denominator, 94 00:06:07,540 --> 00:06:10,360 because if I have two equations and two unknowns, 95 00:06:10,360 --> 00:06:12,990 there's a little 2 by 2 determinant. 96 00:06:12,990 --> 00:06:16,550 I'll just call it W. 97 00:06:16,550 --> 00:06:20,380 It has a famous name in differential equations. 98 00:06:20,380 --> 00:06:21,830 And I'll tell you that name. 99 00:06:21,830 --> 00:06:29,350 W of t is the determinant of what I have there, 100 00:06:29,350 --> 00:06:36,150 y1, y2, y1 prime, y2 prime. 101 00:06:36,150 --> 00:06:39,850 Two equations, they have to be independent. 102 00:06:39,850 --> 00:06:42,250 They have to be invertible to give me-- 103 00:06:42,250 --> 00:06:46,600 and it's this determinant that is the critical thing. 104 00:06:46,600 --> 00:06:53,640 So that's y1, y2 prime minus y2, y1 prime. 105 00:06:56,360 --> 00:06:58,090 That's the function. 106 00:06:58,090 --> 00:06:59,840 Remember we know y1 and y2. 107 00:06:59,840 --> 00:07:04,560 The whole deal is starting with y1 and y2, null solutions, 108 00:07:04,560 --> 00:07:06,730 and combining them. 109 00:07:06,730 --> 00:07:09,120 And you see there is a first. 110 00:07:09,120 --> 00:07:14,092 This is the c1 and now I have to add in the c2. 111 00:07:14,092 --> 00:07:18,310 It looks a little messy, but it's just an integral. 112 00:07:18,310 --> 00:07:19,820 It's just an integral. 113 00:07:19,820 --> 00:07:24,550 So now what is y2 of t multiplied by? 114 00:07:24,550 --> 00:07:29,010 Well, it's multiplied by c2, and since this equation gives me 115 00:07:29,010 --> 00:07:34,120 c2 prime, I'm going to have to integrate to get c2. 116 00:07:34,120 --> 00:07:40,540 And it turns out to be y1 of t, f of t, 117 00:07:40,540 --> 00:07:47,030 dt, divided by that same determinant W of t. 118 00:07:47,030 --> 00:07:50,930 This is-- Let me tell you its name. 119 00:07:50,930 --> 00:07:54,110 It's named after a guy named Wronski, 120 00:07:54,110 --> 00:07:55,640 so it's called the Wronskian. 121 00:08:02,090 --> 00:08:04,470 You can call it that or not. 122 00:08:04,470 --> 00:08:06,570 It's this. 123 00:08:06,570 --> 00:08:10,200 So we know y1 and y2. 124 00:08:10,200 --> 00:08:14,020 That means we've plugged those in, we find the Wronskian. 125 00:08:14,020 --> 00:08:16,140 We put that in these integrals. 126 00:08:16,140 --> 00:08:19,675 We have the y2s and the y1s and we're given the f 127 00:08:19,675 --> 00:08:21,170 and we integrate. 128 00:08:21,170 --> 00:08:23,180 Well, if we can integrate. 129 00:08:23,180 --> 00:08:26,780 I don't plan to go probably much beyond that. 130 00:08:26,780 --> 00:08:28,370 Just I'll stop there. 131 00:08:28,370 --> 00:08:31,700 That's a formula for the answer. 132 00:08:31,700 --> 00:08:34,070 Well, I won't completely stop there. 133 00:08:34,070 --> 00:08:36,600 Let me do an example. 134 00:08:36,600 --> 00:08:38,620 Let me do an example. 135 00:08:38,620 --> 00:08:42,309 So let's see. 136 00:08:42,309 --> 00:08:47,700 I guess my example will be a constant coefficient equation. 137 00:08:47,700 --> 00:08:51,310 So constant coefficient when-- What 138 00:08:51,310 --> 00:08:55,810 are the null solutions for a constant coefficient equation? 139 00:08:55,810 --> 00:08:58,710 You remember what happens with constant coefficients. 140 00:08:58,710 --> 00:09:00,010 You plug in. 141 00:09:00,010 --> 00:09:07,850 You get s squared plus Bs plus C times-- You're looking 142 00:09:07,850 --> 00:09:12,205 for-- you're trying for an exponential, and it'll work. 143 00:09:15,300 --> 00:09:21,270 So I plugged-- This is looking for null solutions, 144 00:09:21,270 --> 00:09:24,750 because we have to have those to start. 145 00:09:24,750 --> 00:09:27,980 They are the y1 and y2 in my formula. 146 00:09:27,980 --> 00:09:31,400 So my variation and parameters, the whole new thing, 147 00:09:31,400 --> 00:09:33,440 is completed there. 148 00:09:33,440 --> 00:09:37,420 Just if I want an example, I have to solve the differential 149 00:09:37,420 --> 00:09:40,250 equation, and for that, believe me, 150 00:09:40,250 --> 00:09:42,520 I'm going to make B and C constant. 151 00:09:42,520 --> 00:09:44,410 So I solve this equation. 152 00:09:44,410 --> 00:09:50,160 So this gives me-- Of course, I can cancel the e to the st, 153 00:09:50,160 --> 00:09:51,650 because it's never 0. 154 00:09:51,650 --> 00:09:54,000 So this has to be 0. 155 00:09:54,000 --> 00:09:57,570 And that has two roots, and the quadratic formula tells me 156 00:09:57,570 --> 00:10:00,410 those two roots s1 and s2. 157 00:10:00,410 --> 00:10:06,190 And then my null solutions are y1 is e to s1t 158 00:10:06,190 --> 00:10:11,465 and y2 is e to the s2t. 159 00:10:18,390 --> 00:10:20,460 Now, I'm ready to go. 160 00:10:20,460 --> 00:10:23,870 I'm going to put those into this formula. 161 00:10:23,870 --> 00:10:27,900 I have to do the Wronskian, and I need another blackboard. 162 00:10:27,900 --> 00:10:29,310 Sorry. 163 00:10:29,310 --> 00:10:35,130 This is the only video so far that went to a third board. 164 00:10:35,130 --> 00:10:37,390 Can you remember I need the Wronskian and then 165 00:10:37,390 --> 00:10:44,200 I'll reproduce the-- So there's-- Let me copy again. 166 00:10:44,200 --> 00:10:52,480 Y1 is e to the s1t y2 is e to the s2t. 167 00:10:52,480 --> 00:11:01,900 And now that Wronskian is y1, y2 prime minus y2, y1 prime. 168 00:11:01,900 --> 00:11:03,710 And what does that come out to be? 169 00:11:03,710 --> 00:11:05,430 y1 is e to the s1t. 170 00:11:11,350 --> 00:11:17,420 y2 prime is the derivative of that, so it's an s2, 171 00:11:17,420 --> 00:11:21,090 e to the s2t. 172 00:11:21,090 --> 00:11:24,590 That's this term gave me that. 173 00:11:24,590 --> 00:11:29,080 And now I subtract y2, which is there. 174 00:11:29,080 --> 00:11:32,630 y1 prime, which is the derivative of this, 175 00:11:32,630 --> 00:11:35,470 brings down an s1. 176 00:11:35,470 --> 00:11:38,740 You see the beauty of all these formulas. 177 00:11:38,740 --> 00:11:43,650 Well, beautiful if you like, formulas, not everybody does. 178 00:11:43,650 --> 00:11:44,230 OK. 179 00:11:44,230 --> 00:11:49,200 So now I know all the terms, and I'm 180 00:11:49,200 --> 00:11:54,010 prepared to write again my formula for y 181 00:11:54,010 --> 00:11:56,450 of t, my solution. 182 00:11:56,450 --> 00:11:59,410 This is the climax now. 183 00:11:59,410 --> 00:12:01,690 I'm going to use the formula that came 184 00:12:01,690 --> 00:12:04,360 from variation of parameters. 185 00:12:04,360 --> 00:12:09,450 And I'm going to put in that function, that function, 186 00:12:09,450 --> 00:12:12,990 and that W, and I'm going to see what I have. 187 00:12:12,990 --> 00:12:13,780 OK. 188 00:12:13,780 --> 00:12:20,736 So do you remember it was y1 times an integral. 189 00:12:20,736 --> 00:12:26,570 Oh, I had better use a variable of integration here. 190 00:12:26,570 --> 00:12:29,300 I don't want to put t in there, because t 191 00:12:29,300 --> 00:12:31,460 is the limit of integration. 192 00:12:31,460 --> 00:12:39,010 So y1, do you remember, it was a minus y2 e to s2-- 193 00:12:39,010 --> 00:12:44,590 I'll use just capital T-- time divided by W. 194 00:12:44,590 --> 00:12:49,770 Remember, there's an f of t and there's a dT, 195 00:12:49,770 --> 00:12:53,670 and I'm using a capital T as the dummy variable. 196 00:12:53,670 --> 00:13:03,040 And in the bottom goes W, which is s2 minus s1 e to the s1T, 197 00:13:03,040 --> 00:13:07,910 e to the s2T. 198 00:13:07,910 --> 00:13:10,110 That was the first term. 199 00:13:10,110 --> 00:13:15,640 This was the c1 that multiplied y1. 200 00:13:15,640 --> 00:13:21,840 Now, I have to remember the y2, the second null solution, 201 00:13:21,840 --> 00:13:23,230 times its c2. 202 00:13:23,230 --> 00:13:25,150 And that was the integral. 203 00:13:25,150 --> 00:13:29,350 And again, now I have a plus sign, I think, 204 00:13:29,350 --> 00:13:32,620 so it was-- put in parentheses there. 205 00:13:32,620 --> 00:13:35,460 That was the W on the bottom. 206 00:13:35,460 --> 00:13:45,830 So it was e to the s1T, f of T, dT, dT, and that same W 207 00:13:45,830 --> 00:13:54,880 down here, s2 minus s1, e to s1T, e to the s2T. 208 00:13:54,880 --> 00:13:57,420 OK. 209 00:13:57,420 --> 00:14:02,780 That's the variation of parameters formula 210 00:14:02,780 --> 00:14:06,980 for these nice null solutions. 211 00:14:06,980 --> 00:14:09,140 It doesn't get better than this. 212 00:14:09,140 --> 00:14:14,030 And in fact, I guess I can cancel e to the s2T there. 213 00:14:14,030 --> 00:14:17,580 I can cancel the e to the s1T there. 214 00:14:17,580 --> 00:14:22,190 I can put this up with a minus exponent. 215 00:14:22,190 --> 00:14:24,490 Oh yeah, it's going to be good. 216 00:14:24,490 --> 00:14:25,470 It's going to be good. 217 00:14:25,470 --> 00:14:30,900 So here is a constant s2 minus s1, the same for both terms. 218 00:14:30,900 --> 00:14:34,080 Then I'll put this up here as a negative exponent, 219 00:14:34,080 --> 00:14:37,890 so there's an e to the s1t, I'll get-- 220 00:14:37,890 --> 00:14:41,470 You might even see this coming. 221 00:14:41,470 --> 00:14:50,340 I get this 1 over s2 minus s1, and then I have the integral. 222 00:14:50,340 --> 00:14:53,040 And here I have an f of T in both integrals. 223 00:14:53,040 --> 00:14:58,480 Let me just put that f of T down. 224 00:14:58,480 --> 00:15:01,600 And I have a dT. 225 00:15:01,600 --> 00:15:04,190 And then what do I-- What else do I have? 226 00:15:04,190 --> 00:15:10,340 I have this thing which I can put inside but with a small t. 227 00:15:10,340 --> 00:15:12,640 I'm not integrating that. 228 00:15:12,640 --> 00:15:20,080 I think if you look there, you have e to the s1t, 229 00:15:20,080 --> 00:15:23,610 and then this will come up with a minus sign. 230 00:15:23,610 --> 00:15:28,470 Does that look good to you for the first term? 231 00:15:28,470 --> 00:15:32,420 And then the second term will have 232 00:15:32,420 --> 00:15:36,810 that same 1 over s2 minus s1. 233 00:15:36,810 --> 00:15:37,790 Now, what do I have? 234 00:15:40,350 --> 00:15:43,700 e to the s2T is going to come up with a minus sign, 235 00:15:43,700 --> 00:15:54,010 so I have an integral of e to the s2, t minus T. 236 00:15:54,010 --> 00:15:56,510 I think there's a minus. 237 00:15:56,510 --> 00:15:57,770 Haha. 238 00:15:57,770 --> 00:16:01,520 Don't forget that minus, Professor Strang. 239 00:16:01,520 --> 00:16:06,480 And f of T, dT. 240 00:16:06,480 --> 00:16:11,870 Now, right there I'm going to put the answer. 241 00:16:11,870 --> 00:16:14,110 I'm going to put the answer, and for me, this 242 00:16:14,110 --> 00:16:17,220 was the highlight of the whole thing. 243 00:16:17,220 --> 00:16:20,200 I didn't know what would come out of variation of parameters. 244 00:16:20,200 --> 00:16:23,790 I wasn't-- I'm not at all an expert in that. 245 00:16:23,790 --> 00:16:30,970 But I just followed the rules, put in these two 246 00:16:30,970 --> 00:16:35,350 null solutions, computed W, put it all in, 247 00:16:35,350 --> 00:16:39,250 ended up with this answer, and then I 248 00:16:39,250 --> 00:16:43,080 was very happy to recognize what this answer was. 249 00:16:43,080 --> 00:16:48,600 This answer is the integral of something times-- 250 00:16:48,600 --> 00:16:56,060 This is the integral from 0 to t of something times f of T, dT. 251 00:16:56,060 --> 00:16:58,530 And what is that something? 252 00:16:58,530 --> 00:17:04,010 It comes from that term divided by this with a minus sign, 253 00:17:04,010 --> 00:17:07,930 and this term divided by that with a minus sign, 254 00:17:07,930 --> 00:17:11,770 and when you put those in, what do you 255 00:17:11,770 --> 00:17:15,660 get but the impulse response. 256 00:17:15,660 --> 00:17:18,119 What I've called g of t. 257 00:17:18,119 --> 00:17:20,470 And it's that t minus T. 258 00:17:20,470 --> 00:17:21,940 So here you go. 259 00:17:21,940 --> 00:17:23,619 This is the big moment. 260 00:17:23,619 --> 00:17:31,220 g of t minus capital T, f of T, dT. 261 00:17:31,220 --> 00:17:36,140 Focus camera and attention on that last result. 262 00:17:36,140 --> 00:17:38,150 So that's the formula that we end up 263 00:17:38,150 --> 00:17:43,820 with from the variation of parameters 264 00:17:43,820 --> 00:17:46,970 applied to the constant coefficient problem. 265 00:17:46,970 --> 00:17:50,800 It's given us what we already knew. 266 00:17:50,800 --> 00:17:57,240 It's told us that the solution, the particular solution, y of t 267 00:17:57,240 --> 00:18:05,630 is the integral of the inputs, the right-hand side, 268 00:18:05,630 --> 00:18:13,520 the forcing term, f of T, times the growth term, the impulse 269 00:18:13,520 --> 00:18:14,710 response. 270 00:18:14,710 --> 00:18:18,450 We could imagine that at every time T, 271 00:18:18,450 --> 00:18:21,990 we have an impulse of size f of T. 272 00:18:21,990 --> 00:18:25,060 And that impulse grows by the impulse 273 00:18:25,060 --> 00:18:31,750 response, g, over the remaining time until it gets us to here. 274 00:18:31,750 --> 00:18:35,770 Let me just clean that up. 275 00:18:35,770 --> 00:18:40,630 And then we have to take all those inputs, 276 00:18:40,630 --> 00:18:45,940 so we integrate over all those inputs, and we get that answer. 277 00:18:45,940 --> 00:18:50,070 That's the ultimate formula for the solution 278 00:18:50,070 --> 00:18:53,240 to our differential equations, to 279 00:18:53,240 --> 00:18:56,730 our linear constant coefficient differential equation. 280 00:18:56,730 --> 00:19:00,940 So we've reproduced that formula in the one case, 281 00:19:00,940 --> 00:19:06,200 constant coefficient case, when we can find the null solutions 282 00:19:06,200 --> 00:19:11,450 and run this variation of parameters formula right 283 00:19:11,450 --> 00:19:15,090 through to the end, and that's the end. 284 00:19:15,090 --> 00:19:16,880 Thank you.