# Big Picture: Integrals

Flash and JavaScript are required for this feature.

The second half of calculus looks for the distance traveled even when the speed is changing. Finding this "integral" is the opposite of finding the derivative. Professor Strang explains how the integral adds up little pieces to recover the total distance.

I know the speed at each moment of my trip, so how far did I go?

Professor Strang's Calculus textbook (1st edition, 1991) is freely available here.

Subtitles are provided through the generous assistance of Jimmy Ren.

PROFESSOR: Hi. Well, if you're ready, this will be the other big side of calculus. We still have two functions, as before. Let me call them the height and the slope: y of x and the slope, s of x. Function one and function two. That's what calculus is about. And earlier, we figured out how to go from function one if we knew that, how to find the slope. Of course, it was easy when function one was just a straight line. Then the slope was just up divided by across. But when function one was curving, we had to do something. We had to take just a small distance across, a small distance up and divide, and then let small get smaller and smaller. The result of that was function two, the derivative.

Today, we're going the other way. We know the slope. We know s of x, and we want to find the height, y of x, of the graph. We know how the graph is sloping at every point, and we have to put all that information together to find its height. OK. Let me say the easiest way to do it, when it works, is to recognize if we are given a formula for the slope, to recognize maybe we know a height that goes with it.

Let me take an example. So the one, and most important case of a height is x to some power. x to n. That's one that everybody learns. When y is x to the nth, the result of this process that produces function two going in that direction is dy/dx is that n comes down and we have one lower power. So if we happen to have that as our slope, that would be our height. Nothing more to do.

But many other slopes are possible. Let's just stay with this another minute. What if the slope was x to the nth itself? What if we started with function two as x to the nth. Suppose dy/dx is x to the nth power, like x squared. Where does x squared come from? Well, look at this rule. That rule said that for these power functions, the power drops by one. So if I want to end up with x to the nth, going backwards, function one had better be, involve an x to the n plus 1.

But that's not perfect, of course, because when I take the slope of that one, this factor, this power, this exponent, n plus n will come down. Just as n came down to here, n plus 1 will come down, and therefore I'd better divide by n plus 1 so that when I do take the slope, when I do go to number two, the n plus 1's will cancel. The power will drop by one, and I'll have x to the nth. OK, there's an example-- quite a useful one-- of going from step two to step one just by kind of recognizing what you want there.

So this is one set that everybody learns. Another is sines and cosines, if you can fit it into that. Another is either the x or logx. That's pretty much the list. And then you learn, in the future, ways to change things around to fit into one of those forms. But then, of course, there are many, many cases-- many, many functions, too-- that you don't fit, can't fit into a form where you can recognize from some list which you either have learned or you find on the web or you find in the calculator. A lot of lists have been made to help you go from two to one, but today we have to understand what is the actual process. What is the, what is the the reverse process to this one? And of course, this one involved a limit as delta x went to 0, because always I have to remember that things can be curving, things can be changing, I can't assume that they're saying the same. And then, the reverse direction.

Maybe I just tell you first what the symbol is. If I have this s of x and I want to get back to y of x-- so this is from two to one-- one will be y of x. The symbol for y of x will be-- it's, I'm just really wanting to draw that integral symbol. The integral, I would say the integral of s of x dx. And you'll see why-- this is, that's an s-- you'll see why that's a reasonable way to write it. But of course, first, we need the idea behind it.

OK, so how am I going to proceed? Step one, I'll take steps, I won't try to get immediately to the case of continuous change. I'll take single, individual steps. Let me do that. And then, I'm going to take smaller steps. And then in the limit, I'm taking continuous steps. OK, so first, big steps. So let me put down, for example, suppose I have y's. Suppose the y's stepped up like 0, 1, 4, 9, 16, whatever. So those are heights, and, of a graph that's sort of pieces of straight lines, only changing a few times. What would be the slopes? Going now, this is one going to two. The slope is s. Well, the slope, if the step size is one and I go up by one, the slope will be 1. Here I go up by 3. Here I go up by 5. Here I go up by 7. So if I, to go from there to there, I'm taking differences. I'm taking delta y's. These s's are delta y's. How do I go backwards?

Suppose I gave you 1, 3, 5, 7, and I started y off at 0. How could you recover the rest of the y's? Well, that I would, that 1 plus 3 is the 4, 1 plus 3 plus 5 is the 9, 1 plus 3 adds 7 more. You're up to 16 and onwards. So if going this way is a subtraction at each step, going this way is a kind of running addition. I add up all the slopes to see how far I've climbed.

Let me do a second example, just to make that point. Let me start you this time, let me start you with the slopes, because that's today's job. Suppose the slopes are 4, 3, 2, 1, 0. So if these were speeds, I would say, OK, I'm slowing down. I'm slowing down, but I'm still moving forward. Positive speeds, but putting the brakes on. What would be the distances? If the trip meter starts, start the trip meter at 0. OK. Then in the first second or hour, the first delta x we would go 4. And what goes there? 7, right? I'm doing, I'm accumulating, adding up the distances. Here I was at 4. I went another three to 7, to 9, 10. Here's, I didn't move. No speed, zero slope, stays flat, hit the top at 10. OK, I could do this with any bunch of numbers and I can do it with letters.

So now I move from arithmetic to algebra. Algebra just means I'll do it with any letters, but I'm not yet doing it continuously, which is what calculus will do. So with letters, I have here y0, y1, y2, y3, y4, let's say. So those are the y's. Now what are the slopes between them if the step across is 1? So what are the steps upward, what are the delta y's? Well, y1 minus y0, y2 minus y1, y3 minus y2, y4 minus y3. And then my question is these are the s's, these are the delta y's, you could say. These are the y's. What happens if I add all those delta y's? Do you see what happens? What happens if I add those four changes to get the total change?

Well, when I add those, do you see that y1 will cancel minus y1, y2 will cancel minus y2, y3 will cancel minus y3. So the sum-- and I use just a sigma symbol, but I'll just say sum and you know what I mean-- of these delta y's is what? What happened after all those cancellations? Did everything cancel? No way. y4 is still there, minus y0 is still there. So it was y4 minus y0. The last y minus the first y. I'll just write y last minus y 0, y first. y end minus y start is the sum of the delta y's. Simple algebra. Reminding us again and again and again that the opposite, the inverse to go the other way from two to one, we add pieces to get back to the y's.

Now I'm coming closer to what I want, but I'm moving toward calculus now. So calculus, I got there by delta y's over delta x's. So in moving toward calculus, what am I doing? I'm thinking of the changes delta y over smaller steps delta x. So I just want to take this step. I want to divide by delta x and multiply by delta x. Why do I do that? That's because it's this delta y over delta x that is-- it's those ratios, whatever the size of delta x is. And it's going to get smaller and smaller. I'm going to look at the change over very short steps. Then it's that ratio that make sense. Delta y over delta x is a reasonable number. It's close to the s. It's close to dy dx, but it hasn't got there yet. I'm multiplying by the delta x, the small step that's going to 0 but hasn't got there yet. And I'm adding and I get the last one minus the first one.

Now here comes the limiting step. So the limiting step will be the limit of this left hand side, this sum. So in the limit, I'll have more and more and more things. As delta x gets smaller, if I'm thinking of some fixed total change in x, I'm chopping that up into smaller and smaller pieces, more and more pieces. So more and more pieces of the slopes at different points along times the size of the piece give this answer. So now can I jump to the way that I would write this in the limit?

So now let delta x go to 0. And I ask the right hand side, y last minus y first is not changing. y at the end-- I'll write something different, y end minus y start, just to make that same point again. But it's this that's changing. As delta x goes to 0, this becomes dy dx. The little delta x's are going to 0.

Here's the way I write it. So in that limit, I can't legally write that sigma, so this integral symbol is kind of copied from that sigma. But it's telling you that a limit has happened. And in that limit, this is dy dx and this, the notation, is dx. I've got what I predicted here, with s of x there. So what I hope this discussion has, by starting with numbers, by going to algebra, by looking at the sum of those things, which was simple, and then by going to the limit, which was not simple. So a whole lot of limit has been not fully explained, and I think the right thing to do now is to do an example. So let me move to an example.

So I'll take a particular function and follow this process, this limiting process and see what it gives. And it will give us function one and, as a bonus, it will give us a new meaning for function one. Let's do it. So now I'm going to take a particular s of x. So here's x. Let me take s of x to be 2 minus 2x. I didn't want to take one totally simple that I already had started the lecture with, but it's not difficult either. We'll be able to see what's happening here.

OK, so let me graph it, because I want to do this now with the graph. So at x equal 1, s of x has dropped to 0, where when x was 0, it started at 2. So it started somewhere here. Here was 1, halfway down. It's going to come down in a straight line. And let me stop there. It could continue, but let me call y end is going to be 0 and y start is going to be-- well, we'll see about that, sorry. s at the end is 0. S at the end is 0. I don't yet know what y at the end is. It's not 0. So what's my idea? Well, not mine. Newton and Leibniz and a lot of people had these ideas. It's kind of interesting.

So Archimedes. He goes way, way back, before Newton or Leibniz or anybody conceived of them. Archimedes figured out how to deal with a curve with a parabola. Archimedes got from a parabola, he got from x squared, the parabola, back to a height by special ideas. He was one of the great mathematicians of all time. But even Archimedes didn't see what you now see, this connection between function one and function two. If he had seen that, he would have gone further. All right, now let's see it. Let me take a delta x equal to 1/4. So this is delta x here, and this one is two delta x's, and this one is three delta x's, and the one is four delta x's in my original delta x, which is 1/4, which is small but not really small.

So now what do I do? Look at this first period. The slope, the s function, function two-- see, over here is going to be function one. This is going to be the y, the integral of that. But I don't know what it is yet, so it's pretty open to question. OK, so now let's get there. So the point is that over this interval, the slope is changing. It's changing a significant amount. Not too much, but it's changing. And I don't know, from the algebra, I don't know how to deal with that. I'm just going to take a value within this sum value and stay with it within that interval, and I'll take the starting value. So over this first delta x, I'm going to pretend that the slope stays at 2. So I'm pretending that this is my slope function. Then over my next delta x, I'm going to pretend that it stays at probably 1 1/2. And then I'm going to pretend that it stays at 1, and I'm going to pretend that it stays at 1/2.

If you allow me to go back to distance and speed, I'm chopping up the full time, the day, let's say, into four pieces and in each piece, the speed is changing, which I'm not ready to deal with, which algebra isn't ready to deal with. So the best I could do was say OK, so suppose the speed is constant at what it was at the start of that short time. So those would be delta t's rather than delta x's. The s would be representing speed, but no difference in the picture.

So now let me do these things. Now I'm going to do this addition, which won't give me exactly the right y because those rectangles are not exactly right. But I'll get them better by taking smaller delta x's. Let me see, what do I have here? Over this first time, I have my slope, which I'm taking to b 2. So that's the delta y over delta x, that's the s, and then times the delta x. And what is that? We might as well just face it, that that 2 times that delta x, we can think of that as the area in that tall, thin rectangle.

Well, I've introduced the word area for the first time. It never showed up on the previous board. It's the extra insight that's coming today. Now over the second short period, I'm going to keep fix my speed at 1 1/2. 1 1/2 times delta x, because my speed I'm setting at 1 1/2, and this is how long I go so this is a distance or a change in height, a change in y. And you see what's coming. The next one will be a 1 times the delta x, and the last will be 1/2 times the delta x. This is adding the way I did in the algebra. And what do I get? Well, this, again, is the area of that piece. This one is the area of that piece, this one is the area of that piece. I get an overestimate because the true slopes dropped a little within each piece.

I get some quantity which I can figure out, but it's not the right answer. It's not the final answer. And what is now the main step to get there? Chop delta x into half, you could say. Why not cut it in half? Now I'll have a different picture. Can you see what this picture is doing? Now over the first little half of the old step I am up here, but then I drop to here. Can I do this with an eraser? A little bit got chopped away, a little bit got chopped away. Where has it gone? I'm going to have this zig zag. That wasn't too bad.

I'm replacing that with a sum of eight pieces, because delta x is now down to 1/8. This is what we said about that sum. That sum has got more and more terms because it has a term for every little delta x, and the size of that term is about like delta x multiplied by an s. So what I getting in the limit is a kind of running sum, a running counter, a mileage meter, a trip mileage, that's adding up distance based on speed.

Do you see what I'm getting in the graph picture? What happens to the shaded part as delta x gets smaller and smaller? This shaded part is going to be the curve. These little long pieces are going to get reduced, reduced, reduced, and in the end the total height at 1 is going to be-- ta-da, this is the moment-- the area under the slope curve. This y turns out to be the area under the s of x curve, or y.

So at x equal 1, what is it? What's the area out to 1? Well, we've got a triangle there. Its base is 1, its height is 2. The area of a triangle is 1/2 the base times the height, so I have 1/2 times 1 times 2. I've got 1. The area at the end is 1. But-- well, I shouldn't say but. I should let you applaud first. What if I only went that far, halfway? What if that was s end? What if I want to know what is y at x equal 1/2? Then it'll be of course, just the area up to that point.

Can I remove this part of the picture for a moment? I'm always looking at area. And the area of that, do we know what that area would be? It's not a triangle anymore, it's some kind of a trapezoid. As delta x goes to 0, I'm going to get the correct area, which will be what? Let's see, I have 1/2 as the base and the average height is about 1 1/2. Can I do that little calculation? The base is 1/2 and the average height is 1 1/2. I think I get 3/4. So halfway along, it's got up to 3/4. Where is 3/4? So this is 1, this is 3/4, this is 1/2, this is 1/4. So at 1, it's at 3/4. Halfway along, its at 3/4.

I would like to know that graph now. I'm ready to jump to the limit. Let me do it the way I said at the very start of the lecture. Let me take this and try to guess. So, I'm taking a shortcut. Because do we go through this horrible process every time we want to do an integral? Of course we don't. The best way is, can we find a y function, a function, one, that has that derivative? Let's just try it. I'm allowed to take it in two pieces, that's a very valuable fact. So what has the derivative 2? If the slope is 2, what's the function? If the speed is 2, what's the distance? It's constant speed, 2, times the total distance. The slope of the 2x line is 2, clearly.

What about the 2x? Which function has the slope 2x? Well, we saw it over here. The function that has the slope 2x is x squared, because when I take the slope of x squared, the 2 comes down. The 2 shows up, I have one smaller power, x to the first power. This is the correct y, and I hope that my graph gets those points right. At x equal to 1, this is 2 minus 1, this is the correct height, 1. At x equal to 1/2, all right, here is the moment of truth. Now set x equal to 1/2, and what do you get for this y? You get 2 times 1/2-- that's 1-- minus 1/2 squared, 1/4. Hey, miracle. 3/4. This area I figured to be 3/4 and this approach also gave 3/4. Either way, multiplying those is 3/4, subtracting those is 3/4.

What does my graph look like? What does the graph of that look like? What's the slope at the start? The slope at the start is s at the start. And s at the start, when x is 0, the slope is 2. So it starts out with a slope of 2. But it's slowing down, it's a little bit like this one where the car was slowing down, we're not picking up distance so quickly, we're not picking up height so quickly. But we're still going forward, we're still picking up some height. So it starts with a slope of 2, bends around to there, and I guess maybe that is-- yes. That picture is almost good, but not great. So the slope is 2 and there.

And what is the slope at this point? You can't tell from my picture, which isn't perfect. The slope, I'm told what it is. When x is 1, the slope is 2 minus 2. Slope 0. The slope is 0. We're not picking up any more height, any more area. And of course, that's right. At this point, we're not picking up more area. If I continue beyond here, we're losing area because below the axis, I'll count as negative area just because if it was speed, I'd be going backwards. That's what will happen here. I'll start down. If that continued, this would still be the correct thing to graph.

If I do graph it, that's actually the top at x equal 1, and then it starts down and probably by, I don't know where, x equal something, maybe by x equal 2. Oh yeah, you can see. By x equal to 2, it's got down to 0 again. When x is 2, this is now 0 and you can see that when x is 2, we'll have the bad area-- the car going backwards-- will be identical to the forward area. The total area is 0, and I'll be at this point when x is 2.

Let me just recap a moment. Today was about going from function two back to function one. The quickest way to do it is to find a function one that gives that function two and then you're in. But if you can't do that or if you want to understand what the real, behind it, limiting process is, it's like the algebra but it's this expression here that's concealing so much mathematics. Delta x going to 0, these ratios going to the actual function, and the delta x I replaced by the symbol dx, indicating an infinitesimal. We'll see it more. Thank you.

NARRATOR: This has been a production of MIT OpenCourseWare and Gilbert Strang. Funding for this video was provided by the Lord Foundation. To help OCW continue to provide free and open access to MIT courses, please make a donation at ocw.mit.edu/donate.