Integrals

Too often in math, we dive into showing that a certain fact is true with a long series of formulas before stepping back and making sure that it feels reasonable and preferably obvious, at least at an intuitive level. In this lecture, we are going to talk about integrals, and that they are an inverse of derivatives. Here, we're just going to focus on one example. Imagine that you're sitting in a car, and you can't see out the window. All you see is the speedometer.

At some point, the car starts moving, speeds up, and then slows back down to a stop, all over the course of 8 8 seconds. The question is, is there a nice way to figure out how far you've traveled during that time based only on your view of the speedometer, or better yet, can you find a distance function, s of t, that tells you how far you've traveled after a given amount of time, t, somewhere between 0 0 and 8 8 seconds? Let's say that you take note of the velocity at every second, and you make a plot over time that looks something like this. And maybe you find that a nice function to model that velocity over time in meters per second is v of t equals t times 8 8 minus t. You might remember, in chapter 2 2 of the series, we were looking at the opposite situation, where you knew what a distance function was, s of t, and you wanted to figure out the velocity function from that.

There, I showed how the derivative of a distance versus time function gives you a velocity versus time function. So in our current situation, where all we know is velocity, it should make sense that finding a distance versus time function is going to come down to asking what function has a derivative of t times 8 8 minus t. This is often described as finding the anti-derivative of a function, and indeed, that's what we'll end up doing, and you could even pause right now and try that. But first, I want to spend the bulk of this video showing how this question is related to finding the area bounded by the velocity graph, because that helps to build an intuition for a whole class of problems, things called integral problems in math and science.

To start off, notice that this question would be a lot easier if the car was just moving at a constant velocity, right? In that case, you could just multiply the velocity in meters per second times the amount of time that has passed in seconds, and that would give you the number of meters traveled. And notice, you can visualize that product, that distance, as an area, and if visualizing distance as area seems kind of weird, I'm right there with you. It's just that on this plot, where the horizontal direction has units of seconds and the vertical direction has units of meters per second, units of area just very naturally correspond to meters.

But what makes our situation hard is that velocity is not constant. It's incessantly changing at every single instant. It would even be a lot easier if it only ever changed at a handful of points, maybe staying static for the first second and then suddenly discontinuously jumping to a constant 7 7 meters per second for the next second, and so on, with discontinuous jumps to portions of constant velocity.

That would make it uncomfortable for the driver. In fact, it's actually physically impossible, but it would make your calculations a lot more straightforward. You could just compute the distance traveled on each interval by multiplying the constant velocity on that interval by the change in time, and then just add all of those up.

So what we're going to do is approximate the velocity function as if it was constant on a bunch of intervals, and then, as is common in calculus, we'll see how refining that approximation leads us to something more precise. Here, let's make this a little more concrete by throwing in some numbers. Chop up the time axis between 0 0 and 8 8 seconds into many small intervals, each with some little width dt, something like 0.25 0.25 seconds.

Now consider one of those intervals, like the one between t equals 1 1 and 1.25. In reality, the car speeds up from 7 7 meters per second to about 8.4 8.4 meters per second during that time, and you could find those numbers just by plugging in t equals 1 1 and t equals 1.25 1.25 to the equation for velocity. What we want to do is approximate the car's motion as if its velocity was constant on that interval. Again, the reason for doing that is we just don't really know how to handle situations other than constant velocity ones.

You could choose this constant to be anything between 7 7 and 8.4. It actually doesn't matter. All that matters is that our sequence of approximations, whatever they are, gets better and better as dt gets smaller and smaller. The treating this car's journey as a bunch of discontinuous jumps in speed between portions of constant velocity becomes a less wrong reflection of reality as we decrease the time between those jumps.

So for convenience, on an interval like this, let's just approximate the speed with whatever the true car's velocity is at the start of that interval, the height of the graph above the left side, which in this case is 7. 7 period So in this example interval, according to our approximation, the car moves 7 7 meters per second times 0.25 0.25 seconds. That's 1.75 1.75 meters, and it's nicely visualized as the area of this thin rectangle. In truth, that's a little under the real distance traveled, but not by much.

And the same goes for every other interval. The approximated distance is v of t times dt. It's just that you'd be plugging in a different value for t at each one of these, giving a different height for each rectangle.

I'm going to write out an expression for the sum of the areas of all those rectangles in kind of a funny way. Take this symbol here, which looks like a stretched S for sum, and then put a 0 0 at its bottom and an 8 8 at its top, to indicate that we'll be ranging over time steps between 0 0 and 8 8 seconds. And as I said, the amount we're adding up at each time step is v of t times dt.

Two things are implicit in this notation. First of all, that value dt plays two separate roles. Not only is it a factor in each quantity that we're adding up, it also indicates the spacing between each sampled time step.

So when you make dt smaller and smaller, even though it decreases the area of each rectangle, it increases the total number of rectangles whose areas we're adding up, because if they're thinner, it takes more of them to fill that space. And second, the reason we don't use the usual sigma notation to indicate a sum is that this expression is technically not any particular sum for any particular choice of dt. It's meant to express whatever that sum approaches as dt approaches 0. 0 period And as you can see, what that approaches is the area bounded by this curve and the horizontal axis.

Remember, smaller choices of dt indicate closer approximations for the original question, how far does the car actually go? So this limiting value for the sum, the area under this curve, gives us the precise answer to the question in full unapproximated precision. Now tell me that's not surprising. We had this pretty complicated idea of approximations that can involve adding up a huge number of very tiny things, and yet the value that those approximations approach can be described so simply.

It's just the area underneath this curve. This expression is called an integral of v of t, since it brings all of its values together, it integrates them. Now at this point you could say, how does this help? You've just reframed one hard question, finding how far the car has traveled, into an equally hard problem, finding the area between this graph and the horizontal axis.

And you'd be right. If the velocity-distance duo was the only thing that we cared about, most of this video, with all of the area under a curve nonsense, would be a waste of time. We could just skip straight ahead to finding an antiderivative.

But finding the area between a function's graph and the horizontal axis is somewhat of a common language for many disparate problems that can be broken down and approximated as the sum of a large number of small things. You'll see more in the next video, but for now I'll just say in the abstract that understanding how to interpret and how to compute the area under a graph is a very general problem-solving tool. In fact, the first video of this series already covered the basics of how this works.

But now that we have more of a background with derivatives, we can actually take this idea to its completion. For a velocity example, think of this right endpoint as a variable, capital T. So we're thinking of this integral of the velocity function between 0 0 and T, the area under this curve between those inputs, as a function where the upper bound is the variable. That area represents the distance the car has traveled after T seconds, right? So in reality, this is a distance versus time function, S of T. Now ask yourself, what is the derivative of that function? On the one hand, a tiny change in distance over a tiny change in time, that's velocity.

That is what velocity means. But there's another way to see this, purely in terms of this graph and this area, which generalizes a lot better to other integral problems. A slight nudge of dt to the input causes that area to increase, some little ds represented by the area of this sliver.

The height of that sliver is the height of the graph at that point, v of T, and its width is dt. And for small enough dt, we can basically consider that sliver to be a rectangle. So this little bit of added area, ds, is approximately equal to v of T times dt.

And because that's an approximation, think it's better and better for smaller dt. The derivative of that area function, ds, dt, at this point equals vT, the value of the velocity function at whatever time we started on. And that right there, that's a super general argument.

The derivative of any function giving the area under a graph like this is equal to the function for the graph itself. So if our velocity function is T times 8 8 minus T, what should S be? What function of T has a derivative of T times 8 8 minus T? It's easier to see if we expand this out, writing it as 8T minus T squared, and then we can just take each part one at a time. What function has a derivative of 8 8 times T? Well, we know that the derivative of T squared is 2T.

So if we just scale that up by a factor of 4 4, we can see that the derivative of 4T squared is 8T. And for that second part, what kind of function do you think might have negative T squared as a derivative? Well, using the power rule again, we know that the derivative of a cubic term, T cubed, gives us a square term, 3T squared. So if we just scale that down by a third, the derivative of 1 1 3rd T cubed is exactly T squared.

And then making that negative, you'd see that negative 1 1 3rd T cubed has a derivative of negative T squared. Therefore, the anti-derivative of our function, 8T minus T squared, is 4T squared minus 1 1 3rd T cubed. But there's a slight issue here.

We could add any constant we want to this function, and its derivative is still going to be 8T minus T squared. The derivative of a constant just always goes to zero. And if you were to graph S of T, you could think of this in the sense that moving a graph of a distance function up and down does nothing to affect its slope at every input.

So in reality, there's actually infinitely many different possible anti-derivative functions. And every one of them looks like 4T squared minus 1 1 3rd T cubed plus C, for some constant C. But there is one piece of information that we haven't used yet that's going to let us zero in on which anti-derivative to use. The lower bound of the integral.

This integral has to be zero when we drag that right endpoint all the way to the left endpoint, right? The distance traveled by the car between zero seconds and zero seconds is, well, zero. So, as we found, the area as a function of capital T is an anti-derivative for the stuff inside. And to choose what constant to add to this expression, what you do is subtract off the value of that anti-derivative function at the lower bound.

If you think about it for a moment, that ensures that the integral from the lower bound to itself will indeed be zero. As it so happens, when you evaluate the function we have right here at T equals 0 0, you get 0. 0 period So in this specific case, you actually don't need to subtract anything off. For example, the total distance traveled during the full 8 8 seconds is this expression evaluated at T equals 8 8, which is about 85.33 85.33 minus 0. 0 period So the answer as a whole is just 85.33. But a more typical example would be something like the integral between 1 1 and 7. 7 period That's the area pictured right here, and it represents the distance traveled between 1 1 second and 7 7 seconds.

What you do is evaluate the anti-derivative we found at the top bound, 7 7, and then subtract off its value at that bottom bound, 1. 1 period And notice, by the way, it doesn't matter which anti-derivative we chose here. If for some reason it had a constant added to it, like 5 5, that constant would just cancel out. More generally, any time you want to integrate some function, and remember, you think of that as adding up values f of x times dx for inputs in a certain range, and then asking what does that sum approach as dx approaches 0 0? The first step to evaluating that integral is to find an anti-derivative, some other function, capital F, whose derivative is the thing inside the integral.

Then, the integral equals this anti-derivative evaluated at the top bound minus its value at the bottom bound. And this fact right here that you're staring at is the fundamental theorem of calculus. And I want you to appreciate something kind of crazy about this fact.

The integral, the limiting value for the sum of all of these thin rectangles, takes into account every single input on the continuum from the lower bound to the upper bound. That's why we use the word integrate, it brings them all together. And yet, to actually compute it using an anti-derivative, you only look at two inputs, the top bound and the bottom bound.

It almost feels like cheating. Finding the anti-derivative implicitly accounts for all of the information needed to add up the values between those two bounds. That's just crazy to me.

This idea is deep, and there's a lot packed into this whole concept. So let's just recap everything that just happened, shall we? We wanted to figure out how far a car goes just by looking at the speedometer. And what makes that hard is that velocity is always changing.

If you approximate velocity to be constant on multiple different intervals, you could figure out how far the car goes on each interval just with multiplication, and then add all of those up. Better and better approximations for the original problem correspond to collections of rectangles, whose aggregate area is closer and closer to being the area under this curve between the start time and the end time. So that area under the curve is actually the precise distance traveled for the true nowhere constant velocity function.

If you think of that area as a function itself, with a variable right endpoint, you can deduce that the derivative of that area function must equal the height of the graph at every point. And that's really the key right there. It means that to find a function giving this area, you ask, what function has v of t as a derivative? There are actually infinitely many antiderivatives of a given function, since you can always just add some constant without affecting the derivative.

So you account for that by subtracting off the value of whatever antiderivative function you choose at the bottom bound. By the way, one important thing to bring up before we leave is the idea of negative area. What if the velocity function was negative at some point, meaning the car goes backwards? It's still true that a tiny distance traveled, ds, on a little time interval is about equal to the velocity at that time multiplied by the tiny change in time.

It's just that the number you'd plug in for velocity would be negative, so the tiny change in distance is negative. In terms of our thin rectangles, if a rectangle goes below the horizontal axis like this, its area represents a bit of distance traveled backwards. So if what you want in the end is to find a distance between the car's start point and its end point, this is something you're going to want to subtract.

And that's generally true of integrals. Whenever a graph dips below the horizontal axis, the area between that portion of the graph and the horizontal axis is counted as negative. And what you'll commonly hear is that integrals don't measure area per se, they measure the signed area between the graph and the horizontal axis.

Next up, I'm going to bring up more context where this idea of an integral and area under curves comes up, along with some other intuitions for this fundamental theorem of calculus. Maybe you remember, chapter 2 2 of this series, introducing the derivative, was sponsored by the art of problem-solving. So I think there's something elegant to the fact that this video, which is kind of a duel to that one, was also supported in part by the art of problem-solving.

I really can't imagine a better sponsor for this channel, because it's a company whose books and whose courses I recommend to people anyway. They were highly influential to me when I was a student developing a love for creative math. So if you're a parent looking to foster your own child's love for the subject, or if you're a student who wants to see what math has to offer beyond rote schoolwork, I cannot recommend the art of problem-solving enough.

Whether that's their newest development to build the right intuitions in elementary school kids called Beast Academy, or their courses in higher level topics and contest preparation, going to aops.com slash 3blue1brown, or clicking on the link in the description, lets them know that you came from this channel, which may encourage them to support future projects like this one. I consider these videos a success not when they teach people a particular bit of math, which can only ever be a drop in the ocean, but when they encourage people to go and explore that expanse for themselves. And the art of problem-solving is among the few great places to actually do that exploration.