Welcome back everyone, this is going to be the second video in our lesson on tangent lines. You remember in the last video, we closed by unpacking this rather opaque formula. F prime of a is equal to to the limit, if h goes towards 0, of f(a) + h- f(a) over h. What we're going to do in this video is really dive into that formula in a very explicit concrete example. So the example the only example you're going to see this entire video if we're going to look at the graph of the function f(x) = x squared, which is what I've drawn here. And we're going to focus on three notional points on the graph. I'm not going give them names but that's where I label them on the x and y axes. Whoops, forgot to label my axes. Here's the x-axis, here's the y-axis. And this is the graph of y = x squared. You'll recall this expression f'(a) is equal to the limit, blah, blah, blah, is a number, and what is that number? It's the slope of the tangent line to the graph of the function y = x at the input value x = a. In other words, the slope of that little nugget of a line there. I only drew part of the line because I don't want to make the figure too cluttered. But if I extended that line in all directions, that would be the tangent line to that graph. We're going to calculate that. Before we do though, let's remind us, take ourselves and look at it and say should that be positive or negative? That should be positive, the slope of that little line segment is positive. Therefore, whatever f prime of a is, it better be positive, not negative. That's always a good thing to do before calculating is kind of reality check your answers. because everyone make errors but you may as well want to catch them. Okay, suppose instead of a we started with x = b. So we ask the question what's f prime of b? What's the slope of this little red tangent line? Not only should it be positive, but it should be greater than f prime of a. In other words, whatever we calculate, the f prime of b, whatever it turns out to be, better be bigger than f prime of a, which itself better be bigger than 0. On the other hand, suppose we calculated f prime of c. The slope of this little nugget of a tangent line. That's negative, right? because it's going down. So it better be that 0 is greater than f prime of c, whatever it is. Okay, fine. So now what we're going to do is we're literally going to go in and work out this expression explicitly. Now, word of warning, a lot of what you learn in calculus, the sort of dirty, awful stuff that we're not going to teach here, is lots and lots of tricks for evaluating derivatives you have to get around this limit. But it's actually really instructive. And a simple example to work explicitly with this definition. So we're going to show you how to get the formula for the derivative from this definition, and let's just compute. So f prime of a = limit of h goes to 0, and f(a) + h minus f(a) over h. That's always true. But in this case we have a formula for f(ax). Okay, so this is equal to the limit as h goes to 0, divided by h. Okay, what's f(a)? If f(x) equals x squared, then f is just a machine which turns input into input squared. So f(a) is a squared. So I'm going to subtract an a squared. On the other hand, suppose they feed in the input a + h to the machine. What does the machine do with that input? It squares that entire input and outputs a + h quantity squared. Okay, so we have the limit as h goes to 0 of (a+h) squared- a squared/h. For the moment, don't be scared of this limit. Let's let it go along for the ride. This is equal to the limit if h goes to 0. Expand that out, I get a squared + 2ah + h squared- a squared over h. Great, these a squareds cancel. I can factor out an h is equal to the limit of h goes to 0 of h times 2a + h divided by h. Just algebra, nothing to be scared about, simple shuffling around. Doesn't really matter. Notice I have an h on the top and the bottom. We know what to do with that in algebra class. It doesn't really matter what the h is, I can cancel it. So it's then equal to the limit. As h goes to 0 of 2a + h. Okay, so far we've avoided talking about what limits are. Here we can't get away without even think about it. This is equal to, if h is tiny, this is 2a plus a tiny number, the limit as h goes to 0. I'll make the arrow is a little bit better. As h goes towards 0, says if h gets smaller and smaller, what is this approaching? Well we can essentially set h equal to 0 here because it's going away. because it's equal to 2a. In other words my conclusion is that no matter what a is, derivative of the function f at the point x = a is equal to 2a. That's really interesting, let's see if that makes sense. So what what that says is okay, first of all a is positive, if a is positive and so this a 2 times a is positive, that's great since. On the other hand using the same exact things here, a wasn't really special. I can also get in this particular case f prime of b is going to be 2b. All right, sort of, monkey see monkey do, plug in the a for the b, and so on. And notice, if a is less than b, then 2a is less than 2b, so we make this happy here. As you move from a to b, and you think about how that tangent line is moving, it's getting more and more positive as you're going, which makes sense. On the other hand f prime of c is 2c, okay, and look c is negative, so 2c is negative, that makes a lot of sense. Now suppose we make c more and more negative? So we move the x value along to the left, notice the slope is getting more and more negative steeper down, down, down which makes senses as well. Okay, hopefully, I've convinced you that makes sense. Let's wrap all that knowledge together. Let's integrate it into the next screen. Okay, what have I drawn here? I have again, in green, the graph of f(x) = x squared. Now instead of telling you a fixed reference point, I've drawn this blue line here. And I'm claiming so the equation of that line is y = 2x, but I've written this expression f prime (x) = 2x. So what does that mean? Normally we think about a derivative as a number, it's the slope at this value or at this value or at this value. But this guy here is derivative function. In other words if f(x)=x squared is a function that takes in as input x and returns as output x squared. f prime (x) is a derivative input output machine. It takes in as in output x and returns as output the slope of the tangent line to the graph of f(x) = x squared, at the input value x. So let's think about why that's true. If we look at f prime of x = 2x, what's true about that line? When x is positive, 2x is positive, as x get more and more positive, 2x gets more and more positive. And that's right, right? So in other words, if I take this value here, where that hits the blue line, that number is suppose to tell me the slope of the tangent line right there. If I take this value, where that hits the blue line, that number, it's supposed to tell me the slope of the tangent line, right there, and that's good. That number is higher than that number, and that slope is more positively steeped than that slope. Cool, on the other hand, when x is negative, the blue line gives you a negative value. As you make x more and more negative, it gives you more, and more a negative value, which is great if x is right here. The y value on that blue line there should be the slope of the tangent line to this curve, which makes sense. Look, it's pretty negative, it's pointing steeply down. Notice, by the way, if we look at this and take this literally, f prime of 0 = 2 times 0, which is 0. What that is saying is that when x = 0, the slope with the tangent line to this curve is 0. That is just a horizontal line which is true. And in fact, if we follow along this tangent line, f prime of x = 2x, it starts off being really negative, which means the graph is pointing way down. And as I move toward the origin, it's getting less and less negative, so the slope is kind of bottoming out and hollowing out and flattening out. By the time we get to the origin, it's horizontal, and now I move away from the origin toward the right, and the slope is getting more and more positive as I go, which is exactly right.