 One of the main applications of calculus is determining how one variable changes in relation to another. A marketing manager wants to know how profit changes with respect to the amount of spent on advertising. Maybe a physician wants to know how a patient's reaction to a drug changes with respect to the dose. And so this leads to the following definition which we've actually seen many times before but let's put in the context of calculus now. Let f of x be a function defined on the interval a to b. Then the average rate of change of f of x with respect to x for the function f as x changes from a to b is given by this so-called difference quotient, f of b minus f of a over b minus a. We abbreviate this as delta y over delta x for which this delta here, it looks like a triangle but this is actually the Greek letter delta. You often see it maybe in like a fraternity or sorority or something like that. It's just like the Greek equivalent of capital D. In this case, delta is short for difference because if we look at like delta y versus delta x, well, the a and b, these are x coordinates. These are numbers in the domain. So delta x dx is b minus a. This is a difference of the x coordinates as opposed to delta y, delta y which is f of b minus f of a. f of a after all is just the y coordinate which corresponds to x equals a on the graph of y equals f of x. And likewise, f of b is just the y coordinate of b of the point associated to b on the graph of y equals f of x right there. So that's what this means is this difference quotient is just the difference of the y coordinates divided by the x coordinates. Sometimes you might call this rise over run that is rise represents a change of the vertical. If things are rising, they're going up or going down I suppose if there's a negative rise, run on the other hand unless you're Spider-Man we have to run horizontally. And so that's a change of a horizontal displacement right there will rise over run. We've often seen in geometry this is referring to the slope of a line. This is the slope formula. And this is what we talked about in the previous video of our lecture series how the average rate change measures the slope of a secant line of a function. That's all that average rate of change is about. And so let's take a look at this not necessarily from geometric permative view but let's think of it from more of just a story problem point of view. Suppose a car is stopped out of traffic light when the light turns green the car begins to move along the straight road forward. Assume that the distance traveled by the car is given by the function s of t equals three t squared for the first 15 seconds. So as t is between zero and 15 seconds t will be measured in seconds s of t will be measuring distance in feet right here. So what is the exact speed of the car at 10 seconds? So this is a very critical question right here because we might be like, okay if I plug in t equals 10, I would find the distance like we can compute what s of 10 is this is gonna be three times 10 squared which would be three times 100 we're gonna end up with 300 feet. So after 15 seconds the car according to this model would have traveled 300 feet in distance. And I should mention that this formula here is actually quite it's a good formula this is within the laws of physics and things like this is quite feasible thing. But we don't wanna know how far it's went we wanna know what its speed is. What is speed in relation to distance? Well speed thinking about that if you have a higher speed that means you go a farther distance well maybe for a fixed point of time. Speed this is an important thing to keep track of speed is a measurement of distance per time. Right in the United States when we drive on the highway or on our roads we typically are driving a speed measured in miles per hour. We can often use the units of our scientific measurements here to get some idea of how these things are related to each other. If speed is measured in miles per hour or kilometers per hour or something like that we have a distance per in this case means division per unit of time. In physics you might talk about so particles moving at so many feet per second such and such. And so speed is gonna be this distance divided by time. So really if we use the average rate of change of our distance function this is an important thing to remember here. If we take the average, well let me let's just use the symbols we had from the previous slide. We take delta S divided by delta T. So the delta S represents a change of position the delta T represents a change of time. This is the average rate of position the average rate of change of position with respect to time. This is what one would call average speed. So we can get a measurement of what the speed is using this delta S over delta T. Now the problem though is if we do try to just compute this right if we try to take delta S over delta T if we do this at the moment where T equals 10 we're gonna end up with S of 10 minus S of 10 over 10 minus 10 which we end up with 300 minus 300 over 10 minus 10. We end up with zero over zero. That's not a speed. Zero over zero is not a number. So that didn't work. The problem is that the difference quotient measures a change of two points. We have to have two different points in time here. So in order to compute the so-called instantaneous speed or what we call the instantaneous rate of change at an exact point in time we could try approximating the exact we could try to approximate the exact speed using average speed where we make the increments smaller and smaller and smaller. So for example, what if we looked at the change of S with the change of T on the time interval let's say 10 to 10.1. So what if we look at just a tenth of a second from this moment of 10 seconds, right? What if we just look at a small time, right? A tenth of a second isn't very huge. In which case then we would have to look at S of 10.1 minus S of 10 over 10.1 minus 10. The denominator of course is just gonna be 0.1 it's just the length of the time interval right there. In the numerator S of 10 we already did that's 300 by a similar calculation if you take 10.1 and you square that you're gonna get and then times that by three you'll get 306.03. Like so in the numerator when you subtract those and divide that by 0.1 you'll end up with 60.3 and this will be measuring of course feet per second, right? Our distance measurement is in feet and our time measurement is in seconds here. So we see that the average rate of change will measure this average speed as feet per second. So in that tenth of a second after 10 seconds we see that the average the car's average speed was 60.3 feet per second. So that's an average that doesn't tell you how fast it was at 10 seconds but it gives you an approximation. It's gonna be somewhere close to 60 feet per second. But you know what? Why do we use a tenth of a second? Why didn't we try like a hundredth of a second if we take T of S over T delta T, excuse me delta S over delta T as you range from 10 seconds to 10.01 seconds. If we use a smaller unit of time we're gonna get S of 10.01 minus S of 10 over 10.01 minus 10 here. Well the denominator will be a 100th of a second now and then the numerator you're gonna take S of 10.01 which would be 10.01 squared times that by three you get 300.6003 minus the 300. That'll simplify becomes 60.03 feet per second like so. So as we shrunk the time interval we got closer to the true value of the speed at T equals 10 which we can see that our first estimate was 60.3 then our next estimate was 60.03. Well, why stop there? Why not take the time interval to be even smaller? What if we take 1,000th of a second? So we go from 10 seconds to 10.001 seconds. How would that affect things? A smaller time interval? That's a really small timeframe right there. 1,000th of a second. So we'd have to do S of 10.001 minus S of 10 just so we're clear. Whoops. That's a one right there. Let me use a different color. 0.01. If we put that into S, we're gonna see that turns out to be 300.60003 as we know S of 10 is 300. And then the denominator looks like 10.11,000th minus 10 which the difference will be 1,000th. And so when you compute that simplify that fraction we'll end up with 60.003 feet per second. And so what we're seeing here is the following pattern. What seems to happen as T approaches 10, we seem to be getting that delta S over delta T is approaching 60 feet per second. Now, of course 60 feet per second is roughly around 40 miles per hour. It was quite reasonable speed for a car. And so that seems very plausible, right? And so notice this idea that we're shrinking the interval down, down, down. We're approaching closer and closer to 10 seconds exactly, right? We can't just plug in 10 as the left bound and the right bound who's got zero over zero. But if we make the interval smaller and smaller and smaller we can better approximate the exact speed at 10 seconds. If this process sounds familiar to you at all that's because this is the limit process. This is what limits are all about. In order to calculate the best approximation because after all we're rounding to 60 but this is not the right answer necessarily to find the best approximation we really wanna take a limit. And so what's the limit that we're considering right here? What we should be considering is the so-called instantaneous speed which would be denoted DS DT at 10 seconds. This is gonna be the limit. This is the limit as delta T approaches zero of delta S over delta T. So we want the denominator to go to zero when we calculate this. So and then not T equals zero, sorry T equals 10. We wanna figure out what happens at 10 seconds right here. And so if we pull this apart from what we saw above let's say that we have this S of 10 we need to do 10 seconds but then we wanna be something a little bit bigger than 10. So let's take S of say 10 plus H where H is just a little bit bigger than 10 like we were doing before H was 0.1, 0.01, 0.02. And so therefore the denominator is gonna look like 10 plus H that's the second time stamp the first time stamps can be 10. And so this situation we can then say let's calculate the limit as H approaches zero right here. And so if we can't just plug in H equals zero here you'll notice that the denominator simplifies just to be an H, the 10 minus 10 so cancel out there, we see that. With the function we don't necessarily get that cancellation we get S of 10 plus H minus S of 10 but S of 10 we know that to be 300. And so we need to figure out the limit as H approaches zero in this situation. Well perhaps like other limits of difference quotients we've seen perhaps we could simplify this quotient in order to calculate the limit exactly, all right? So let's take S of 10 plus H for a moment let's consider that. Well the function S of T was three times T squared so we're gonna get three times 10 plus H squared minus 300 all over H as H goes to zero. Like so let's expand the numerator just by foiling that thing out you're gonna get three times 100 plus you're gonna get a 20 H plus H squared if you go through the details of the foil you can see where that came from. This all sits above H as H approaches zero. Notice here we could distribute this three through and if you distribute the three through you're gonna get three times 100 which is 300 that's gonna cancel with this 300 that's right there. And so what didn't get canceled out? We end up with a 60 H plus three H squared all over H taking the limit as H approaches zero. The numerator we, because we still have that division by zero in the denominator we don't want that. So what we could do is we could factor the numerator recognizing everyone in the numerator is divisible by H. This seems like a pattern we've seen somewhere before you get 60 plus three H all over H and so we're gonna cancel out that H there. But notice we're still taking the limit as H approaches zero. But now in this situation because the division by H is no longer the denominator the division by zero is no longer a problem. Using continuity of limits we then get that the limit as H approaches zero be 60 plus three times zero. And so we end up with the limit being 60 that is 60 feet per second. Like we were estimating it was going to be from before. So in summary what we just saw from that example is that the instantaneous rate of change for a function X when X equals A is the limit here. The limit as X approaches A of F of A plus H minus F of A all over H. So you'll notice what we see right here. So A is our sort of our target value. We wanna get close to X equals A but we can't just plug in X equals A there because we'll end up with zero over zero. These difference quotients always look like zero over zero. So we're taking a small perturbation of A that is we just go a little bit to the right or a little bit to the left of A. This is small amount we call it H right here and we get this formula right here. But of course alternatively we could define the instantaneous rate of change to be more closely resembling of the average rate of change form we saw earlier. This would give you something like this, the limit as B approaches A of F of B minus F of A over B minus A. I want you to convince yourself that these two definitions are exactly the same thing because notice the bottom right here, right? H is just the difference of B minus A. H just measures how close A and B are to each other. So if I add A to both sides, you're gonna see that A plus H is equal to B. And so you see that right here A plus H and B, those are identical and then H versus B minus A, they're the same. So if you want it to look like the slope formula you can, but from practice, when it comes to simplifying difference quotients, having just this single H in the denominator is typically getting the easier algebraic chore than having the more straightforward slope variant. But both of these will give us the instantaneous rate of change of a function. Now, if we return to another question about distance and speed, the instantaneous speed of an object is gonna be the limit of the average speeds or in physics, more properly referred to this thing as the velocity of the object. What's the difference between velocity and speed? Well, speed itself is a signless number. There's no such thing as negative speed. You can drive either 30 miles per hour forward, you can drive 30 miles per hour back. The speed is still 30 miles in both directions. On the other hand, velocity is the signed speed. That is it's speed with a direction. Speed's always positive, in which case instantaneous speed, average speed, those always can be positive numbers, but velocity could be positive or negative. So if we're driving forward in the positive direction, we'd call that positive velocity. If we were driving backward, what we say is the backward direction, we'd call that a negative velocity. So if we get positive or negatives, that's okay. Driving 10 miles per hour negative just means we're driving backwards 10 miles per hour. So that's the difference between velocity. It's a more precise quantity when it comes to science. So if you hear us talk about velocity, it's essentially the same thing with speed, but it also has direction built into it. So the distance and feet of an object from a starting point is given by the function S of T is given to two T squared minus five T plus 40, where T is measuring time in seconds and S of T is measuring distance in feet. Now again, don't worry about the derivation of these formulas. Where do these formulas come from? These are reasonable formulas that one can get from application of physics, particularly Newton's law of motions and things like that. So don't worry about that. Just this is a mathematics course. Let's just focus on the mathematical side of things. Don't worry about the origin of these equations. These are reasonable physical equations for these type of settings here. So let's find the average velocity of the object as it goes from two seconds to four seconds. If you want the average velocity, we'll call delta S over delta T. The delta here represents a distance and then we have a difference quotient right here. So this is gonna look like S of four minus S of two over four minus two. When it comes to average rates of change or average velocities, I always prefer the more slope approach to these things. So what is gonna be S of four? We're just gonna plug four into our function into these locations, right? So you get four squared, which is 16 times that by two. You get 32, four times, so we have 32 there, five times four is gonna be negative 20 there, plus 40. So when you add those together, we end up with 52, one more nice and done. So we're gonna get 52 right here. Similar thing if you plug in two, if you plug in a two here and here, you're gonna end up with eight minus 10 plus 40, for which case you get a 38 in that situation. Let me erase that. And this is over the difference of time, four minus two. And so combining those things, 52 minus 38 is 14, and four minus two is two, which simplifies to be seven, seven, what? As these are story problems, units are very critical in this application. Our speed is gonna be measured in seven feet per second. That would be the average speed of our object. We don't know what it is, some particle, something's moving, but seven feet per second is how quickly it's moving. Now, on the other hand, we might ask ourselves, what's the instantaneous velocity at four seconds? So the instantaneous velocity, we can't use the difference quotient by itself, because if we try to take the difference quotient, delta S over delta T, when you take T here to equal four, well, you're gonna get S of four minus S of four over four minus four, you're gonna end up with zero over zero. You can't do much with that, but zero over zero suggests to us when you take a limit. So instead, the instantaneous velocity, we'll denote this as dS dt as T is equal to four. Even better, this is abbreviated as V, V for velocity here. This is gonna be the limit. The limit as H goes to zero of the function, we're gonna take S of four plus H minus S of four, and this will sit above H. So we wanna simplify this difference quotient right here. So the function S, which we saw above, remember that's two T squared minus five T plus 40. So we need to put that in, we have to replace all the T's with the four plus H. So to do that, we're gonna get two times T squared. So we replace the T with four plus H, we're gonna square it. Then we get minus five times T, the T will be replaced with a four plus H, and then we're gonna get a plus 40, like so. We need us to track from that S of four. S of four, we already calculated on the previous part, and that's gonna be 52 feet, and then the denominator turns out to be an H as H goes to zero. So our goal is to simplify the numerator so we can find a factor of H that can cancel with the H in the denominator. So we need to expand the numerator to combine some like terms. That's what our goal is gonna have to be. So take the four plus H, foil that out. You're gonna get 16 plus eight H plus H squared. Distribute the negative five right there. You're gonna get negative 20 minus five H, and then you're gonna get a positive 40 minus 12. I guess the 40 and the negative 52 could combine together. That'll give us a negative 12 at this venture over H. We could also combine together this negative 20 and this negative 12 right there. That's gonna give us a negative 32 right there. We have a negative five H, and then distribute the 16 on, excuse me, distribute the two onto the 16 to eight H and the H squared. You're gonna get a 32. You're going to get a 16 H, and then, oh boy, should have squeezed it in there a little bit better. You're gonna get a two H squared right there. Still as we're taking the limit as H goes to zero all above H. Now notice what happened to our constants. We had a positive 32 that cancels to the negative 32. All the constants cancel out. That's so amazing. It's not a coincidence. Please don't take my animation to think any more than sarcasm here. We see that what didn't get canceled out. We have a two H squared. We have a 16 H minus a five H. That's gonna give us an 11 H, and this will then sit above an H like so. So factoring an H from the numerator, because everyone's now divisible by H. You can take out an H leaves behind a two H plus 11. This sits above the H as H goes to zero. Cancel the factor of H from the denominator and the numerator there. And so now we're left with a two H plus 11, which if we'd send H to zero out, now there's no division by zero problem. We'll end up with two times zero plus 11, which then tells us that our object is moving at exactly 11 feet per second. So above, right, we saw that the average, the average speed delta S with delta T as we went from two to four, that turned out to be 14 feet per second, which relatively speaking was a good estimate of 11 feet per second. But the thing is we shrink the interval from two to four if we slide to closer and closer and closer to four, when we take the limit of this approach, we'll see that the instantaneous velocity was 11 feet per second.