From the series: Differential Equations and Linear Algebra
Gilbert Strang, Massachusetts Institute of Technology (MIT)
A unit step function jumps from 0 to 1. Its slope is a delta function: zero everywhere except infinite at the jump.
OK, this is the video about two neat functions-- the step function and its derivative the delta function. So if I can just introduce you to those functions and show you that they're very natural inputs to a differential equation. They happen all the time in real life. And so we need to understand how to compute these formulas and compute with them.
OK, so the first one is the step function and it's-- I'll call it h after its inventor who was an engineer named Heaviside, started with an H. And the step function, let me write the formula. h of t is 0 for t negative and 1 for t greater or equal to 0. OK. So, that's the step function. It just has two values and it has a jump. You could say jump function also. Jump function, step function. All right.
And notice I've also graphed the shifted step function. What happens to any function including this one if I change from t, which jumps at 0, to h of t minus t? If I put in t minus some fixed number t as the variable, then the jump happens. So the jump will happen when this is 0. Step functions jump when that's 0. And that's 0 at t equal to t. So the jump in dotted line. So the shifted step function will just shift over. That's the complete effect of changing from t to t minus a capital T, is just to shift the whole thing by capital T. OK. So you keep your eye on the standard step function, which jumps at t equals 0. It jumps by 1. And take its derivative.
So what's the derivative of this step function? Well, the function is 0 along there, so the derivative is 0. The function is constant along here, so the derivative is again 0. It's just at this one point everything happens. So now this is the delta function. The delta function runs along at 0, continues at 0, but at t at 0, the whole thing explodes. The derivative is infinite. You see an infinite slope there. And the point is infinity is not a sufficiently precise word to tell you exactly what's happening.
So we don't have really-- this graph of a delta function is not fully satisfactory. It's perfect for all the uninteresting boring part. But at the moment of truth, when something happens in an instant, we need to say more. We need to say more, not just its infinite. And again, if it's shifted, then the infinite slope happens at t equal a capital T. So the infinity is just shifted over. And that'd be the delta function there. So this is what I would use.
If that was the source term in my differential equation, what would that mean? If this was the q of t in the differential equation reflecting input at different times, that function would say no input except at one moment and one instant, capital T. At that instant of time, you put 1 in, over in an instant. And remember, that otherwise q of t has been a continuous input. Put in $1.00 per year over the whole year. This one puts in $1.00 at one moment. But of course, you see that that's really what we do. So, you see that that's a function we need to do things in an instant.
And as I took the example of a golf club hitting a golf ball, well, it's not quite 0 time. But it's so close to zero time that the two are connected. And then the ball takes off. And so a simple model, a workable model is to say it happens in 0 time with a delta function. So I really want to use delta functions. And they're not difficult to use. They're just not quite perfect for calculus because the derivative of the step function is not quite legitimate at the jump.
OK. But what you can do, the part of calculus that works correctly is integration. Integration tends to make things smoother. The delta function-- sorry, the step function is the integral of the delta function. Right? We're going in the opposite direction. We take derivatives, we get craziness. If we take integrals to go from delta-- so the integral of the delta is the step function. And that's really how you know a delta function. That's the math way to describe more exactly than this arrow that just fires off what the delta function is doing.
So the key property of the delta function is to know what it's integral is. The integral of the delta function is the total deposit over, let's say, it started-- time could have started even at minus infinity, and it could go on forever to plus infinity. So that's the total deposit, the total input coming from this source term delta of t. And what is the answer? Well, the integral of delta should be the step function. The step function out in infinity is 1. Back at minus infinity it's 0. Do you see what I'm saying here?
This would be h of t evaluated between t equal minus infinity and plus infinity because those are the limits of integration. And what do I get? At plus infinity the step function is 1. This is 0. So I get 1. And everybody catches on to that key fact that the total integral of the delta function is 1. Again, you only made the deposit at one moment, but that deposit was a full dollar. And that, adding up all deposits is just that $1.00.
So, that's the integral of the delta function. Now actually, to use delta functions I need to give you a slight generalization of that. So as I say, delta functions are really known-- we don't like to take their derivative. The derivative of a delta function is a truly crazy function. It shoots up to infinity and then it shoots down the minus infinity, the slope of that arrow. But it's integrals that we want.
So now let me integrate from minus infinity to infinity my delta function times any other function, say f of t dt. That's something we'll need to be able to compute. What's the right integral for that? And again, delta is doing everything at one moment at t equals 0. At that moment t equals 0, at that moment when t is 0 and that's the only place any action is happening, f of t is f of 0. It's whatever value it has at that point t equals 0. And that's the answer. f of 0.
So if f of t was the constant function 1, then we're back to our integral up there. If that's just 1, I'm integrating delta of t. My function is 1, I get 1. But if that function is, suppose that function is sine t. What's the integral of delta of t times sine t dt? Well, sine t happens to disappear just at the moment when the delta function is ready to turn on at t equals 0. So the integral of delta of t sine t is sine of 0 is 0. You have one term turned on, but the other term turned off. So nothing happened altogether.
Whereas the integral of delta t e to the t-- yeah, tell me that one. The integral of delta t e to the t dt is-- well e to the t is doing all sorts of stuff for all time. But the delta function is 0 all that time, except at t equals 0. So, the integral of delta t e to the t dt would be 1 because at that moment, t equals 0, the only important moment would be e to the t function is e to the 0, and it's just 1.
Let me ask you for another example. The integral of minus infinity to infinity of delta-- let me use the shifted delta e to the t dt. Can you compute that integral. Well again, that function is 0 almost all the time. The only time that impulse, the moment that impulse hits is t equals capital T. At that moment, this is equal to e to the capital T. And that's all that matters. OK.
So now, let me use a delta function as the source term in our differential equation. So we are seeing one last time one more-- I still call it a nice function, even though it's not legitimately a function at all, the delta. But let me solve the equation dy dt equals ay plus the delta function turned on at capital T. And let me start it from 0. So I don't make an initial deposit to my account. I don't make any deposit at all, except at one moment t equal capital T. And in that moment, I deposit $1.00 because delta-- this is the unit delta. If I was depositing $10, I would make it 10 delta.
OK. So we know what the solution is from a deposit of $1.00 made at one time, t equal to capital T. What is the solution? y of t, we have 0 up to t equal to T. Nothing whatever has happened. And at capital T time t, in goes the $1.00 and it grows. It grows so that it grows over the remaining time e to the t minus capital T. This is for t larger than T. t larger than or equal I could say. When t and capital T are equal, that's e to the 0. That's our $1.00 just gone in.
When t minus capital T is a year later, our dollar is worth e. When t minus capital T, when it's been in there for a year, that $1.00 has increased to-- well, that was if the interest rate was 100% you may feel. You'd be fortunate to get that. But let's suppose you do. At 100% interest, after one year, you might say, well, my money just doubled because I got the interest equaled the original. So I got twice it. But not true because that money went in-- was growing. Interest was being added, compounded through the whole year so that after one year, starting with 1, you have e at a is 100%.
Oh, OK. My formula isn't incorrect here because I had an a here and it belongs here. So let me fix that. It's e to the a t minus T. That's the growth factor. That's the growth factor up to time t starting from the earlier time capital T. So you see that we were able just to write down the solution to the differential equation even though it's entirely new or different or non-standard input.
The step function input-- so we're finding here the impulse response. That's a very, very important concept in engineering, the impulse response, the response to an impulse. And for second order differential equations, this is going to be-- it's really a crucial function in the subject. So this is the response to an impulse. It's the impulse response from our standard first order equation that we've been dealing with.
Now we've got just to remember one more step is still linear would be to allow the interest rate to change. That's one lecture, the next one. And then we get non-linear equations. So that's what's coming. But here is delta functions for the first time and not for the last time. Thank you.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .Select web site
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.