[music] There are plenty of limits that are really quite hard to evaluate. Here's an example. Take the limit as x approaches 4 of the square root of x minus 2, divided by x minus 4. Admittedly, that limit's not really that difficult to calculate. Alright? The limit is 1 4th. But we can also think about this, maybe a little bit more intuitively. Look at what's going on. The limit of the numerator is 0, right? As x approaches 4, the square root of a number close to 4 minus 2 is close to 0. And the limit of the denominator is also 0. And because the limit of the denominator is 0, I can't just use my limit of the quotients as the quotient of limits deal to evaluate this limit, right? I'm genuinely in a difficult situation.. And the problem is that the numerator being close to zero, is trying to make this ratio small. But when the denominator is close to zero, it's trying to make this ratio really big. And neither the numerator nor the denominator win the game. Right? Those 2 forces balance off, giving the answer of 1 4th. But why? Well, we can see this geometrically. So here I've graphed in green the function squared of x minus 2. That's the numerator. And in orange I've graphed x minus 4. Y equals x minus 4. And you can see that when x is equal to 4, these curves cross the x axis because when I plug in 4 here, I get zero. When I plug in 4 here, I get zero. But also note that the green curve is getting closer to zero more quickly than the orange curve. Let's replace those two functions with the approximations that we get by using the derivative. Now, let me replace this green curve with the tangent line to the green curve at the point where the green curve crosses the x-axis. Well, here I go. Here's a picture just of that tangent line. Now I could compute that tangent line by doing a little bit of calculus. Alright. This function is the square root of x minus 2. If I differentiate that I get 1 over 2 square root sub x, that's the derivative of the square root function. And the derivative of minus 2 is just 0. Now I can evaluate that derivative at 4, and I get the derivative is 1 4th, and that's the slope of the tangent line. Here to the green curve. Now I know that my tangent line should cross through the point 4, 0. So here's equation that tangent line in point slope form and I can rewrite this a little bit more nicely as y equals a quarter of x minus 1. So what happens to the limit problem when we replace those expressions by their tangent lines? So instead of thinking about this geometrically, I can just look back at this original limit problem, and replace these pieces by their tangent lines. And we calculated the tangent line to the graph of the square root of x minus 2. To be one quarter times x minus 4, and the denominator is already a straight line. So, if I replace the numerator and denominator by the straight line approximations that are good for inputs near 4, this original limit problem is transformed into this limit problem. But this limit problem is really easy to do, right? I've got an x minus 4 in the numerator and an x minus 4 in the denominator. So this limit is 1 quarter. It's important to emphasize that we really haven't done anything new here. We could have calculated this limit even without thinking about derivatives and tangent lines, but this perspective opens up a new way of approaching some limit problems. So here's how I can package this up. Into a situation that's maybe useful more generally. Suppose I got two functions, I got a function f and a function g. And let's suppose the limit of f as x approaches a is 0 and the limit of g of x as x approaches a is also 0. And just for kicks, let's suppose that f and g are also differentiable, twice differentiable, you know, I want these to be really nice functions. Now let's suppose I want to try to calculate the limit of f of x over g of x, as x approaches a. This might be a difficult limit to calculate. But what we just saw is that we could try to understand this a little bit better by replacing f and g by their tangent line approximations. Another way to say that Is I'm just going to replace f of x and g of x by their approximations that I get from considering their derivative, right? So, the limit of f of x over g of x should be close to this because f of x is close to this, right? It's the value of f at a plus the derivative of f at a times how much the input changes when I go from a to x. That's approximately f of x. And this denominator should be about g of x. It's g of a plus the derivative of g at a times x minus a, that's about g of x. So if you believe that the numerator and denominator here are approximately f of x and g of x, you might then believe that these limits are also equal. But this is a really great situation to be in because f of a say is equal to 0 if f is continuous there, maybe since it's differentiable. And g of a is also equal to 0 since g is continuous. So that these f of a and g of a terms go away. And then I've got an x minus a and an x minus a term there, so those also cancel, and all I'm left with is just f prime of a divided by g prime of a. So it seems like if you try to calculate the limit of this ratio, what's really relevant is understanding something about the derivatives of your numerator and denominator separately. At that point a. The precise statement of this is usually called L'Hopital's rule. So here's a statement of L'Hopital's rule. Suppose I got two functions f and g and they're differentiable for inputs near a, and the limit of f of x and the limit of g of x as x approaches a are both 0. So these functions output is very small when their input is close to a. And the limit of the derivative of f divided by the derivative of g as x approaches a, just exists. And the derivative of g is not 0, when I evaluate that derivative for inputs near a. If all of these conditions are true, then I get the fantastic conclusion that the limit of f of x over g of x. Is the limit of the derivative of f over the derivative of g? And the hope is that this limit is easier to compute then the original limit. Let's try to use L'Hopital's rule in a much trickier context. So here's an example, let's compute the limit as x approaches zero of cosine x minus one minus x quote over two all over x 2 the 4th power. Now we can do it using L'Hopital's rule. So the limit of the numerator is zero and the limit of the denominator is zero. And these are really nice functions, so they're nice enough for us to apply L'Hopital. So I should calculate the limit of the derivative of the numerator, divided by the derivative of the denominator and that might help me compute this original limit. So here we go. The derivative of the numerator is minus sign x, that's the derivative cosine. Minus zero, that's the derivative of 1. Minus x, that's the derivative of x squared over 2. Divided by, what's the derivative of x to the 4th? It's 4x cubed. Now here, I'm in a situation where the limit of the numerator is 0, because the limit of sin x as x approaches 0 is 0 and the limit of x as x approaches 0 is 0. So, the limit of the numerator is 0 and the limit of the denominator is also 0. So here's the funny thing. I could try to apply L'Hopital again to understand this limit. So here we go. I'll use L'Hopital again. I'll differentiate the numerator. The derivative of minus sin is minus cosine. And the derivative of x is 1. So this is minus cosine of x minus 1. Divided by the derivative of the denominator which is 4 times 3x squared, or 12x squared. Now what kind of situation am I in here? Well here, the numerator has limit 0 because cosine's limit is 1 and it's attracting 1. And the limit of the denominator is also 0, so I'm again in a situation where the numerator and denominator are heading toward 0. So to understand this, I could again use L'Hopital to look at how quickly these terms are dying. So I apply L'Hopital again, and L'Hopital tells me to look at the derivative of the numerator. The derivative of minus cosine of x, is sine x. Minus 1, well that's just 0, divided by the limit of the denominator. Well, what's the derivative of the denominator? It's 24x. So now I'm again in a situation where the numerator and the denominator have limit 0. So I could again apply L'Hopital, and it would tell me to look at the derivative of the numerator over the derivative of the denominator. The derivative of the numerator is cosine x and the derivative of the denominator is 24. But now look, the numerator has limit 1, and the denominator has limit 24, it's just a constant. So this is a limit of the quotient and the quotient of limit, so this limit is, Is 1 24th. Now, L'Hopital then tells me that this limit being equal to 1 24th makes this limit equal to 1 24th. And because this limit exists, it then tells me that this limit is also equal to 1 24th. And because this limit then exists it then tells me that this limit is equal to 1 24th. And then because this limit exists it tells me that the original limit is 1 24th.