Home » Courses » Mathematics » Single Variable Calculus » Video Lectures » Lecture 16: Differential Equations
Flash and JavaScript are required for this feature.
Download the video from iTunes U or the Internet Archive.
Note: There is no video for lecture 17 because students took an exam during this session.
Topics covered: Differential equations, separation of variables
Instructor: Prof. David Jerison
Lecture 16: Differential Eq...
Lecture Notes (PDF)
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: And this last little bit is something which is not yet on the Web. But, anyway, when I was walking out of the room last time, I noticed that I'd written down the wrong formula for c1 - c1. There's a misprint, there's a minus sign that's wrong. I claimed last time that c1 - c2 was + 1/2. But, actually, it's - 1/2. If you go through the calculation that we did with the antiderivative of sine x cosine x, we get these two possible answers. And if they're to be equal, then if we just subtract them we get c1 - c2 + 1/2 = 0. So c1 - c2 = 1/2. So, those are all of the correction. Again, everything here will be on the Web. But just wanted to make it all clear to you.
So here we are. This is our last day of the second unit, Applications of Differentiation. And I have one of the most fun topics to introduce to you. Which is differential equations. Now, we have a whole course on differential equations, which is called 18.03. And so we're only going to do just a little bit. But I'm going to teach you one technique. Which fits in precisely with what we've been doing already. Which is differentials. The first and simplest kind of differential equation dy/dx = some function, f (x). Now, that's a perfectly good differential equation. And we already discussed last time that the solution; that is, the function y, is going to be the antiderivative, or the integral, of x. Now, for the purposes of today, we're going to consider this problem to be solved. That is, you can always do this. You can always take antiderivatives. And for our purposes now, that is for now, we only have one technique to find antiderivatives. And that's called substitution.
It has a very small variant, which we called advanced guessing. And that works just as well. And that's basically all that you'll ever need to do. As a practical matter, these are the ones you'll face for now. Ones that you can actually see what the answer is, or you'll have to make a substitution. Now, the first tricky example, or the first maybe interesting example of a differential equation, which I'll call Example 2, is going to be the following. (d / dx + x)y = 0. So that's our first differential equation that were going to try to solve. Apart from this standard antiderivative approach. This operation here has a name. This actually has a name, it's called the annihilation operator. And it's called that in quantum mechanics. And there's a corresponding creation operator where you change the sign from plus to minus. And this is one of the simplest differential equations. The reason why it's studied in quantum mechanics all it that it has very simple solutions that you can just write out. So we're going to solve this equation. It's the one that governs the ground state of the harmonic oscillator. So it has a lot of fancy words associated with it, but it's a fairly simple differential equation and it works perfectly by the method that we're going to propose.
So the first step in this solution is just to rewrite the equation by putting one of the terms on the right-hand side. So this is dy / dx = - x y. Now, here is where you see the difference between this type of equation and the previous type. In the previous equation, we just had a function of x on the right-hand side. But here, the rate of change depends on both x and y. So it's not clear at all that we can solve this kind of equation. But there is a remarkable trick which works very well in this case. Which is to use multiplication. To use this idea of differential that we talked about last time. Namely, we divide by y and multiply by dx. So now we've separated the equation. We've separated out the differentials. And what's going to be important for us is that the left-hand side is expressed solely in terms of y and the right-hand side is expressed solely in terms of x. And we'll go through this in careful detail.
So now, the idea is if you've set up the equation in terms of differentials as opposed to ratios of differentials, or rates of change, now I can use Leibniz's notation and integrate these differentials. Take their antiderivatives. And we know what each of these is. Namely, the left-hand side is just - ah. well, that's tough. OK. I had an au pair who actually did a lot of Tae Kwan Do. She could definitely defeat any of you in any encounter, I promise. OK. Anyway. So, let's go back. We want to take the antiderivative of this. So remember, this is the function whose derivative is 1 / y. And now there's a slight novelty here. Here we're differentiating the variables x, and here we're differentiating the variable as y. So the antiderivative here is ln y. And the antiderivative on the other side is - x^2 / 2. And they differ by a constant. So we have this relationship here. Now, that's almost the end of the story. We have to exponentiate to express y in terms of x. So, e ^ ln y = e ^ -x^2 / 2 + c. And now I can rewrite that as y = I'll write as A e ^ - x^2 / 2, where a = e ^c. And incidentally, we're just taking the case y positive here. We'll talk about what happens when y is negative in a few minutes.
So here's the answer to the question, almost, except for this fact that I picked out y positive. Really, the solution is y = ae ^ - x^2 / 2. Any constant, a; a positive, negative, or 0. Any constant will do. And we should double-check that to make sure. If you take dy / d x right, that's going to be a d/ dx ( e^ -x ^2 / 2). And now by the chain rule, you can see that this is a times the factor of - x, that's the derivative of the exponent, with respect to x times the exponential. And now you just rearrange that. That's - x y. So it does check. These are solutions to the question. The a didn't matter. It didn't matter whether it was positive or negative. This function is known as the normal distribution, so it fits beautifully with a lot of probability and probabilistic interpretation of quantum mechanics. This is sort of the, where the particle is.
So next, what I'd like to do is just go through the method in general and point out when it works. And then I'll make a few comments just to make sure that you understand the technicalities of dealing with constants and so forth. So, first of all, the general method of separation of variables. And here's when it works. It works when you're faced with a differential equation of the form f (x) g( y). That's the situation that we had. And I'll just illustrate that. Just to remind you here. Here's our equation. It's in that form. And the function f (x) = - x, and the function g( y) is just y. And now, the way the method works is, this separation step. From here to here, this is the key step. This is the only conceptually remarkable step, which all has to do with the fact that Leibniz fixed his notations up so that this works perfectly. And so that involves taking the y, so dividing by g( y), and multiplying by dx, it's comfortable because it feels like ordinary arithmetic, even though these are differentials. And then, we just antidifferentiate. So we have a function, h, which is the integral of dy/ g( y), and we have another function which is F. Note they are functions of completely different variables here. Integral of f ( x) dx. Now, in our example we did that. We carried out this antidifferentiation, and this function turned out to be ln y, and this function turned out to be - x^2 / 2. And then we write the relationship. Which is that if these are both antiderivatives of the same thing, then they have to differ by a constant. Or, in other words, H ( y) has to equal to F(x) + c. Where c is constant.
Now, notice that this kind of equation is what we call an implicit equation. It's not quite a formula for y, directly. It defines y implicitly. That's that top line up here. That's the implicit equation. In order to make it an explicit equation, which is what is underneath, what I have to do is take the inverse. So I write it as y = = H -1( F ( x) + c). Now, in real life the calculus part is often pretty easy. And it can be quite messy to do the inverse operation. So sometimes we just leave it alone in the implicit form. But it's also satisfying, sometimes, to write it in the final form here.
Now I've got to give you a few little pieces of commentary before. For those of you walked in a little bit late, this will all be on the Web. So just a few pieces of commentary. So if you like, some remarks. The first remark is that I could have written ln | y| = - x ^2 / 2 + c. We learned last time that the antiderivative works also for the negative values. So this would work for y not equal to 0. Both for positive and negative values. And you can see that that would have captured most of the rest of the solution. Namely, | y| would be = A e ^ - x^2 / 2, by the same reasoning as before. And then that would mean that y = plus or minus A e^ - x^2 / 2, which is really just what we got. Because, in fact, I didn't bother with this. Because actually in most - and the reason why going through this, by the way, carefully this time, is that you're going to be faced with this very frequently. The exponential function comes up all the time. And so, therefore, you want to be completely comfortable dealing with it.
So this time I had the positive a, while the negative a fits in either this way, or I can throw it in. Because I know that that's going to work that way. But of course, I double-checked to be confident. Now, this still leaves out one value. So, this still leaves out. So, if you like, what I have here now is a is equal to plus or minus capital A. The capital A1 being positive 1. But this still leaves out one case. Which is y = 0. Which is an extremely boring solution, but nevertheless a solution to this problem. If you plug in here for y, you get 0. If you plug in here for y, you get that these two sides are equal. = 0. Not a very interesting answer to the question. But it's still an answer. And so y = is left out.. Well, that's not so surprising that we missed that solution. Because in the process of carrying out these operations, I divided by y. I did that right here. So, that's what happens. If you're going to do various non-linear operations; in particular, if you're going to divide by something, if it happens to be you're going to miss that solution. You might have problems with that solution. But we have to live with that because we want to get ahead. And we want to get the formulas for various solutions. So that's the first remark that I wanted to make.
And now, the second one is almost related to what I was just discussing right here. That I'm erasing. And that's the following. I could have also written ln y + c1 = - x^2 / 2 + c2. Where c1 and c2 are different constants. When I'm faced with this antidifferentiation, I just taught you last time, that you want to have an arbitrary constant. Here and there, in both slots. So I perfectly well could have written this down. But notice that I can rewrite this as ln y = - x ^2 / 2 + c2 - c1. I can subtract. And then, if I just combine these two guys together and name them c, I have a different constant. In other words, it's superfluous and redundant to have two arbitrary constants here, because they can always be combined into one. So two constants are superfluous. Can always be combined. So we just never do it this first way. It's just extra writing, it's a waste of time.
There's one other subtle remark, which you won't actually appreciate until you've done several problems in this direction. Which is that the constant appears additive here, in this first solution to the problem. But when I do this nonlinear operation of exponentiation, it now becomes multiplicative constant. And so, in general, there's a free constant somewhere in the problem. But it's not always an additive constant. It's only an additive constant right at the first step when you take the antiderivative. And then after that, when you do all your other nonlinear operations, it can turn into anything at all. So you should always expect it to be something slightly more interesting than an additive constant. Although occasionally it stays an additive constant.
The last little bit of commentary that I want to make just goes back to the original problem here. Which is right here. The example 1. And I want to solve it, even though this is simpleminded. But example 1 via separation. So that you see our variables. So that you see what it does. The situation is this. And the separation just means you put the dx on the other side. So this is dy = = f(x) dx. And then we integrate. And the antiderivative of dy is just y. So this is the solution to the problem. And it's just what we wrote before; it's just a funny notation. And it comes to the same thing as the antiderivative.
OK, so now we're going to go on to a trickier problem. A trickier example. We need one or two more just to get some practice with this method. Everybody happy so far? Question.
STUDENT: [INAUDIBLE]
PROFESSOR: So, the question is, how do we deal with this ambiguity. I'm summarizing very, very, briefly what I heard. Well, you know, sometimes a > 0, sometimes a
STUDENT: [INAUDIBLE]
PROFESSOR: The general solution is this solution.
STUDENT: [INAUDIBLE]
PROFESSOR: And I'm showing you here that you could get to most of the general solution. There's one thing that's left out, namely the case a = 0. So, in other words, I would not go through this method. I would only use this, which is simpler. But then I have to understand that I haven't gotten all of the solutions this way. I'm going to need to throw in all the rest of the solutions. So in the back of your head, you always have to have something like this in mind. So that you can generate all the solutions. This is very suggestive, right? The restriction, it turns that the restriction A > is superfluous, is unnecessary. But that, we only get by further thought and by checking. Another question? Over here.
STUDENT: [INAUDIBLE]
PROFESSOR: The aim of differential equations is to solve them. Just as with algebraic equations. Usually, differential equations are telling you something about the balance between an acceleration and a velocity. If you have a falling object, it might have a resistance. It's telling you something. So, actually, sometimes in applied problems, formulating what differential equation describe this situation is very important. In order to see that that's the right thing, you have to have solved it to see that it fits the data that you're getting.
STUDENT: [INAUDIBLE]
PROFESSOR: The question is, can you solve for x instead of y. The answer is, sure. That's the same thing as - so that would be the inverse function of the function that we're officially looking for. But yeah, it's legal. In other words, oftentimes we're stuck with just the implicit, some implicit formula and sometimes we're stuck with a formula x is a function of y versus y as a function of x. The way in which the function is specified is something that can be complicated. As you'll see in the next example, it's not necessarily the best thing to think about a function, y as a function of x. Well, in the fourth example. Alright, we're going to go on and do our next example here.
So the third example is going to be taken as a kind of geometry problem. I'll draw a picture of it. Suppose you have a curve with the following property. If you take a point on the curve, and you take the ray, you take the ray from the origin to the curve, well, that's not going to be one that I want. I think I'm going to want something which is steeper. Because what I'm going to insist is that the tangent line be twice as steep as the ray from the origin. So, in other words, slope of tangent line equals twice slope of ray from origin. So the slope of this orange line is twice the slope of the pink line. Now, these kinds of geometric problems can be written very succinctly with differential equations. Namely, it's just the following. dy / dx, that's the slope of the tangent line, is equal to, well remember what the slope of this ray is, if this point, I need a notation. At this point is (x, y) which is a point on the curve. So the slope of this pink line is what?
STUDENT: [INAUDIBLE]
PROFESSOR: y / x. So if it's twice it, there's the equation. OK, now, we only have one method for solving these equations. So let's use it. It says to separate variables. So I write dy / y here = 2 dx / x. That's the basic separation. That's the procedure that we're always going to use. And now if I integrate that, I find that on the right-hand side I have the logarithm of y. And - sorry, on the left-hand side I have the logarithm of y. On the right-hand side, I have twice the logarithm of x, plus a constant. So let's see what happens to this example.
This is an implicit equation, and of course we have the problems of the plus or minus signs, which I'm not going to worry about until later. So let's exponentiate and see what happens. We get e ^ ln y = e ^ 2 ln x + c. So, again, this is y on the left-hand side. And on the right-hand side, if you think about it for a second, it's (e ^ ln x)^2. Which is x^2. So this is x ^2, and then there's an e^ c. So that's another one of these A factors here. A = e^ c. So the answer is, well, I'll draw the picture. And I'm going to cheat as I did before. We skipped the case y negative. We really only did the case y positive, so far. But if you think about it for a second, and we'll check it in a second, you're going to get all of these parabolas here. So the solution is this family of functions. And they can be bending down. As well as up. So these are the solutions to this equation. Every single one of these curves has the property that if you pick a point on it, the tangent line has twice the slope of the ray to the origin.
And the formula, if you like, of the general solution is y = ax^2, a is any constant. Question?
STUDENT: [INAUDIBLE]
PROFESSOR: Yeah. So again - so first of all, so there are two approaches to this. One is to check it, and make sure that it's right. When a formula works for some family of values, sometimes it works for others. But another one is to realize that these things will usually work out this way. Because in this argument here, I allow the absolute value. And that would have been a perfectly legal thing for me to do. I could have put in absolute values here. In which case, I would've gotten that the absolute value of this was equal to that. And now you see I've covered the plus and minus cases. So it's that same idea. This implies that y = either + A x^2 or - Ax^, depending on which sign you pick. So that allows me for the curves above and curves below. Because it's really true that the antiderivative here is the function. It's defined for y negative. So let's just double-check.
In this case, what's happening, we have y = ax^2 and we want to compute dy / dx to make sure that it satisfies the equation that I started out with. And what I see here is that this is 2ax. And now I'm going to write this in a suggestive way. I'm going to write it as 2ax^2 / x. And, sure enough, this is 2y / x. It does not matter whether a, it works for a positive, a negative, a = 0. It's OK. Again, we didn't pick up by this method the a = case. And that's not surprising because we divided by y.
There's another thing to watch out about, about this example. So there's another warning. Which I have to give you. And this is a subtlety which you definitely won't get to in any detail until you get to a higher level ordinary differential equations course, but I do want to warn you about it right now. Which is that if you look at the equation, you need to watch out that it's undefined at x = 0. It's undefined at x = 0. We also divided by x, and x is also a problem. Now, that actually has an important consequence. Which is that, strangely, knowing the value here and knowing the rate of change doesn't specify this function. This is bad. And it violates one of our pieces of intuition. And what's going wrong is that the rate of change was not specified. It's undefined at x = 0. So there's a problem here, and in fact if you think carefully about what this function is doing, it could come in on one branch and leave on a completely different branch. It doesn't really have to obey any rule across x = 0.
So you should really be thinking of these things as rays emanating from the origin. The origin was a special point in the whole geometric problem. Rather than as being complete parabolas. But that's a very subtle point. I don't expect you to be able to say anything about it. But I just want to warn you that it really is true that when x = there's a problem for this differential equation.
So now, let me say our next problem. Next example. Just another geometry question. So here's Example 4. I'm just going to use the example that we've already got. Because there's only so much time left here. The fourth example is to take the curves perpendicular to the parabolas. This is another geometry problem. And by specifying that the the curves are perpendicular to these parabolas, I'm telling you what their slope is. So let's think about that. What's the new equation? The new diff. eq. is the following. It's that the slope is equal to the negative reciprocal of the slope of the tangent line. Of tangent to the parabola. So that's the equation. That's actually fairly easy to write down, because it's - 1 / 2(y / x). That's the slope of the parabola. 2y / x. So let's rewrite that. Now, this is the x goes in the numerator, so it's - x / 2y.
And now I want to solve this one. Well, again, there's only one technique. Which is we're going to separate variables. And we separate the differentials here, so we get 2y dy = - x dx. That's just looking at the equation that I have, which is right over here. dy / dx = - x / 2y, and cross-multiplying to get this. And now I can take the antiderivative. This is y^2. And the antiderivative over here is - x^2 / 2 + c. And so, the solutions are x^2 / 2 + y^2 = some c. Some constant c. Now, this time, things don't work the same. And you can't expect them always to work the same. I claimed that this must be true. But unfortunately I cannot insist that every c will work. As you can see here, only the positive numbers c can work here. So the picture is that something slightly different happened here. And you have to live with this. Is that sometimes not all the constants will work. Because there's more to the problem than just the antidifferentiation. And here there are fewer answers rather than more answers. In the other case we had to add in some answers, here we have to take them away. Some of them don't make any sense. And the only ones we can get are the ones which are of this form, where this is, say, some radius squared. Well maybe I shouldn't call it a radius. I'll just call it a parameter, a^2. And these are of course ellipses. And you can see that the ellipses, the length here is the square root of 2a and the semi-axis, vertical semi-axis, is a. So this is the kind of ellipse that we've got. And I draw it on the previous diagram, I think it's somewhat suggestive here. There, ellipses are kind of eggs. They're a little bit longer than they are high. And they go like this. And if I drew them pretty much right, they should be making right angles. At all of these places.
OK, last little bit here. Again, you've got to be very careful with these solutions. And so there's a warning here too. So let's take a look at, this is the implicit solution to the equation. And this is the one that tells us what the shape is. But we can also have the explicit solution. And if I solve for the explicit solution, it's either y = + square root of a^2 - x^2 / 2, or y = - square root of a^2 - x^2 / 2. These are the explicit solutions. And now, we notice something that we should have noticed before. Which is that an ellipse is not a function. It's only the top half, if you like, that's giving you a solution to this equation. Or maybe the bottom half that's giving it the solution to the equation. So the one over here, this one is the top halves. And this one over here is the bottom halves.
And there's something else that's interesting. Which is that we have a problem at y = 0. y = is where x = square root of 2a. That's when we get to this end here. And what happens is the solution comes around and it stops. It has a vertical slope. Vertical slope. And the solution stops. But really, that's not so unreasonable. After all, look at the formula. There was a y in the denominator here. When y = 0, the slope should be infinite. And so this equation is just giving us what it geometrically and intuitively should be giving us. At that stage.
So that is the introduction to ordinary differential equations. Again, there's only one technique which is - we're not done yet, we have a whole four minutes left and we're going to review. Now, so fortunately, this review is very short. Fortunately for you, I handed out to you exactly what you're going to be covering on the test. And it's what's printed here but there's a whole two pages of discussion. And I want to give you very, very clear-cut instructions here. This is usually the hardest test of this course. People usually do terribly on it. And I'm going to try to stop that by making it a little bit easier. And now here's what we're going to do. I'm telling you exactly what type of problems are going to be on the test. These are these six. It's also written on your sheet, your handout. It's also just what was asked on last year's test. You should go and you should look at last year's test and see what types of problems they are. I really, really, am going to ask the same questions, or the same type of questions. Not the same questions.
So that's what's going to happen on the test. And let me just tell you, say one thing, which is the main theme of the class. And I will open up. We'll have time for one question after that. The main theme of this unit is simply the following. That information about derivative and sometimes maybe the second derivative, tells us information about f itself. And that's just what were doing here with ordinary differential equations. And that was what we were doing way at the beginning when we did approximations.
This is one of over 2,200 courses on OCW. Find materials for this course in the pages linked along the left.
MIT OpenCourseWare is a free & open publication of material from thousands of MIT courses, covering the entire MIT curriculum.
No enrollment or registration. Freely browse and use OCW materials at your own pace. There's no signup, and no start or end dates.
Knowledge is your reward. Use OCW to guide your own life-long learning, or to teach others. We don't offer credit or certification for using OCW.
Made for sharing. Download files for later. Send to friends and colleagues. Modify, remix, and reuse (just remember to cite OCW as the source.)
Learn more at Get Started with MIT OpenCourseWare
MIT OpenCourseWare makes the materials used in the teaching of almost all of MIT's subjects available on the Web, free of charge. With more than 2,200 courses available, OCW is delivering on the promise of open sharing of knowledge. Learn more »
© 2001–2015
Massachusetts Institute of Technology
Your use of the MIT OpenCourseWare site and materials is subject to our Creative Commons License and other terms of use.