1 00:00:00,500 --> 00:00:02,400 GILBERT STRANG: OK. 2 00:00:02,400 --> 00:00:05,300 So this is about the world's fastest way 3 00:00:05,300 --> 00:00:08,080 to solve differential equations. 4 00:00:08,080 --> 00:00:11,320 And you'll like that method. 5 00:00:11,320 --> 00:00:13,240 First we have to see what equations 6 00:00:13,240 --> 00:00:15,310 will we be able to solve. 7 00:00:15,310 --> 00:00:19,440 Well, linear, constant coefficients. 8 00:00:19,440 --> 00:00:22,510 I made all the coefficients 1, but no problem 9 00:00:22,510 --> 00:00:28,350 to change those to A, B, C. So the nice left-hand side. 10 00:00:28,350 --> 00:00:31,540 And on the right-hand side, we also need something nice. 11 00:00:31,540 --> 00:00:33,300 We want a nice function. 12 00:00:33,300 --> 00:00:38,220 And I'll tell you which are the nice functions. 13 00:00:38,220 --> 00:00:43,730 So I can say right away that e to the exponentials 14 00:00:43,730 --> 00:00:45,370 are nice functions, of course. 15 00:00:45,370 --> 00:00:47,960 They're are always at the center of this course. 16 00:00:47,960 --> 00:00:54,840 So for example, equal e to the st. 17 00:00:54,840 --> 00:00:57,290 That would be a nice function. 18 00:00:57,290 --> 00:00:58,410 OK. 19 00:00:58,410 --> 00:01:03,820 And the key is, we're looking for a particular solution, 20 00:01:03,820 --> 00:01:06,160 because we know how to find null solutions. 21 00:01:06,160 --> 00:01:09,940 We're looking for particular solution for this equation. 22 00:01:09,940 --> 00:01:12,470 One function, some function that solves 23 00:01:12,470 --> 00:01:17,130 this equation with right-hand side e to the st. 24 00:01:17,130 --> 00:01:23,330 And the point is, we know what to look for. 25 00:01:23,330 --> 00:01:25,950 We just have some coefficient to find. 26 00:01:25,950 --> 00:01:29,276 And we'll find that by substituting in the equation. 27 00:01:29,276 --> 00:01:30,650 Now, do you remember what we look 28 00:01:30,650 --> 00:01:33,700 for when the right-hand side is e to the st? 29 00:01:33,700 --> 00:01:43,640 Then look for y equals some constant times e to the st, 30 00:01:43,640 --> 00:01:44,560 right? 31 00:01:44,560 --> 00:01:49,240 When f of t-- maybe I'll put the equal sign down there. 32 00:01:49,240 --> 00:01:55,040 If f of t is e to the st, then I just look for a multiple of it. 33 00:01:55,040 --> 00:02:01,330 That's one coefficient to be determined by substitute this 34 00:02:01,330 --> 00:02:02,500 into the equation. 35 00:02:02,500 --> 00:02:04,170 Do you remember the results? 36 00:02:04,170 --> 00:02:07,040 So this is our best example. 37 00:02:07,040 --> 00:02:11,650 When I put this in the equation, I'll get the derivative 38 00:02:11,650 --> 00:02:12,980 brings an s. 39 00:02:12,980 --> 00:02:15,130 Second derivative brings another s. 40 00:02:15,130 --> 00:02:22,650 So I get s squared and an s and a 1 times y e to the st 41 00:02:22,650 --> 00:02:28,490 is equal to e to the st. We've done that before. 42 00:02:28,490 --> 00:02:33,830 Here we see it as a case with undetermined coefficient y. 43 00:02:33,830 --> 00:02:35,870 But by plugging it in, I've discovered 44 00:02:35,870 --> 00:02:40,160 that y is 1 over that. 45 00:02:40,160 --> 00:02:44,910 So that's a nice function then. e to the st is a nice function. 46 00:02:44,910 --> 00:02:48,400 What are the other nice functions? 47 00:02:48,400 --> 00:02:53,250 So now, let me move to the other board, next board, and ask, 48 00:02:53,250 --> 00:02:55,910 what other right-hand sides could we solve? 49 00:02:55,910 --> 00:03:01,570 So I'll keep this left-hand side equal to. 50 00:03:01,570 --> 00:03:03,265 So e to the st was 1. 51 00:03:06,140 --> 00:03:10,156 What about t? 52 00:03:10,156 --> 00:03:12,365 What about t? 53 00:03:12,365 --> 00:03:14,920 A polynomial. 54 00:03:14,920 --> 00:03:18,070 Well, that only has one term. 55 00:03:18,070 --> 00:03:23,210 So what would be a particular solution to that equation? 56 00:03:23,210 --> 00:03:30,210 So I really have to say, what is the-- try y particular 57 00:03:30,210 --> 00:03:35,530 equals-- now, if I see a t there, 58 00:03:35,530 --> 00:03:40,820 then I'm going to look for a t in y. 59 00:03:43,480 --> 00:03:45,180 And I'll also look for a constant. 60 00:03:45,180 --> 00:03:50,330 So a plus bt would be the correct form to look for. 61 00:03:50,330 --> 00:03:52,420 Let me just show you how that works. 62 00:03:52,420 --> 00:03:56,020 So this now has two undetermined coefficients. 63 00:03:56,020 --> 00:04:01,090 And we determine them by putting that into the equation 64 00:04:01,090 --> 00:04:03,530 and making it right. 65 00:04:03,530 --> 00:04:08,810 So try yp is a plus bt in this equation. 66 00:04:08,810 --> 00:04:13,250 OK, the second derivative of a plus bt is 0. 67 00:04:13,250 --> 00:04:17,370 The first derivative of that is b. 68 00:04:17,370 --> 00:04:19,529 So I get a b from that. 69 00:04:19,529 --> 00:04:23,900 And y itself is a plus bt. 70 00:04:23,900 --> 00:04:25,580 And that's supposed to give t. 71 00:04:28,110 --> 00:04:29,450 You see, I plugged it in. 72 00:04:29,450 --> 00:04:30,850 I got to this equation. 73 00:04:30,850 --> 00:04:38,160 Now I can determine a and b by matching t. 74 00:04:38,160 --> 00:04:40,750 So then b has to be 1. 75 00:04:40,750 --> 00:04:43,190 We get b equal to 1. 76 00:04:43,190 --> 00:04:44,960 So the t equals t. 77 00:04:44,960 --> 00:04:50,370 But if b is 1, I need a to b minus 1 to cancel that. 78 00:04:50,370 --> 00:04:53,570 So a is minus 1. 79 00:04:53,570 --> 00:04:59,725 And my answer is minus 1 plus 1t. 80 00:04:59,725 --> 00:05:02,350 t minus 1. 81 00:05:02,350 --> 00:05:06,010 And if I put that into the equation, it will be correct. 82 00:05:06,010 --> 00:05:08,750 So I have found a particular solution, 83 00:05:08,750 --> 00:05:11,290 and that's my goal, because I know 84 00:05:11,290 --> 00:05:13,370 how to find null solutions. 85 00:05:13,370 --> 00:05:16,780 And then together, that's the complete solution. 86 00:05:16,780 --> 00:05:21,120 So we've learned what to try with polynomials. 87 00:05:21,120 --> 00:05:24,720 With a power of t, we want to include 88 00:05:24,720 --> 00:05:28,760 that power and all lower powers, all the way down 89 00:05:28,760 --> 00:05:30,440 through the constants. 90 00:05:30,440 --> 00:05:32,090 OK. 91 00:05:32,090 --> 00:05:35,740 With exponentials, we just have to include the exponential. 92 00:05:35,740 --> 00:05:37,340 What next? 93 00:05:37,340 --> 00:05:39,640 How about sine t or cosine t? 94 00:05:39,640 --> 00:05:41,760 Say sine t. 95 00:05:41,760 --> 00:05:44,190 So that case works. 96 00:05:44,190 --> 00:05:49,280 Now we want to try y double prime plus y prime plus 97 00:05:49,280 --> 00:05:53,920 y equals, say, sine t. 98 00:05:53,920 --> 00:05:54,960 OK. 99 00:05:54,960 --> 00:05:56,530 What form do we assume for that? 100 00:05:59,170 --> 00:06:01,390 Well, I can tell you quickly. 101 00:06:01,390 --> 00:06:05,110 We assume a sine t in it. 102 00:06:05,110 --> 00:06:07,820 And we also need to assume a cosine t. 103 00:06:07,820 --> 00:06:15,080 The rule is that the things we try-- so I'll try y. 104 00:06:15,080 --> 00:06:18,010 y particular is what we're always finding. 105 00:06:18,010 --> 00:06:26,730 Some c1 cos t, and some c2 sine of t. 106 00:06:29,510 --> 00:06:30,680 That will do it. 107 00:06:30,680 --> 00:06:37,530 In fact, if I plug that in, and I match the two sides, 108 00:06:37,530 --> 00:06:41,180 I determine c1 and c2, I'm golden. 109 00:06:41,180 --> 00:06:43,070 Let me just comment on that, rather 110 00:06:43,070 --> 00:06:47,700 than doing out every step. 111 00:06:47,700 --> 00:06:51,200 Again, the steps are just substitute that in 112 00:06:51,200 --> 00:06:57,090 and make the equation correct by choosing a good c1 and c2. 113 00:06:57,090 --> 00:07:01,220 I just noticed that, you remember 114 00:07:01,220 --> 00:07:06,870 from Euler's great formula that the cosine is 115 00:07:06,870 --> 00:07:12,490 a combination of e to the it and e to the minus it. 116 00:07:12,490 --> 00:07:16,570 So in a way, we're really using the original example. 117 00:07:16,570 --> 00:07:22,230 We're using this example, e to the st, with two 118 00:07:22,230 --> 00:07:26,360 s's, e to the it, and e to the minus it. 119 00:07:26,360 --> 00:07:32,710 So we have two exponentials in a cosine. 120 00:07:32,710 --> 00:07:37,870 So I'm not surprised that there are two constants to find. 121 00:07:37,870 --> 00:07:41,820 And now, finally, I have to say, is this 122 00:07:41,820 --> 00:07:44,040 the end of nice functions? 123 00:07:44,040 --> 00:07:49,830 So nice functions include exponentials, polynomials. 124 00:07:49,830 --> 00:07:54,280 These are really exponentials, complex exponentials. 125 00:07:54,280 --> 00:07:58,780 And no, there's one more possibility 126 00:07:58,780 --> 00:08:01,930 that we can deal with in this simple way. 127 00:08:01,930 --> 00:08:05,470 And that possibility is a product 128 00:08:05,470 --> 00:08:12,810 of-- so now I'll show you what to do if it was t times sine t. 129 00:08:12,810 --> 00:08:18,210 Suppose we have the right-hand side, the f of t, 130 00:08:18,210 --> 00:08:21,590 the forcing term, is t times sine t. 131 00:08:21,590 --> 00:08:23,540 What is the form to assume? 132 00:08:23,540 --> 00:08:27,060 That's really all you have to know is what form to assume? 133 00:08:27,060 --> 00:08:27,900 OK. 134 00:08:27,900 --> 00:08:34,190 Now, that t-- so we have here a product, a polynomial times 135 00:08:34,190 --> 00:08:37,190 a sine or cosine or exponential. 136 00:08:37,190 --> 00:08:39,740 I could have done t e to the st there. 137 00:08:42,450 --> 00:08:46,720 But what do I have to do when the t shows up there? 138 00:08:46,720 --> 00:08:56,010 Then I have to try something more with that t in there. 139 00:08:56,010 --> 00:09:00,320 So now I have a product of polynomial times 140 00:09:00,320 --> 00:09:02,700 sine, cosine, or exponential. 141 00:09:02,700 --> 00:09:11,640 So what I try is at plus-- or rather, a plus bt. 142 00:09:11,640 --> 00:09:13,060 I try a product. 143 00:09:13,060 --> 00:09:27,040 Times cos t and c plus dt times sine t. 144 00:09:27,040 --> 00:09:30,840 That's about as bad a case as we're going to see. 145 00:09:30,840 --> 00:09:33,570 But it's still quite pleasant. 146 00:09:33,570 --> 00:09:34,810 So what do I see there? 147 00:09:34,810 --> 00:09:41,450 Because of the t here, I needed to assume polynomials up 148 00:09:41,450 --> 00:09:44,930 to that same degree 1. 149 00:09:44,930 --> 00:09:46,560 So a plus bt. 150 00:09:46,560 --> 00:09:49,310 Had to do that, just the way I did up there 151 00:09:49,310 --> 00:09:50,670 when there was a t. 152 00:09:50,670 --> 00:09:53,460 But now it multiplies sine t. 153 00:09:53,460 --> 00:09:57,190 So I have to allow sine t and also cosine t. 154 00:10:01,140 --> 00:10:05,160 The pattern is, really, we've sort of completed 155 00:10:05,160 --> 00:10:08,000 the list of nice functions. 156 00:10:08,000 --> 00:10:14,140 Exponentials, polynomials, and polynomial times exponential. 157 00:10:14,140 --> 00:10:16,130 That's really what a nice function is. 158 00:10:16,130 --> 00:10:18,660 A polynomial times an exponential. 159 00:10:18,660 --> 00:10:20,600 Or we could have a sum of those guys. 160 00:10:20,600 --> 00:10:25,330 We could have two or three polynomial times exponential, 161 00:10:25,330 --> 00:10:28,560 like there and another one. 162 00:10:28,560 --> 00:10:30,090 And that's still a nice function. 163 00:10:30,090 --> 00:10:33,460 And what's the real key to nice functions? 164 00:10:33,460 --> 00:10:39,850 The key point is, why is this such a good bunch of functions? 165 00:10:39,850 --> 00:10:43,690 Because, if I take its derivative, 166 00:10:43,690 --> 00:10:47,200 I get a function of the same form. 167 00:10:47,200 --> 00:10:49,860 If I take the derivative of that right-hand side, 168 00:10:49,860 --> 00:10:52,290 and I use the product rule, you see 169 00:10:52,290 --> 00:10:54,760 I'll get this times the derivative of that. 170 00:10:54,760 --> 00:10:58,750 So I'll have something looking with a sine in there. 171 00:10:58,750 --> 00:11:03,320 And I get this times the derivative 172 00:11:03,320 --> 00:11:05,970 of that, which is just a b. 173 00:11:05,970 --> 00:11:09,850 So again, it fits the same form, polynomial times cosine, 174 00:11:09,850 --> 00:11:11,770 polynomial times sine. 175 00:11:11,770 --> 00:11:14,950 So here I have a case where I have actually four 176 00:11:14,950 --> 00:11:16,220 coefficients. 177 00:11:16,220 --> 00:11:19,700 But they'll all fall out when you plug that 178 00:11:19,700 --> 00:11:22,640 into the equation. 179 00:11:22,640 --> 00:11:26,010 You just match terms and your golden. 180 00:11:26,010 --> 00:11:28,614 So it really is a straightforward method. 181 00:11:28,614 --> 00:11:29,280 Straightforward. 182 00:11:32,560 --> 00:11:36,100 So the key about nice functions is-- 183 00:11:36,100 --> 00:11:39,300 and they're nice for Laplace transforms, 184 00:11:39,300 --> 00:11:40,850 they're nice at every step. 185 00:11:40,850 --> 00:11:46,800 But it's the same good functions that we keep discovering 186 00:11:46,800 --> 00:11:48,680 as our best examples. 187 00:11:48,680 --> 00:11:54,210 The key about nice functions is that the-- that's 188 00:11:54,210 --> 00:11:57,770 a form of a nice function because its derivative has 189 00:11:57,770 --> 00:11:59,350 the same form. 190 00:11:59,350 --> 00:12:05,450 The derivative of that function fits that pattern again. 191 00:12:05,450 --> 00:12:07,280 And then the second derivative fits. 192 00:12:07,280 --> 00:12:08,600 All the derivatives fit. 193 00:12:08,600 --> 00:12:14,610 So when we put them in the equation, everything fits. 194 00:12:14,610 --> 00:12:18,510 And always in the last minute of a lecture, 195 00:12:18,510 --> 00:12:20,730 there's a special case. 196 00:12:20,730 --> 00:12:22,640 There's a special case. 197 00:12:22,640 --> 00:12:25,760 And let's remember what that is. 198 00:12:25,760 --> 00:12:31,960 So special case when we have to change the form. 199 00:12:31,960 --> 00:12:33,980 And why would we have to do that? 200 00:12:33,980 --> 00:12:42,580 Let me do y double prime minus y, say, is e to the t. 201 00:12:42,580 --> 00:12:45,250 What is special about that? 202 00:12:45,250 --> 00:12:49,200 What's special is that this right-hand side, 203 00:12:49,200 --> 00:12:52,905 this f function, solves this equation. 204 00:12:56,480 --> 00:12:59,040 If I try e to the t, it will fail. 205 00:12:59,040 --> 00:13:07,322 Try y equals some Y e to the t. 206 00:13:07,322 --> 00:13:09,500 Do you see how that's going to fail? 207 00:13:09,500 --> 00:13:14,330 If I put that into the equation, the second derivative 208 00:13:14,330 --> 00:13:17,870 will cancel the y and I'll have 0 on the left side. 209 00:13:17,870 --> 00:13:23,290 Failure, because that's the case called resonance. 210 00:13:23,290 --> 00:13:26,480 This is a case of resonance, when 211 00:13:26,480 --> 00:13:30,830 the form of the right-hand side is a null solution 212 00:13:30,830 --> 00:13:32,580 at the same time. 213 00:13:32,580 --> 00:13:36,410 It can't be a particular solution. 214 00:13:36,410 --> 00:13:39,350 It won't work because it's also a null solution. 215 00:13:39,350 --> 00:13:42,590 And do you remember how to escape resonance? 216 00:13:42,590 --> 00:13:44,570 How to deal with resonance? 217 00:13:44,570 --> 00:13:46,590 What happens with resonance? 218 00:13:46,590 --> 00:13:48,990 The solution is a little more complicated, 219 00:13:48,990 --> 00:13:50,670 but it fits everything here. 220 00:13:50,670 --> 00:13:53,930 We have to assume to allow a t. 221 00:13:53,930 --> 00:13:55,560 We have to allow a t. 222 00:13:55,560 --> 00:14:00,750 So instead of this multiple, the and in this thing, 223 00:14:00,750 --> 00:14:08,060 we have to allow-- so I'm going to assume-- I have 224 00:14:08,060 --> 00:14:10,370 to have-- I need a t in there. 225 00:14:10,370 --> 00:14:10,870 Oh, no. 226 00:14:10,870 --> 00:14:12,510 Actually, I don't. 227 00:14:12,510 --> 00:14:15,340 I just need a t. 228 00:14:15,340 --> 00:14:18,340 That would do it. 229 00:14:18,340 --> 00:14:22,210 When there's resonance, take the form 230 00:14:22,210 --> 00:14:27,060 you would normally assume and multiply 231 00:14:27,060 --> 00:14:29,750 by that extra factor t. 232 00:14:29,750 --> 00:14:34,730 Then, when I substitute that into the differential equation, 233 00:14:34,730 --> 00:14:37,050 I'll find Y's quite safely. 234 00:14:37,050 --> 00:14:38,910 I'll find Y entirely safely. 235 00:14:38,910 --> 00:14:39,790 So I do that. 236 00:14:39,790 --> 00:14:44,500 So that's the resonant case, the sort of special situation 237 00:14:44,500 --> 00:14:49,840 when e to the t solved this. 238 00:14:49,840 --> 00:14:51,960 So we need something new. 239 00:14:51,960 --> 00:14:55,420 And the way we get the right new thing is to have a t in there. 240 00:14:55,420 --> 00:14:59,830 So when I plug that in, I take the second derivative of that, 241 00:14:59,830 --> 00:15:03,490 subtract off that itself, match e to the t. 242 00:15:03,490 --> 00:15:07,710 And that will tell me the number Y. 243 00:15:07,710 --> 00:15:10,090 Perhaps it's 1/2 or 1. 244 00:15:10,090 --> 00:15:12,870 I won't do it. 245 00:15:12,870 --> 00:15:15,760 Maybe I'll leave that as an exercise. 246 00:15:15,760 --> 00:15:21,040 Put that into the equation and determine the number capital 247 00:15:21,040 --> 00:15:23,730 Y. OK. 248 00:15:23,730 --> 00:15:25,540 Let me pull it together. 249 00:15:25,540 --> 00:15:27,470 So we have certain nice functions, 250 00:15:27,470 --> 00:15:29,820 which we're going to see again, because they're nice. 251 00:15:29,820 --> 00:15:34,320 Every method works well for these functions. 252 00:15:34,320 --> 00:15:39,800 And these functions are exponentials, polynomials, 253 00:15:39,800 --> 00:15:42,640 or polynomials times exponentials. 254 00:15:42,640 --> 00:15:47,070 And within exponentials, I include sine and cosine. 255 00:15:47,070 --> 00:15:50,830 And for those functions, we know the form. 256 00:15:50,830 --> 00:15:53,220 We plug it into the equation. 257 00:15:53,220 --> 00:15:55,830 We make it match. 258 00:15:55,830 --> 00:15:58,260 We choose these undetermined coefficients. 259 00:15:58,260 --> 00:16:02,090 We determine them so that they solve the equation. 260 00:16:02,090 --> 00:16:05,620 And then we've got a particular solution. 261 00:16:05,620 --> 00:16:12,030 So this is the best equations to solve 262 00:16:12,030 --> 00:16:13,800 to find particular solutions. 263 00:16:13,800 --> 00:16:19,100 Just by knowing the right form and finding the constants, 264 00:16:19,100 --> 00:16:24,090 it did come out of the particular equation. 265 00:16:24,090 --> 00:16:24,860 OK. 266 00:16:24,860 --> 00:16:26,910 All good, thanks.