1 00:00:01,399 --> 00:00:02,940 GILBERT STRANG: OK, this is the video 2 00:00:02,940 --> 00:00:06,350 about two neat functions-- the step function 3 00:00:06,350 --> 00:00:09,430 and its derivative the delta function. 4 00:00:09,430 --> 00:00:11,840 So if I can just introduce you to those functions 5 00:00:11,840 --> 00:00:15,130 and show you that they're very natural 6 00:00:15,130 --> 00:00:18,700 inputs to a differential equation. 7 00:00:18,700 --> 00:00:22,290 They happen all the time in real life. 8 00:00:22,290 --> 00:00:27,340 And so we need to understand how to compute these formulas 9 00:00:27,340 --> 00:00:28,830 and compute with them. 10 00:00:28,830 --> 00:00:33,650 OK, so the first one is the step function and it's-- I'll call 11 00:00:33,650 --> 00:00:38,600 it h after its inventor who was an engineer named Heaviside, 12 00:00:38,600 --> 00:00:41,940 started with an H. And the step function, 13 00:00:41,940 --> 00:00:43,790 let me write the formula. 14 00:00:43,790 --> 00:00:54,990 h of t is 0 for t negative and 1 for t greater or equal to 0. 15 00:00:54,990 --> 00:00:56,260 OK. 16 00:00:56,260 --> 00:00:58,200 So, that's the step function. 17 00:00:58,200 --> 00:01:01,450 It just has two values and it has a jump. 18 00:01:01,450 --> 00:01:03,740 You could say jump function also. 19 00:01:03,740 --> 00:01:06,050 Jump function, step function. 20 00:01:06,050 --> 00:01:06,840 All right. 21 00:01:06,840 --> 00:01:12,680 And notice I've also graphed the shifted step function. 22 00:01:12,680 --> 00:01:16,580 What happens to any function including this one 23 00:01:16,580 --> 00:01:23,670 if I change from t, which jumps at 0, to h of t minus t? 24 00:01:23,670 --> 00:01:33,400 If I put in t minus some fixed number t as the variable, then 25 00:01:33,400 --> 00:01:35,940 the jump happens. 26 00:01:35,940 --> 00:01:38,930 So the jump will happen when this is 0. 27 00:01:38,930 --> 00:01:41,210 Step functions jump when that's 0. 28 00:01:41,210 --> 00:01:44,500 And that's 0 at t equal to t. 29 00:01:44,500 --> 00:01:46,470 So the jump in dotted line. 30 00:01:46,470 --> 00:01:54,140 So the shifted step function will just shift over. 31 00:01:54,140 --> 00:01:57,360 That's the complete effect of changing from t 32 00:01:57,360 --> 00:02:01,260 to t minus a capital T, is just to shift the whole thing 33 00:02:01,260 --> 00:02:03,740 by capital T. OK. 34 00:02:03,740 --> 00:02:09,520 So you keep your eye on the standard step function, which 35 00:02:09,520 --> 00:02:11,455 jumps at t equals 0. 36 00:02:11,455 --> 00:02:13,750 It jumps by 1. 37 00:02:13,750 --> 00:02:16,120 And take its derivative. 38 00:02:16,120 --> 00:02:18,490 So what's the derivative of this step function? 39 00:02:18,490 --> 00:02:22,760 Well, the function is 0 along there, so the derivative is 0. 40 00:02:22,760 --> 00:02:25,390 The function is constant along here, 41 00:02:25,390 --> 00:02:27,640 so the derivative is again 0. 42 00:02:27,640 --> 00:02:31,470 It's just at this one point everything happens. 43 00:02:31,470 --> 00:02:34,700 So now this is the delta function. 44 00:02:34,700 --> 00:02:43,190 The delta function runs along at 0, continues at 0, 45 00:02:43,190 --> 00:02:49,440 but at t at 0, the whole thing explodes. 46 00:02:49,440 --> 00:02:52,590 The derivative is infinite. 47 00:02:52,590 --> 00:02:54,710 You see an infinite slope there. 48 00:02:54,710 --> 00:03:01,410 And the point is infinity is not a sufficiently precise word 49 00:03:01,410 --> 00:03:03,940 to tell you exactly what's happening. 50 00:03:03,940 --> 00:03:07,840 So we don't have really-- this graph of a delta function 51 00:03:07,840 --> 00:03:11,180 is not fully satisfactory. 52 00:03:11,180 --> 00:03:15,220 It's perfect for all the uninteresting boring part. 53 00:03:15,220 --> 00:03:19,310 But at the moment of truth, when something 54 00:03:19,310 --> 00:03:25,490 happens in an instant, we need to say more. 55 00:03:25,490 --> 00:03:28,500 We need to say more, not just its infinite. 56 00:03:28,500 --> 00:03:32,560 And again, if it's shifted, then the infinite slope 57 00:03:32,560 --> 00:03:37,310 happens at t equal a capital T. So the infinity 58 00:03:37,310 --> 00:03:39,230 is just shifted over. 59 00:03:39,230 --> 00:03:41,200 And that'd be the delta function there. 60 00:03:41,200 --> 00:03:43,410 So this is what I would use. 61 00:03:43,410 --> 00:03:47,160 If that was the source term in my differential equation, 62 00:03:47,160 --> 00:03:48,700 what would that mean? 63 00:03:48,700 --> 00:03:52,020 If this was the q of t in the differential 64 00:03:52,020 --> 00:03:58,870 equation reflecting input at different times, 65 00:03:58,870 --> 00:04:04,150 that function would say no input except at one moment and one 66 00:04:04,150 --> 00:04:08,890 instant, capital T. At that instant of time, 67 00:04:08,890 --> 00:04:12,050 you put 1 in, over in an instant. 68 00:04:12,050 --> 00:04:15,020 And remember, that otherwise q of t 69 00:04:15,020 --> 00:04:18,000 has been a continuous input. 70 00:04:18,000 --> 00:04:24,020 Put in $1.00 per year over the whole year. 71 00:04:24,020 --> 00:04:27,980 This one puts in $1.00 at one moment. 72 00:04:27,980 --> 00:04:30,880 But of course, you see that that's really what we do. 73 00:04:30,880 --> 00:04:35,070 So, you see that that's a function we need 74 00:04:35,070 --> 00:04:37,450 to do things in an instant. 75 00:04:37,450 --> 00:04:44,910 And as I took the example of a golf club hitting a golf ball, 76 00:04:44,910 --> 00:04:47,590 well, it's not quite 0 time. 77 00:04:47,590 --> 00:04:51,790 But it's so close to zero time that the two are connected. 78 00:04:51,790 --> 00:04:53,680 And then the ball takes off. 79 00:04:53,680 --> 00:04:57,300 And so a simple model, a workable model 80 00:04:57,300 --> 00:05:02,660 is to say it happens in 0 time with a delta function. 81 00:05:02,660 --> 00:05:07,230 So I really want to use delta functions. 82 00:05:07,230 --> 00:05:10,070 And they're not difficult to use. 83 00:05:10,070 --> 00:05:13,010 They're just not quite perfect for calculus 84 00:05:13,010 --> 00:05:18,530 because the derivative of the step function 85 00:05:18,530 --> 00:05:24,670 is not quite legitimate at the jump. 86 00:05:24,670 --> 00:05:25,590 OK. 87 00:05:25,590 --> 00:05:33,350 But what you can do, the part of calculus that works correctly 88 00:05:33,350 --> 00:05:34,990 is integration. 89 00:05:34,990 --> 00:05:38,360 Integration tends to make things smoother. 90 00:05:38,360 --> 00:05:42,210 The delta function-- sorry, the step function 91 00:05:42,210 --> 00:05:44,120 is the integral of the delta function. 92 00:05:44,120 --> 00:05:45,040 Right? 93 00:05:45,040 --> 00:05:47,020 We're going in the opposite direction. 94 00:05:47,020 --> 00:05:50,890 We take derivatives, we get craziness. 95 00:05:50,890 --> 00:05:54,420 If we take integrals to go from delta-- 96 00:05:54,420 --> 00:05:57,120 so the integral of the delta is the step function. 97 00:05:57,120 --> 00:05:59,820 And that's really how you know a delta function. 98 00:05:59,820 --> 00:06:03,860 That's the math way to describe more exactly 99 00:06:03,860 --> 00:06:08,540 than this arrow that just fires off what the delta function is 100 00:06:08,540 --> 00:06:09,250 doing. 101 00:06:09,250 --> 00:06:11,750 So the key property of the delta function 102 00:06:11,750 --> 00:06:13,920 is to know what it's integral is. 103 00:06:13,920 --> 00:06:19,520 The integral of the delta function 104 00:06:19,520 --> 00:06:22,910 is the total deposit over, let's say, 105 00:06:22,910 --> 00:06:27,090 it started-- time could have started even at minus infinity, 106 00:06:27,090 --> 00:06:30,560 and it could go on forever to plus infinity. 107 00:06:30,560 --> 00:06:33,900 So that's the total deposit, the total input 108 00:06:33,900 --> 00:06:37,330 coming from this source term delta of t. 109 00:06:37,330 --> 00:06:39,330 And what is the answer? 110 00:06:39,330 --> 00:06:45,080 Well, the integral of delta should be the step function. 111 00:06:45,080 --> 00:06:47,820 The step function out in infinity is 1. 112 00:06:47,820 --> 00:06:50,100 Back at minus infinity it's 0. 113 00:06:50,100 --> 00:06:51,850 Do you see what I'm saying here? 114 00:06:51,850 --> 00:06:58,300 This would be h of t evaluated between t equal minus 115 00:06:58,300 --> 00:07:02,270 infinity and plus infinity because those 116 00:07:02,270 --> 00:07:04,400 are the limits of integration. 117 00:07:04,400 --> 00:07:07,220 And what do I get? 118 00:07:07,220 --> 00:07:10,900 At plus infinity the step function is 1. 119 00:07:10,900 --> 00:07:12,440 This is 0. 120 00:07:12,440 --> 00:07:14,120 So I get 1. 121 00:07:14,120 --> 00:07:17,900 And everybody catches on to that key fact 122 00:07:17,900 --> 00:07:22,960 that the total integral of the delta function is 1. 123 00:07:22,960 --> 00:07:25,750 Again, you only made the deposit at one moment, 124 00:07:25,750 --> 00:07:29,560 but that deposit was a full dollar. 125 00:07:29,560 --> 00:07:35,880 And that, adding up all deposits is just that $1.00. 126 00:07:35,880 --> 00:07:41,330 So, that's the integral of the delta function. 127 00:07:41,330 --> 00:07:43,740 Now actually, to use delta functions I 128 00:07:43,740 --> 00:07:48,520 need to give you a slight generalization of that. 129 00:07:48,520 --> 00:07:52,640 So as I say, delta functions are really 130 00:07:52,640 --> 00:07:55,510 known-- we don't like to take their derivative. 131 00:07:55,510 --> 00:07:57,490 The derivative of a delta function 132 00:07:57,490 --> 00:08:00,515 is a truly crazy function. 133 00:08:00,515 --> 00:08:03,165 It shoots up to infinity and then 134 00:08:03,165 --> 00:08:04,920 it shoots down the minus infinity, 135 00:08:04,920 --> 00:08:07,650 the slope of that arrow. 136 00:08:07,650 --> 00:08:12,010 But it's integrals that we want. 137 00:08:12,010 --> 00:08:15,780 So now let me integrate from minus infinity 138 00:08:15,780 --> 00:08:19,370 to infinity my delta function times 139 00:08:19,370 --> 00:08:23,495 any other function, say f of t dt. 140 00:08:26,970 --> 00:08:29,670 That's something we'll need to be able to compute. 141 00:08:29,670 --> 00:08:32,840 What's the right integral for that? 142 00:08:32,840 --> 00:08:35,659 And again, delta is doing everything 143 00:08:35,659 --> 00:08:38,730 at one moment at t equals 0. 144 00:08:38,730 --> 00:08:42,750 At that moment t equals 0, at that moment when t is 0 145 00:08:42,750 --> 00:08:46,510 and that's the only place any action is happening, f of t 146 00:08:46,510 --> 00:08:48,230 is f of 0. 147 00:08:48,230 --> 00:08:52,910 It's whatever value it has at that point t equals 0. 148 00:08:52,910 --> 00:08:54,870 And that's the answer. 149 00:08:54,870 --> 00:08:58,250 f of 0. 150 00:08:58,250 --> 00:09:01,810 So if f of t was the constant function 1, 151 00:09:01,810 --> 00:09:04,770 then we're back to our integral up there. 152 00:09:04,770 --> 00:09:07,770 If that's just 1, I'm integrating delta of t. 153 00:09:07,770 --> 00:09:10,670 My function is 1, I get 1. 154 00:09:10,670 --> 00:09:16,990 But if that function is, suppose that function is sine t. 155 00:09:16,990 --> 00:09:21,820 What's the integral of delta of t times sine t dt? 156 00:09:21,820 --> 00:09:27,650 Well, sine t happens to disappear just at the moment 157 00:09:27,650 --> 00:09:32,460 when the delta function is ready to turn on at t equals 0. 158 00:09:32,460 --> 00:09:41,300 So the integral of delta of t sine t is sine of 0 is 0. 159 00:09:41,300 --> 00:09:47,440 You have one term turned on, but the other term turned off. 160 00:09:47,440 --> 00:09:49,990 So nothing happened altogether. 161 00:09:49,990 --> 00:09:53,240 Whereas the integral of delta t e to the t-- yeah, 162 00:09:53,240 --> 00:09:54,340 tell me that one. 163 00:09:54,340 --> 00:09:57,920 The integral of delta t e to the t dt 164 00:09:57,920 --> 00:10:00,930 is-- well e to the t is doing all sorts of stuff 165 00:10:00,930 --> 00:10:02,230 for all time. 166 00:10:02,230 --> 00:10:05,470 But the delta function is 0 all that time, 167 00:10:05,470 --> 00:10:07,390 except at t equals 0. 168 00:10:07,390 --> 00:10:10,960 So, the integral of delta t e to the t dt 169 00:10:10,960 --> 00:10:16,380 would be 1 because at that moment, t equals 0, 170 00:10:16,380 --> 00:10:23,080 the only important moment would be e to the t function 171 00:10:23,080 --> 00:10:25,360 is e to the 0, and it's just 1. 172 00:10:25,360 --> 00:10:28,210 Let me ask you for another example. 173 00:10:28,210 --> 00:10:32,200 The integral of minus infinity to infinity of delta-- 174 00:10:32,200 --> 00:10:38,930 let me use the shifted delta e to the t dt. 175 00:10:38,930 --> 00:10:41,430 Can you compute that integral. 176 00:10:41,430 --> 00:10:46,790 Well again, that function is 0 almost all the time. 177 00:10:46,790 --> 00:10:50,990 The only time that impulse, the moment that impulse hits is t 178 00:10:50,990 --> 00:10:54,560 equals capital T. At that moment, 179 00:10:54,560 --> 00:10:57,320 this is equal to e to the capital T. 180 00:10:57,320 --> 00:11:00,260 And that's all that matters. 181 00:11:00,260 --> 00:11:01,480 OK. 182 00:11:01,480 --> 00:11:09,290 So now, let me use a delta function as the source term 183 00:11:09,290 --> 00:11:11,690 in our differential equation. 184 00:11:11,690 --> 00:11:14,990 So we are seeing one last time one more-- 185 00:11:14,990 --> 00:11:18,200 I still call it a nice function, even 186 00:11:18,200 --> 00:11:21,710 though it's not legitimately a function at all, the delta. 187 00:11:21,710 --> 00:11:27,250 But let me solve the equation dy dt 188 00:11:27,250 --> 00:11:33,160 equals ay plus the delta function turned on 189 00:11:33,160 --> 00:11:38,095 at capital T. And let me start it from 0. 190 00:11:41,280 --> 00:11:44,810 So I don't make an initial deposit to my account. 191 00:11:44,810 --> 00:11:49,380 I don't make any deposit at all, except at one moment t equal 192 00:11:49,380 --> 00:11:54,180 capital T. And in that moment, I deposit $1.00 because delta-- 193 00:11:54,180 --> 00:11:55,490 this is the unit delta. 194 00:11:55,490 --> 00:11:59,610 If I was depositing $10, I would make it 10 delta. 195 00:11:59,610 --> 00:12:00,410 OK. 196 00:12:00,410 --> 00:12:07,290 So we know what the solution is from a deposit of $1.00 made 197 00:12:07,290 --> 00:12:11,980 at one time, t equal to capital T. What is the solution? 198 00:12:11,980 --> 00:12:23,405 y of t, we have 0 up to t equal to T. Nothing whatever 199 00:12:23,405 --> 00:12:25,530 has happened. 200 00:12:25,530 --> 00:12:32,540 And at capital T time t, in goes the $1.00 and it grows. 201 00:12:32,540 --> 00:12:38,120 It grows so that it grows over the remaining 202 00:12:38,120 --> 00:12:43,430 time e to the t minus capital T. This 203 00:12:43,430 --> 00:12:50,420 is for t larger than T. t larger than or equal I could say. 204 00:12:50,420 --> 00:12:54,060 When t and capital T are equal, that's e to the 0. 205 00:12:54,060 --> 00:12:58,470 That's our $1.00 just gone in. 206 00:12:58,470 --> 00:13:06,670 When t minus capital T is a year later, our dollar is worth e. 207 00:13:06,670 --> 00:13:11,120 When t minus capital T, when it's been in there for a year, 208 00:13:11,120 --> 00:13:15,050 that $1.00 has increased to-- well, 209 00:13:15,050 --> 00:13:18,880 that was if the interest rate was 100% you may feel. 210 00:13:18,880 --> 00:13:20,800 You'd be fortunate to get that. 211 00:13:20,800 --> 00:13:22,330 But let's suppose you do. 212 00:13:22,330 --> 00:13:27,520 At 100% interest, after one year, you 213 00:13:27,520 --> 00:13:30,270 might say, well, my money just doubled 214 00:13:30,270 --> 00:13:32,970 because I got the interest equaled the original. 215 00:13:32,970 --> 00:13:33,860 So I got twice it. 216 00:13:33,860 --> 00:13:38,610 But not true because that money went in-- was growing. 217 00:13:38,610 --> 00:13:41,180 Interest was being added, compounded 218 00:13:41,180 --> 00:13:44,970 through the whole year so that after one year, 219 00:13:44,970 --> 00:13:50,980 starting with 1, you have e at a is 100%. 220 00:13:50,980 --> 00:13:52,280 Oh, OK. 221 00:13:52,280 --> 00:13:57,630 My formula isn't incorrect here because I had an a here 222 00:13:57,630 --> 00:13:58,860 and it belongs here. 223 00:13:58,860 --> 00:14:00,940 So let me fix that. 224 00:14:00,940 --> 00:14:09,270 It's e to the a t minus T. That's the growth factor. 225 00:14:09,270 --> 00:14:11,780 That's the growth factor up to time t 226 00:14:11,780 --> 00:14:15,940 starting from the earlier time capital T. 227 00:14:15,940 --> 00:14:18,210 So you see that we were able just 228 00:14:18,210 --> 00:14:22,580 to write down the solution to the differential equation 229 00:14:22,580 --> 00:14:29,900 even though it's entirely new or different or non-standard 230 00:14:29,900 --> 00:14:31,620 input. 231 00:14:31,620 --> 00:14:36,780 The step function input-- so we're finding here 232 00:14:36,780 --> 00:14:39,440 the impulse response. 233 00:14:39,440 --> 00:14:41,800 That's a very, very important concept 234 00:14:41,800 --> 00:14:45,410 in engineering, the impulse response, 235 00:14:45,410 --> 00:14:48,020 the response to an impulse. 236 00:14:48,020 --> 00:14:51,420 And for second order differential equations, 237 00:14:51,420 --> 00:14:56,100 this is going to be-- it's really a crucial function 238 00:14:56,100 --> 00:14:58,300 in the subject. 239 00:14:58,300 --> 00:15:03,540 So this is the response to an impulse. 240 00:15:03,540 --> 00:15:08,140 It's the impulse response from our standard first order 241 00:15:08,140 --> 00:15:10,700 equation that we've been dealing with. 242 00:15:10,700 --> 00:15:14,020 Now we've got just to remember one more 243 00:15:14,020 --> 00:15:18,230 step is still linear would be to allow the interest 244 00:15:18,230 --> 00:15:19,780 rate to change. 245 00:15:19,780 --> 00:15:22,920 That's one lecture, the next one. 246 00:15:22,920 --> 00:15:26,220 And then we get non-linear equations. 247 00:15:26,220 --> 00:15:27,630 So that's what's coming. 248 00:15:27,630 --> 00:15:32,340 But here is delta functions for the first time and not 249 00:15:32,340 --> 00:15:34,250 for the last time. 250 00:15:34,250 --> 00:15:36,000 Thank you.