 Hello and welcome to a screencast today about calculating a tangent line. So the question of the day is, how do you calculate the equation of a tangent line to a given function at a given point? So recall the equation of a tangent line to a function f of x at the point x equals a is given by this formula here, y equals f prime of a times x minus a plus f of a. So you need three pieces in order to do this formula. You need f prime of a, you need a, which are given, and you need to figure out what f of a is. Because remember that this is an equation. So x is going to be your variable that you're going to use. Okay, so to work this through with a specific example, I want to find the equation of a tangent line to the function f of x equals 6x minus x squared at the point x equals negative 2. All right, so you can find any of those three pieces at any point in time. I prefer to work left or right. So I'm going to figure out what f prime of a is. Now, this particular question only asks for one point. But if you were to ask for multiple points like x equals negative 1, x equals 1, etc, etc, then I think I always find it best to figure out what the general derivative is. So what is f prime of x? And then once you get that, go ahead and plug your a value in. But if you'd prefer just to use x as negative 2, that's perfectly fine too. So remember that f prime of x is defined to be the limit h approaches 0. f of x plus h minus f of x all divided by h. Okay, plugging pieces into my function, so limit h approaches 0. f of x plus h, so I'm going to plug that in. 6 quantity x plus h minus the quantity x plus h squared. So that takes care of f of x plus h minus, put a parenthesis in, f of x, so that's 6x minus x squared. All of this is divided by h. Okay, whip out some algebra, so that's going to give me the limit. h approaches 0. Distribute my 6 through, so 6x plus 6h. Now x plus h squared means x plus h times x plus h, I'm going to do that and distribute this negative through that's right here at the same time. So that's going to give me minus x squared minus 2x h minus h squared. If that confuses you, feel free to go through and do it in a couple different stops. Distribute my negative sign through, so minus 6x plus x squared. And all of that is going to be divided by h. Okay, as we've done before, we can now cancel a couple terms, so the minus 6x and the positive 6x, positive x squared, negative x squared. And as always, what do you notice has left with those three terms? Well, they all have an h in common, so let's go ahead and factor out that h. So that leaves me with 6 minus 2x minus h. And then all of this is divided by h. So now we can go ahead and cancel those h's out front. And you'll notice that the function left in parentheses here is a nice function. It's continuous. So we end up with 6 minus 2x for my derivative. Okay, now we need f prime of a though. And remember that a is, in this particular example, negative 2. So I need to plug negative 2 into this function. And that will give me my first piece that I need. And when I crunch out that algebra, that gives me a 10. Okay, I know that a is negative 2, so I really don't do much with the second piece, but I need to also figure out what is f of negative 2. So this is where it can be a little bit confusing. You need to plug in your number into your derivative as well as your original function. You need to check it, or you need to plug it into both. So 6 times negative 2 minus negative 2 squared leaves me a value of negative 16, okay? So let me plug those three numbers into my formula. So my equation in my tangent line is gonna look like 10 times the quantity x. Now there's a negative sign built into the formula. And then you also have a negative 2, so that's gonna end up being plus 2 with that double negative and then minus 16. So that's a perfectly good equation of a tangent line. If you'd prefer to put it in the point slope form, or this is point slope form, if you wanna put it in slope intercept form, you can certainly multiply all the 10, combine your like terms. But this one is perfectly good. Thank you for watching.