2. First-Order Equations

2. First-Order Equations

The following
content is provided under a Creative
Commons license. Your support will help MIT
OpenCourseWare continue to offer high quality
educational resources for free. To make a donation or to
view additional materials from hundreds of MIT courses,
visit MIT OpenCourseWare at ocw.mit.edu. PROFESSOR: Well,
OK, Professor Frey invited me to give the
two lectures this week on first order equations, like
that one, first order dy dt. And the lectures next week will
be on second order equation. So we’re looking for, you could
say, formulas for the solution. We’ll get as far as we
can with formulas, then numerical methods. Graphical methods take over
in more complicated problems. This is a model problem. It’s linear. I chose it to have
constant coefficient a, and let me check the units. Always good to see the
units in a problem. So let me think of this
y, as the money in a bank, or bank balance, so y as in
dollars, and t, time, in years. So we’re looking at the ups
and downs of bank balance y. The rate of change, so the
units then are dollars per year. So every term in the equation
has to have the right units. So y is in dollars,
so the interest rate a is percent per
year, say 6% a year. So a could be 6%– that’s
dimensionless– per year, or half a percent per
month if we change. So if we change
units, the constant a would change from 6 to a half. But let’s stay with 6. And then q of t represents
deposits and withdrawals, so that’s in dollars
per year again. Has to be. So that’s continuous. We think of the deposits
and the interest as being computed continuously
as time goes forward. So if that’s a constant– and
I’ll take that case first, q equal 1– that would
mean that we’re putting in, depositing $1 per year,
continuously through the year. So that’s the model that comes
from a differential equation. A difference equation would
give us finite time steps. So I’m looking for the solution. And with constant
coefficients, linear, we’re going to get a formula
for the solution. I could actually deal
with variable interest rate for this one
first order equation, but the formula becomes messy. But you can still do it. After that point, for a
second order equations like oscillation,
or for a system of several equations
coupled together, constant coefficients is
where you can get formulas. So let’s go with that case. So how to solve that equation? Let me take first of all, a
constant, constant source. So I think of q as
the source term. To get one nice formula, let me
take this example, ay plus 1, let’s say. How do you find y
of t to solve that? And you start with some
initial condition y of 0. That’s the opening deposit
that you make at time 0. How to solve that equation? Well, we’re looking
for a solution. And solutions to linear
equations have two parts. So the same will happen
in linear algebra. One part is a solution
to that equation, so we’re just looking
for one, any one, and we’ll call it a
particular solution. And the associated null
equation, dy dt equal ay. So this is an equation
with q equals 0. That’s why it’s called null. And it’s also
called homogeneous. So more textbooks use that
long word homogeneous, but I use the word null
because it’s shorter and because it’s the same
word in linear algebra. So let me call yn
the null solution, the general null solution. And y, I’m looking here for
a particular solution yp, and I’m going to– here’s
the key for linear equations. Let me take that off and
focus on those two equations. How does solving the null
equation, which is easy to do, help me? Why can I, as I plan
to do, add in yn to yp? I just add the two equations. Can I just add
those two equations? I get the derivative of yp
plus yn on the left side. And I have a times yp plus yn. And that is a critical moment
there when we use linearity. I had a yp a yn, and I
could put them together. If it was y squared, yp
squared and yn squared would not be the same
as yp plus yn squared. It’s the linearity that
comes, and then I add the 1. So what do I see from this? I see that yp plus yn
also solves my equation. So the whole family of
solutions is 1 yp plus any yn. And why do I say any yn? Because when I find
one, I find more. The solutions to
this equation are yn could be e to the at,
because the derivative of e to the at does bring
down a factor a. But you see, I’ve left space
for any multiple of e to the at. This is where that long
word homogeneous comes from. It’s homogeneous means I can
multiply by any constant, and I still solve the equation. And of course, the
key again is linear. So now I have– well, you could
say I’ve done half the job. I’ve found yn, the general yn. And now I just have
to find one yp, one solution to the equation. And with this source
term, a constant, there’s a nice way to
find that solution. Look for a constant solution. So certain right
hand sides, and those are the like the
special functions for the special source terms
for differential equation, certain right hand
sides– and I’m just going to go down a
list of them today. The next one on the
list– can I tell you what the next one
on the list will be? y prime equal ay. I use prime for–
well, I’ll write dy dt, but often I’ll write y prime. dy dt equal ay plus
an exponential. That’ll be number two. So I’m just preparing
the way for number two. Well, actually number
one, this example is the same as that exponential
example with exponent s equal 0, right? If s is 0, then I
have a constant. So this is a special
case of that one. This is the most
important source term in the whole subject. But here we go
with a constant 1. So we’ve got yn. And what’s yp? I just looked to see. Can I think of one? And with these
special functions, you can often find a
solution of the same form as the source term. And in this case,
that means a constant. So if yp is a constant,
this will be 0. So I just want to
pick the constant that makes this thing 0. And of course, their right hand
side is 0 when yp is minus 1 over a. So I’ve got it. We’ve solved that
equation, except we didn’t match the
initial condition yet. Let me if you take
that final step. So the general y is any
multiple, any null solution, plus any one particular
solution, that one. And we want to match it
to y of 0 at t equals 0. So I want to take that solution. I want to find that
constant, here. That’s the only remaining
step is find that constant. You’ve done it in the homework. So at t equals 0,
y of 0 is– at t equals 0, this is C. This
is the minus 1 over a. So I learn what the C has to be. And that’s the final step. C is bring the 1 over
a onto that side, so C will be y of 0 e to the
at minus 1 over a e to at. And here we had
a minus 1 over a. Well, it’ll be plus
1 over a e to the at. So now I’ve just put in the C,
y of 0 plus 1 over a. y of 0 plus 1 over a has gone
in for C. And now I have to subtract this 1 over a. Here, I see a 1 over a,
so I can do it neatly. Got a solution. We can check it, of course. At t equals 0, this
disappears, and this is y of 0. And it has the form. It’s a multiple of e to the
at and a particular solution. So that’s a good one. Notice that to get the
initial condition right, I couldn’t take C to be y of
0 to get the initial condition right. To get the initial
condition right, I had to get that, this
minus 1 over a in there. Good for that one? Let me move to the
next one, exponentials. So again, we know that the
null equation with no source has this solution e to the at. And I’m going to suppose
that the a in e to the at in the null solution
is different from the s in the source function,
which will come up in the particular solution. So you’re going to
see either the st in the particular
solution and an e to the at in the null solution. And in the case when s equals
a, that’s called resonance, the two exponents are the
same, and the formula changes a little. Let’s leave that case for later. How do I solve this? I’m looking for a
particular solution because I know the
null solutions. How am I going to get
a particular solution of this equation? Fundamental observation,
the key point is it’s going to be a
multiple of e to the st. If an exponential goes in, then
that will be an exponential. Its derivative will
be an exponential. I’ll have e to the
st’s everywhere. And I can get the number right. So I’m looking for y try. So I’ll put try, knowing it’s
going to work, as some number times e to the st.
So this would be like the exponential response. Response, do you know
that word response? So response is the solution. The input is q, and
the response is Y. And here, the input
is e to the st, and the response is a multiple
of e to the st. So plug it in. The timed derivative
will be Y. Taking the derivative will bring down
a 1. e to the st equals aY. A aY e to the st plus 1 e to
the st. Just what we hoped. The beauty of
exponentials is that when you take their derivatives,
you just have more exponential. That’s the key thing. That’s why exponential is
the most important function in this course, absolutely
the most important function. So it happened here. I can cancel e to the
st, because every term has one of them. So I’m seeing that–
what am I getting for Y? Getting a very important
number for Y. So I bring aY onto
this side with sY. On this side I just have a 1. Maybe it’s worth putting
on its own board. Y is, so Ys aY comes with a
minus, and the 1, 1 over– so Y was multiplied
by s minus a. That’s the right quantity to
get a particular solution. And that 1 over s
minus a, you see why I wanted s to
be different from a. I If s equaled a in that
case, in that possibility of resonance when the two
exponents are the same, we would have 1 over 0, and we’d
have to look somewhere else. The name for that– this has to
have a name because it shows up all the time. The exponential
response function, you could call it that. Most people would call
it the transfer function. So any constant coefficient
linear equation’s going to have a transfer
function, easy to find. Everything easy, that’s
what I’m emphasizing, here. Everything’s straightforward. That transfer function
tells you what multiplies the exponential. So the source was here. And the response is here, the
response factor, you could say, the transfer function. Multiply by 1 over s minus a. So if s is close to a,
if the input is almost at the same exponent as the
natural, as the null solution, then we’re going to
get a big response. So that’s good. For a constant coefficient
problem second order, other problems we can find
that response function. It’s the key function. It’s the function
if we have, or if we were to look at Laplace
transforms, that would be the key. When you take
Laplace transforms, the transfer function shows up. Then when you take inverse
Laplace transforms, you have to find what function
has that Laplace transform. So did we get the– we
got the final answer then. Let me put it here. y is e
to the st times this factor. So I divide by s minus a. A nice solution. Let me also anticipate
something more. An important case for e to
the st is e to the i omega t. e to the st, we think about
as exponential growth, exponential decay. But that’s for positive
s and negative s. And all important in
applications is oscillation. So coming, let me say,
coming is either late today or early Wednesday will
be s equal i omega, so where the source term
is e to the i omega t. And alternating, so this
is electrical engineers would meet it constantly from
alternating voltage source, alternating current source,
AC, with frequency omega, 60 cycles per
second, for example. Why don’t I just
deal with this now? Because it involves
complex numbers. And we’ve got to take a little
step back and prepare for that. But when we do it,
we’ll get not only e to the i omega t,
which I brought out, but also, it’s real part. You remember the great
formula with complex numbers, Euler’s formula,
that e to the i omega t is a combination of cosine
omega t, the real part, and then the imaginary
part is sine omega t. So this is looking
like a complex problem. But it actually solves two
real problems, cosine and sine. Cosine and sine will be on our
short list of great functions that we can deal with. But to deal with them neatly,
we need a little thought about complex numbers. So OK if I leave
e to the i omega t for the end of the list, here? So I’m ready for another
one, another source term. And I’m going to pick
the step function. So the next example is going to
be dy dt equals ay plus a step. Well, suppose I
put H of t there. Suppose I put H of t. And I ask you for the
solution to that guy. So that step function,
its graph is here. It’s 0 for negative time,
and it’s 1 for positive time. So we’ve already solved
that problem, right? Where did I solve this equation? This equation is
already on that board. Because why? Because H of t is
for t positive. That’s the only
place we’re looking. This whole problem, we’re
not looking at negative t. We’re only looking
at t from 0 forward. And what is H of
t from 0 forward? It’s 1. It’s a constant. So that problem, as it stands,
is identical to that problem. Same thing, we have a 1. No need to solve that again. The real example is when
this function jumps up at some later time T. Now I have
the function is H of t minus T. Do you see that, why the step
function that jumps at time T has that formula? Because for little
t before that time, in here, this is–
what’s the deal? If little t is
smaller than big T, then t minus T is
negative, right? If t is in here, then
t minus capital T is going to be a
negative number. And H of a negative number is 0. But for t greater than capital
T, this is a positive number. And H of a positive number is 1. Do you see how if you
want to shift a graph, if you want the graph
to shift, if you want to move the starting time,
then algebraically, the way you do it is to change t to
t minus the starting time. And that’s what I want to do. So physically, what’s
happening with this equation? So it starts with
y of 0 as before. Let’s think of a bank balance
and then other things, too. If it’s a bank balance, we put
in a certain amount, y of 0. We hope. And that grew. And then starting
at time, capital T, this switch turns on. Actually, physically,
step function is really often describing a
switch that’s turned on, now. This source term act
begins to act at that time. And it acts at 1. So at time capital T we start
putting money into our account. Or taking it out, of course. If this with a minus sign,
I’d be putting money in. Sorry, I would start with
some money in, y of 0. I would start with money in. Yeah, actually, tell
me what’s the solution to this equation that
starts from y of 0? What’s the solution up until
the switch is turned on? What’s the solution before
this switch happens, this solution while
this is still 0? So let’s put that part
of the answer down. This is for t smaller
than T. What’s the answer? This is all common sense. It’s coming fast, so I’m
asking these questions. And when I asked that question,
it’s a sort of indication that you can really
see the answer. You don’t need to go back
to the textbook for that. What have we got here? Yeah? AUDIENCE: Is it the null
solution [INAUDIBLE]? PROFESSOR: It’ll be this guy. Yeah, the particular
solution will be 0. Right, the particular solution
is 0 before this is on. I’m sorry, the
null solution is 0, and the particular solution,
well, the particular solution is a guy that starts right. I don’t know. Those names were not important. And then the question
is– so it’s just our initial deposit growing. Now, all I ask, what
about after time T? What about after time T? For t after time T, and
hopefully, equal time T, what do you think
y of t will be? Again, we want to
separate in our minds the stuff that’s starting
from the initial condition from the stuff that’s piling
up because of the source. So one part will be that guy. I haven’t given the
complete answer. But this is continuing to grow. And because it’s linear, we’re
always using this neat fact that our equation is linear. We can watch things
separately, and then just add them together. So I plan to add
this part, which comes from initial
condition to a part that– maybe we can guess it–
that’s coming from the source. And how do we have any
chance to guess it? Only because that particular
source, once it’s turned on, jumps to a constant
1, and we’ve solved the equation for a constant 1. Let me go back here. I think our answer
to this question– so this is like just first
practice with a step function, to get the hang of
a step function. So I’m seeing this same y of
0 e to the at in every case, because that’s what happens
to the initial deposit. I’ll say grow, assuming
the bank’s paying a positive interest rate. And now, where did
this term comes from? What did that term represent? AUDIENCE: The money
that [INAUDIBLE]. PROFESSOR: The money that, yeah? AUDIENCE: They had
each of [INAUDIBLE]. PROFESSOR: The money
that came in and grew. It came in, and then
it grew by itself, grew separately from
that these guys. So the initial condition
is growing along. And the money we put
in starts growing. Now, the point is what? That over here, it’s going
to look just like that. So I’m going to have a 1 over a. And I’m going to have
something like that. But can you just guess
what’s going to go in there? When I write it down,
it’ll make sense. So this term is representing
what we have at time little t, later on, from the
deposits we made, not the initial one, but
the source, the continuing deposits. And let me write it. It’s going to be a 1 over a
e to the a something minus 1. It’s going to look
just like that guy. When I say that guy, let
me point to it again– e to the at minus 1. But it’s not quite
e to the at minus 1. What is it? AUDIENCE: t minus [INAUDIBLE]. PROFESSOR: t minus
capital T, because it didn’t start until that time. So I’m going to leave that as,
like, reasonable, sensible. Think about a step function
that’s turned on a capital time T. Then it grows from that time. Of course, mentally, I
never write down a formula like that without
checking at t equal to T, because that’s the one important
point, at t equal capital T. What is this at
t equal capital T? It’s 0. At t equal capital T, this is
e to the 0, which is 1 minus 1 altogether 0. And is that the right answer? At t equal capital T is 0,
should I have nothing here? Yes? No? Give me a head shake. Should I have nothing
at t equal capital T? I’ve got nothing. e to the 0 minus
1, that’s nothing? Yes, yes that’s the right thing. Because at capital T, the
source has just turned on, hasn’t had time to
build up anything, just that was the
instant it turned on. So that’s a step function. A step function is a
little bit of a stretch from an ordinary
function, but not as much of a stretch as its derivative. In a way, this is like the
highlight for today, coming up, to deal with not only a step
function, but a delta function. I guess every author
and every teacher has to think am I going
to let this delta function into my course or into the book? And my answer is yes. You have to do it. You should do it. Delta functions are–
they’re not true functions. As we’ll see, no
true function can do what a delta function does. But it’s such an
intuitive, fantastic model of things happening over
a very, very short time. We just make that
short time into 0. So we’re saying with
the delta function, we’re going to say that
something can happen in 0 time. Something can happen in 0 time. It’s a model of, you know,
when a bat hits a ball. There’s a very short time. Or a golf club hits a golf ball. There’s a very
short time interval when they’re in contact. We’re modeling that by 0
time, but still, the ball gets an impulse. Normally, for 0 time, if you’re
doing things continuously, what you do over 0
time is no importance. But we’re not doing things
continuously, at all. So here we go. You’ve seen this guy, I think. But if you haven’t,
here’s the time to see it. So the delta function
is the derivative of– so I’ve written three
important functions up here. Let me start with
a continuous one. That function, the ramp
is 0, and then the ramp suddenly ramps up to t. Take its derivative. So the derivative, the
slope of the ramp function is certainly 0 there. And here, the slope is 1. So the slope jumped from 0 to 1. The slope of the ramp
function is the step function. Derivative of ramp equals step. Why don’t I write
those words down? Derivative of ramp equals step. So there is already
the step function. In pure calculus,
the step function has already got a
little question mark. Because at that point, the
derivative in a calculus course doesn’t exist,
strictly doesn’t exist, because we get a
different answer 0 on the left side from the
answer, 1 on the right side. We just go with that. I’m not going to
worry about what is its value at that point. It’s 0 up for t negative,
and it’s 1 for t positive. And often, I’ll take it
1 for t equals 0, also. Usually, I will. That’s the small problem. Now, the bigger problem is the
derivative of the– so this is now the derivative
of the step function. So what’s the derivative
of this step function? Well, the derivative along
there is certainly 0. The derivative along
here is certainly 0. But the derivative,
when that jumped, the derivative, the
slope was infinite. That line is vertical. Its slope is infinite. So at that one point, you have
an affinity, here, delta of 0. You could say delta
of 0 is infinite. But you haven’t
said much, there. Infinite is too vague. Actually, I wouldn’t
know if you gave me infinite or 2 times infinite. I couldn’t tell the difference. So I’ll put it in quotes,
because it sort of gives us comfort. But it doesn’t mean much. What does mean much? Somehow that’s important. Can I tell you how to
work with delta functions, how to think about
delta functions? It’s the right way to
think about delta function. So here’s some comment
on delta function. Giving the values of the
function, 0, and infinity, and 0, is not the best. What you can do with
a delta function is you can integrate it. You can define the
function by integrals. Integrals of things are nice. Do you think in your mind
when you take derivatives, as we did going left to right,
we were taking derivatives. The function was getting crazy. When we go right to left, take
integrals, those are smoothing. Integrals make
functions smoother. They cancel noise. They smooth the function out. So what we can do is to take the
integral of the delta function. We could take it from
any negative number to any positive number. And what answer would we get? What would be the right,
well, the one thing people know about the
delta function is– and actually, it’s the
key thing– the integral of the delta function. Again, I’m integrating
the delta function from some negative number
up to some positive number. And it doesn’t matter where n
is, because the function is 0 there and there. But what’s the answer here? Put me out of my misery. Just tell me the number
I’m looking for, here, the integral of
the delta function. Or maybe you haven’t met it. AUDIENCE: [INAUDIBLE]. PROFESSOR: It’s? It’s the one good
number you could guess. It’s 1. Now, why is it 1? Because if the delta function
is the derivative of the step function, this should be the
step function evaluated between N and P. This should be
the step function, , here, minus the step function, there And what is the step function? You have to keep it straight. Am I talking about
the delta function? No, right now, I’ve
integrated it to get H of t. So this is H of P at
the positive side, minus H of N. That’s
what integration’s about. And what do I get? 1, because H of P, the
step function here, H is 1. And here, it’s 0, so I get 1. Good, that’s the
thing that everybody remembers about
the delta function. And now I can make sense out of
2 delta function, 2 delta of t. That could be my source. So if 2 delta of
t was my source, what’s the graph
of 2 delta of t? Again, it’s 0 infinite 0. You really can’t tell from
the infinity what’s up, but what would be the
integral of 2 delta of t, the integral of 2 delta
of t or some other? Well, let me put in the 2, here? What’s the integral of 2
delta of t, would be 2H of t. Keep going. What do I get here? AUDIENCE: 2. PROFESSOR: It would
be 2 of these guys, 2 of these, 2 of these, 2. All right? So we made sense out of the
strength of the impulse, how hard the bat hit the ball. But of course, we
need units in there. We have to have units. And here, the value
for that unit was 2. Now, I’m going to– because
this is really worth doing with delta functions. I didn’t ask at the start
have you seen them before. But they are worth seeing. And they just take
a little practice. But then in the
end, delta functions are way easier to work with than
some complicated function that attempts to model this. We could model that by some
Gaussian curve or something. All the integrations would
become impossible right away. We could model it by
a step function up and a step function down. Then the integrations
would be possible. But still, we have
this finite width. I could let that
width go to 0 and let the height go to infinity. And what would happen? I’d get the delta function. So that’s one way to create a
delta function, if you like. If you’re OK with
step functions, then one way to create delta
is to take a big step up, step down, and then let the
size of the step grow and the width of
the steps shrink. Keep the area 1, because
area is integral. So I keep this,
that little width, times this big
height equal to 1. And in the end, I get delta. Now again, my point is
that delta functions, that you really understand them. What you can legitimately do
with them is integrate them. But now in later problems,
we might have not a 1 or a 2, but a function in here, like
cosine t, or e to the t, or q of t. Can I practice with those? Can I put in a function f of t? I didn’t leave enough
space to write f of t, so I’m going to put it in
here. f of t delta of t dt. And I’m going to go
for the answer, there. My question is what
does that equal? You see what the question is? I got my delta function,
which I only just met. And I’m multiplying it by
some ordinary function. f of t gives us no problems. Think of cosine t. Think of e to the t. What do you think is the
right answer for that? What do you think
is the right answer? And this tells you
what the delta function is when you see this. What do I need to know about
f of t to get an answer, here? Do I need to know what f
is at t equals minus 1? You could see from
the way my voice asked that question that
the answer is no. Why do I not care
what f is at minus 1? Yeah? AUDIENCE: Because you’re
multiplying by [INAUDIBLE]. PROFESSOR: Because
I’m multiplying by somebody that’s 0. And similarly, at f equal minus
1/2, or at f equal plus 1/3, all those f’s make
no difference, because they’re
all multiplying 0. What does make a difference? What’s the key information
about f that does come into the answer? f at? At just at that one point, f at? AUDIENCE: [INAUDIBLE] PROFESSOR: 0, f at
0 is the action. The impulse is happening. The bat’s hitting the ball. So we’re modeling
rocket launching, here. We’re launching in 0 seconds
instead of a finite time. So in other words,
well, I don’t know how to put this answer down
other than just to write it. I guess I’m hoping
you’re with me in seeing that
what it should be. Can I just write it? All that matters
is what f is at t equals 0, because that’s
where all the action is. And that f of 0,
if f of 0 was the 2 that I had there a little while
ago, then the answer will be 2. If f of 0 is a 1, if the
answer is f of 0 times 1– and I won’t write times 1. That’s ridiculous. Now we can integrate
delta functions, not just a single integral of
delta, but integral of a function, a nice
function times delta. And we get f of 0. So can I just, while we’re on
the subject of delta functions, ask you a few examples? What is the integral of
e to the t delta of t dt? AUDIENCE: It’s 1. PROFESSOR: Yeah, say it again? AUDIENCE: It’s 1. PROFESSOR: It’s 1. It’s 1, right. Because e to the t, at the only
point we care about, t equal 0 is 1. And what if I change
that to sine t? Suppose I integrate
sine t times delta of t? What do I get now? I get? AUDIENCE: 0. PROFESSOR: 0, right. And actually, that’s
totally reasonable. This is a function, which is
yeah, it’s an odd function. Anyway, sine, if I switch t to
negative t, it goes negative. 0 is the right answer. Let me ask you this one. What about delta of t squared? Because if we’re up for a delta
function, we might square it. Now we’ve got a
high-powered function, because squaring this
crazy function delta of t gives us something truly crazy. And what answer would
you expect for that? AUDIENCE: 1. PROFESSOR: Would you expect 1? So this is like? I’m just getting
intuition working, here, for delta functions. What do you think? I’m looking at the energy
when I square something. OK, so we had a guess of 1. Is there another guess? Yeah? AUDIENCE: A third? PROFESSOR: Sorry? AUDIENCE: 1/3. PROFESSOR: 1/3, that’s
our second guess. I’m open for other
guesses before I– OK, we have a rule here for f of t. And now what is the f of t that
I’m asking about in this case? It’s delta of t, right? If f of t is delta of t,
then that would match this. And therefore, the
answer should match. Do you see what I’m
shooting for, yeah? AUDIENCE: It’d be infinity? PROFESSOR: It’d be infinity. It would be infinity. That’s delta of t squared
is that’s an infinite energy function. You never meet it, actually. I apologize, so so
write it down there. I could erase it right
away because you basically never see it. It’s infinite energy. Well, I think you’d see it. I mean, we’re really going back
to the days of Norbert Wiener. When I came to the
math department, Norbert Wiener was still
here, still alive, still walking the hallway by touching
the wall and counting offices. And hard to talk to, because
he always had a lot to say. And you got kind of
allowed to listen. So anyway, Wiener
was among the first to really use delta
functions, successfully use delta functions. Anyway, this is the big one. This is the big one. Now, so what’s all that about? I guess I was trying
to prepare by talking about this function
prepare for the equation when that’s the source. So dy equal ay plus
a delta function. Let me bring that delta
function in at time T. So how do you interpret
that equation? So like part of this
morning’s lecture is to get a first
handle on an impulse. So let me write that
word impulse, here. Where am I going to write it? So delta is an impulse. That’s our ordinary
English word for something that happens fast. And y of t is the
impulse response. And this is the most important. Well, I said e to the st
was the most important. How can I have two most
important examples? Well, they’re a tie, let’s say. e to the st is the most
important ordinary function. It’s the key to
the whole course. Delta of t, the impulse,
is the important one because if I can solve
it for a delta function, I can solve it for anything. Let’s see if we can solve
it for a delta function, a delta function, an impulse
that starts at time T. Again, I’m just going to start
writing down the solution and ask for your help
what to write next. So what do you expect as a
first term in the solution? So I’m starting
again from y of 0. Let’s see if we can
solve it by common sense. So how do I start
the solution to this? Everybody sees what
this equation is saying. I have an initial deposit of
y of 0 that starts growing. And then at time capital
T I make a deposit. At that moment, at that
instant, I make a deposit of 1. That’s an instant deposit of 1. Which is, of course,
what I do in reality. I take $1 to the bank. They’ve got it now. At time T, I give them that $1,
and it starts earning interest. So what about y of t? What do you think? What’s the first term
coming from y of 0? So the term coming
from y of 0 will be y of 0 to start
with, e to at. That takes care of the y of 0. Now, I need something. It’s like this, plus
I need something that accounts for what
this deposit brings. So up until time
T, what do I put? So this is for t smaller
than T and t bigger than T. So what goes there? For t smaller than
T, what’s the benefit from the delta function? 0, didn’t happen yet. For t bigger than T,
what’s the benefit from the delta function? AUDIENCE: [INAUDIBLE]. PROFESSOR: For t bigger
than T, well, that’s right. OK, but now I’ve
made that deposit at time capital T.
Whatever’s going there is whatever I’m
getting from that deposit. At time capital
T, I gave them $1, and they start paying
interest on it. What’s going to go there? So if I gave them $1 at that
initial time, so that $1 would have been part of y of 0. What did I get at a later time? e to the at. Now I’m waiting. I’m giving them the
dollar at time capital T, and it starts growing. So what do I have
at a later time, for t later than capital T? What has that $1 grown into? e to the a times the–
right, it’s critical. It’s the elapsed time. It’s the time since the deposit. Is that right? So what do I put here? AUDIENCE: t minus capital T? PROFESSOR: t minus
capital T, good. Apologies to bug you about
this, but the only way to learn this stuff from a
lecture is to be part of it. So I constantly ask you, instead
of just writing down a formula. I think that looks good. So suddenly, what does this
amount to at t equal capital T? Maybe I should allow
t equal capital T. At t equal capital T,
what do I have here? AUDIENCE: 1. PROFESSOR: 1. That’s my $1. At t equal capital
T, we’ve got $1. And later it’s grown. So we have now solved. We have found the
impulse response. We have found the
impulse response when the impulse happened at
capital T. That was good going. Now, I’ve given you
my list of examples with the pause on
the sine and cosine. I pause on the sine and
cosine because one way to think about sine and cosine
is to get into complex numbers. And that’s really for next time. But apart from that, we’ve
done all the examples, so are we ready? Oh yeah, I’m going to try for
the big thing, the big formula. So this is the key
result of section 1.4, the solution to this equation. So I’m going back to
the original equation. And just see if we can write
down a formula for the answer. So let me write
the equation again. dy dt is ay plus some source. I think we can write down
a formula that looks right. And we could then actually
plug it in and see, yeah, it is right. So what’s going to
go into this formula? We got enough examples, so now
let’s go for the whole thing. So y of t, first of
all, comes whatever depends on the
initial condition. So how much do we have
at a later time when our initial deposit was y of 0? So that’s the one we’ve
seen in every example. Every one of these things
has this term growing out of y of 0. So let me put that in again. So the part that grows out of
y of 0 is y of 0 e to the at. That’s OK. So that’s what the initial. So our money is coming from two
sources, this initial deposit, which was easy, and this
continuous, over time deposit, q of t. And I have to ask
you about that. That’s going to be like
the particular solution, the particular solution that
comes from the source term. This is the solution it comes
from the initial condition. So what do you think
this thing looks like? I just think once we see
it, we can say, yeah, that makes sense. So now I’m saying what? If we’ve deposited q of
t in varying amounts, maybe a constant for a while,
maybe a ramp for awhile, maybe whatever, a step, how am
I going to think about this? So at every time t
equal to s, so I’m using little t for
the time I’ve reached. Right? Here’s t starting at 0. Now, let me use s for
a time part way along. So part way along, I input. I deposit q of s. I deposit it at time s. And then what does it do? That money is in the
bank with everybody else. It grows along with
everything else. So what’s the growth factor? What’s the growth factor? This is the amount I
deposited at time s. And how much has
it grown at time t? This is the key question,
and you can answer it. It went in a time s. I’m looking at time t. What’s the factor? AUDIENCE: Is it e
to the a t minus s. PROFESSOR: e to the a t minus s. So that’s the contribution
to our balance at time t from our input at time s. But now, I’ve been
inputting all the way along. s is running all the
way from here to here. So finish my formula. Put me out of my misery. Or it’s not misery, actually. Its success at this moment. What do I do now? I? AUDIENCE: Integrate. PROFESSOR: I integrate, exactly. I integrate. I integrate. So all these deposits went in. They grew that amount
in the remaining time. And I integrate from 0
up to the current time t. So you see that formula? Have a look at it. This is a general formula, and
every one of those examples could be found
from that formula. If q of s was 1, that was
our very first example. We could do that integration. If q of s was e to the–
anyway, we could do every one. I just want you to see that
that formula makes sense. Again, this is what grew out
of the initial condition. This is what grew out of
the deposit at time s. And the whole point of
calculus, the whole point of learning [? 1801 ?],
the integral equation part, the integrals part,
is integrals just add up. This term just adds up
all the later deposits, times the growth factor
in the remaining time. And as I say, if I took q of s
equal 1– the examples I gave are really the examples where
you can do the integral. If q of s is e to the i omega
s, I can do that integral. Actually, it’s not hard to do
because e to the at doesn’t depend on s. I can bring an e to the
at out in this case. That formula is just
worth thinking about. It’s worth understanding. I didn’t, like, derive it. And the book does, of course. There’s something called
an integrating factor. You can get at this
formula systematically. I’d rather get at it
and understand it. I’m more interested
in understanding what the meaning of that
formula is than the algebra. Algebra is just a
goal to understand, and that’s what I
shot for directly. And as I say, that
the book also, early section of the book,
uses practice in calculus. Substitute that in
to the equation. Figure out what is dy dt. And check that it works. It’s worth actually
looking at that end of what you need to know from
calculus It’s is. You should be able
to plug that in for y and see that solves
the equation. Right, now I have enough
time to do cosine omega t. But I don’t have enough time
to do it the complex way. So let me do as a final
example, the equation. Let me just think. I don’t know if I have
enough space here. I’m now going to do dy dt–
can I call that y prime to save a little space– equal
ay plus cosine of t. I’ll take omega to be 1. Now, how could we
solve that one? I’m going to solve it
without complex numbers, just to see how easy
or hard that is. And you’ll see,
actually, it’s easy. But complex numbers
will tell us more. So it’s easy, but
not totally easy. So what did I do in
the earlier example if the right hand side
was a 1, a constant? I look for the solution
to be a constant. If the right hand side
was an exponential, I look for the solution
to be an exponential. Now, my right hand side, my
source term, is a cosine. So what form of the solution
am I going to look for? I naturally think,
OK, look for a cosine. We could try y equals
some number M cosine t. Now, you have to see what
goes wrong and how to fix it. So if I plug that in,
looking for M the same way I look for capital Y
earlier, I plug this in, and I get aM cosine t cosine t. But what do I get for y prime? Sine t. And I can’t match. I can make it work. I can’t make a sine there
magic a cosine here. So what’s the solution? How do I fix it? I better allow my
solution to include some sine plus N sine t. So that’s the problem with
doing it, keeping things real. I’ll push this
through, no problem. But cosine by itself won’t work. I need to have sines there,
because derivatives bring out sines. So I have a combination
of cosine and sine. I have a combination
of cosine and sine. So the complex method
will work in one shot because e to the i omega t is a
combination of cosine and sine. Or another way to say it
is when I see cosine here, that’s got two exponentials. That’s got e to the it
and e to the– anyway. Let’s go for the real one. So I’m going to plug
that into there. So I’ll get sines
and cosines, right? When I plug this
into there, I’ll have some sines
and some cosines, and I’ll just match
the two separately. So I’m going to
get two equations. First of all, let me say
what’s the cosine equation? And then what’s
the sine equation? So when I match cosine
terms, what do I have? What cosine terms do I
get out of y prime, here? The derivative. Well, the derivative
of cosine is a sine. That that’s not a cosine term. The derivative of
sine is cosine. I think I get, if I
just match cosines, I think I get an N cosine. N cosine t equal ay. How many cosines do I
have from that term? ay has an M cosine t. I think I have an aM,
and here I’ve got 1. That was a natural
step, but new to us. I’m matching the cosines. I have on the left side, with
this form of the solution, the derivative will
have an N cosine t. So I had N cosines, aM
cosines, and 1 cosine. Now, what if I match signs? What happens there? We’re pushing more
than an hour, so hang on for another five
minutes, and we’re there. Now, what happens if
I match sines, sine t? How do I get sine t in y prime? So take the derivative of
that, and what do you have? AUDIENCE: Minus [INAUDIBLE]. PROFESSOR: Minus M sine t. That tells me how many
sine t’s are in there. And on the right
hand side, a times y, how many sine t’s
do I have from that? AUDIENCE: You have N t’s. PROFESSOR: N, good thinking. And what about from this term? None, no sine there. So I have two equations by
matching the cosines and sines. Once you see it, you
could do it again. And we can solve
those equations, two ordinary, very simple
equations for M and N. Let’s see if I make space. Why don’t I do it here,
so you can see it. So how do I solve
those two equations? Well, this equation gives me–
easy– gives me M as minus aN. So I’ll just put that in for N. So I have N equals aM. But M is minus aN. I think I’ve got minus
a squared N plus that 1. All I did was solve the
equation, just by common sense. You could say by linear
algebra, but linear algebra’s got a little more
to it than this. So now I know M, and now I know
N. So now I know the answer. y is M, so M is minus aN. Oh, well, I have to figure
out what N is, here. What is N? This is giving me N, but
I better figure it out. What is N from that
first equation? And then I’ll plug in. And then I’m quit. AUDIENCE: [INAUDIBLE]. PROFESSOR: 1 over, yeah. AUDIENCE: 1 plus a squared. PROFESSOR: 1 plus
a squared, good. Because that term goes
over there, and we have 1 plus a squared. So now y is M cosine t. So M is minus aN. So minus aN is 1 over 1
plus a squared cosine t. Is that right? That was the cosines. And we had N sine t. But N is just 1– I think
I just add the sine t. Have I got it? I think so. Here is the N sine t,
and here is the M cos t. It was just algebra. Typical of these
problems, there’s a little thinking and
then some algebra. The thinking led us to this. The thinking led us to the fact
we needed cosines in there, as well as cosines. But then once we did
it, then the thinking said, OK, separately match the
cosine terms and the sine term. And then do the algebra. Now, I just want to
do this with complex. So y prime equals
ay plus e to the it. To get an idea, you see the two. And then I have
to talk about it. You see, I’m only going
to go part way with this and then save it for Wednesday. But if I see this, what
solution do I assume? This is like an e to the st. I
assume y is some Y e to the it. See, I don’t have cosines
and sines anymore. I have e to the it. And if I take the
derivative of e to the it, I’m still in the
e to the it world. So I do this. I plug it in. Uh-huh, let me leave
that for Wednesday. We have to have some
excitement for Wednesday. So we’ll get a complex
answer, and then we’ll take the real part to
solve that problem. So we’ve got two steps,
one way or the other way. Here, we had two steps because
we had to let sines sneak in. Here, we have two steps
because I could solve it, and you could solve
that right away. But then you have to
take the real part. I’ll leave that. Is there questions? Do you want me to recap
quickly what we’ve done. AUDIENCE: Yes. PROFESSOR: I try to
leave on the board enough to make a recap possible. Everything was
about that equation. We have only
solved– I shouldn’t say only– we have solved the
constant coefficient, model constant coefficient,
first order equation. Wednesday comes
nonlinear equation. This one today was
strictly linear. So what did we do? We solved this equation,
first of all, for q equal 1; secondly, for q equal
e to the st; thirdly, for q equal a step; fourthly
for q equal– where is it? Where is that delta of t? Maybe it’s here. Ah, it got erased. So the fourth guy was y prime
equal ay plus delta of t, or delta of t minus
capital T. So those were our four examples. And then what did we finally do? So if we’re recapping,
compressing, we’re compressing
everything into two minutes. We solved those four
examples, and then we solved the general problem. And when we solved
the general problem, that gave us this integral,
which my whole goal was that you should understand that
this should seem right to you. This is adding up
the value at time t from all the inputs
at different times s. So to add them up, we
integrate from 0 to t. And finally, we
returned to the question of cos t, all
important question. But awkward question,
because we needed to let sine t in there too.

31 thoughts on “2. First-Order Equations

  • January 15, 2015 at 8:48 pm

    Great Job Mr Strang 

  • January 15, 2015 at 8:51 pm

    What a coincidence! I just did a video yesterday explaining what this whole equation stuff can be used for 🙂

  • January 16, 2015 at 6:15 am

    He seems very old and fragile, i somehow feel bad but it makes me all the more attentive to what he's saying

  • January 18, 2015 at 7:41 am

    Where is the lecture number 1 ?

  • January 18, 2015 at 4:14 pm

    The equation is lineal and its coefficients are constant. But the exposition flux to find it solution — the methodology for solving it — is not. This way is demanding from students an understanding of the subject matter equivalent to know how to solve the equation — which is, precisely, what professor Strang is teaching. The teaching is supposed to flux from the known to the unknown by a lineal deduction or induction thought. But I can’t see that flux clearly. Sorry.

  • January 19, 2015 at 3:36 am

    Thanks for sharing this lecture video. I was having hard time with this class, and it helps a lot. One thing I want to point out is, the camera moving is very good, but it zooms in too much. I can't see more than three lines of equation. It was good to zoom in when the video quality was bad like old lecture video of Dr. Walter Lewin. But now you guys support 1080p, and I can see everything clear with good amount of zoom out at 17:56

  • January 21, 2015 at 12:50 pm

    Actually, I'm really moved by Prof. Gilbert. Since the first time I saw his video, Highlight of Calculus, I thought he was very old and may retire soon. But how could he still teach a lecture! He's over 80 now. Please cherish what he brings us.

  • January 24, 2015 at 4:31 am

    Thanks MIT for sharing this.

  • February 7, 2015 at 9:48 am

    Great explanations!

  • February 9, 2015 at 2:37 pm

    Gilbert Strang. Excelent teacher and friendly person

  • February 18, 2015 at 7:28 am


  • February 23, 2015 at 7:34 am

    can i get a link of civil engineering class lecture??

  • March 17, 2015 at 11:30 am

    if u think of integrals as area under curve than integral of delta fcn should be zero but it is one why? 

  • March 17, 2015 at 3:42 pm

    for the solution of q=step function when t<T the particular solution tern is negative so why money is decreasing?

  • March 30, 2015 at 4:33 pm

    I have learned much from 18.06, and I'm really happy to see professor Strang again!                                                                                     

  • April 26, 2015 at 4:38 pm

    why don't they have a mechatronic degree in undergraduate courses?

  • April 16, 2016 at 6:08 am

    I had trouble seeing where the solution to dy/dt=ay+q(t) came from. Example 2 from http://mathinsight.org/ordinary_differential_equation_linear_integrating_factor_examples helped me understand how to get the solution.

  • May 7, 2016 at 7:43 pm

    Thank you very much for uploading these, could I request that the next time this course is ran, all videos are recorded?

    In the mean time, for others wanting more, Gilbert Strang has more videos here: http://mathworks.com/videos/series/differential-equations-and-linear-algebra-117657.html

  • July 25, 2016 at 4:23 pm

    i am a newer one so why y is being multiplied by a(interest rate)

  • February 7, 2017 at 10:18 am

    I'm loving the playlist

  • March 27, 2017 at 5:34 am

    Good guy Hilbert Strang. He sent me his book on linear álgebra for free because I needed it in Caracas Venezuela

  • July 24, 2017 at 12:08 am

    Why he can do ayp + ayn = a(yp + yn) and not ayp^2 + ayn^2 = a(yp^2 + yn^2)??? He says that he can yp + yn by linearity, and that it could not be possible with y^2

  • December 15, 2017 at 2:42 am


  • March 2, 2018 at 1:08 pm

    Great teacher, so cool he is still teaching

  • March 29, 2018 at 9:10 pm

    Professor Strang, THE best

  • May 7, 2018 at 2:01 am

    He's kinda of hard to follow

  • May 22, 2018 at 8:44 am

    600th like. Long live Gilbert Strang!

  • October 23, 2018 at 7:13 pm

    thank you, I learned a lot. Here a little bit in Excel https://youtu.be/sWXKk87wH0c

  • June 18, 2019 at 4:41 am

    Khan Acadamy is easier

  • September 20, 2019 at 5:09 am

    Gil Strang + Prof. Jerrison = 2×(World's Best Math Professor) !!


Leave a Reply

Your email address will not be published. Required fields are marked *