Welcome to calculus. I'm Professor Greist, and we're about to begin lecture eight on L'Hopital's Rule. Everyone who's had some exposure to calculus knows of L'Hopital's Rule. Everyone who knows L'Hopital's Rule loves L'Hopital's Rule. But who understands why L'Hopital's Rule works? By the end of this lesson, you will. Recall that when faced with a tricky limit, L'Hopital's Rule is a good method. For example, if we look at the limit as x goes to zero of sine of x over x Or the limit as x goes to 0, of 1 minus cos of x, over x. You probably remember that the way to deal with these is to differentiate, the numerator and the denominator. The derivative of sin is cos. The derivative of x is 1. Taking that limit gives you the correct answer of 1. Likewise in the second example, the derivatives of the numerator and denominator give sign of x and 1 respectively, leading to an answer of zero. But what does L'Hopital's rule really say? Remember the way that it is applied. You begin with a limit of the form of a quotient, say f of x over g of x. Then you try to evaluate the limit. If that works, then great you're done. If that doesn't work, then L'Hopital's rule says to differentiate both the numerator and the denominator. Try to evaluate the limit again, if that works, great, you're done. If not, repeat until it does work. Now, the error that some students make is to begin differentiating as soon as they see a limit that looks like a quotient. That is a bad idea. It will fail in those cases. But, the question is, why, why does it work? Why, if it doesn't work the first time, do you keep trying until it does? Let us use the perspectives that we've worked with so far and Taylor expand the terms if we have the limit as x goes to a of f of x over g of x. Then expand both the numerator and the denominator about the input, a now in the context of L'Hopital's rule. Lets consider the case where the limit of f is zero and the limit of g is zero. That means that the zeroth order terms both vanish. What do we see? Well, we see that we can factor. The quantity x minus a from all remaining terms in the Taylor expansions in both the numerator and the denominator these cancel and now when we try to evaluate x minus a we're left with the leading order terms. The constants, really the direvatives evaluated at a Now, if those 2 were to vanish, then what would happen? Well, we see that once again, we can factor out the quantity x minus a, cancel and again, we see that the leading order terms involve the second derivatives at A. Now, you might wonder, what about the 1 over 2 factorial? Since it appears in both the numerator and the denominator, it doesn't matter. What really matters is the derivatives. Let's look at this in an example. Sometimes, L'Hopital's rule is much easier to apply than a Taylor series. For example, if we take the limit as x goes to zero, a tangent of x over arcsin of x. Well, I don't know the Taylor Series for tangent and arcsin off the top of my head and it might take a log of work to figure that out. So let's apply L'Hopital's Rule. If we try to differentiate, well, that's going to take a little bit of recollection. You may or may not remember that the derivative of tangent is the secant squared. You may or may not remember that the derivative of arcsin Is 1 minus x squared to the negative 1 half power. If you don't remember this, don't worry, we'll learn how to compute these in just a few short lessons. But for the moment, let's take it as a given. Using L'Hopital's Rule, we get the limit as x goes to zero of secant squared x, over 1 minus x squared to the negative 1 half. Evaluating at zero, and remembering that secant of zero is one gives us our answer of one. That was simple. Let's look at another example. One for which L'Hopital's Rule might not be the way to go. The limit as x goes to zero of x squared log of cosine of x over sine squared of 3 x squared. Whew, I do not want to try to compute The derivative of that. It's possible, but not profitable. However, I recall the Taylor expansions for cosine of x, for log of 1 plus something, and for sine of something. These are all very simple. We've done these before. Now, using the fact that the limit is as x goes to zero, and cosine of x about zero is one minus x squared over two plus higher order terms. Then, substituting in for sin, 3x squared, and dropping all the higher order terms of sin, and then we have to square that. Oh, this way is not so easy either. But, it's not that bad, we're left with expanding log of 1 minus x squared over 2 plus higher order terms. That is in the form log of 1 plus z. The first term is z itself, in this case, negative 1 half x squared. We'll forget about the higher order terms, hopefully, they won't matter and the denominator, when we square 3 x squared plus higher order terms, the first term is 9 x to the 4th. Whew, and now we see that the leading order terms are of the same degree, we got negative 1 half x to the 4th plus stuff over 9x to the 4th plus stuff. Factoring out an x to the 4th and cancelling gives us an answer of negative 1 18th. Now, not all tricky limits are in the form 0 over 0. For example, the limit as x goes to 0 of 1 over sine squared x minus 1 over x squared. Evaluating looks like infinity minus infinity. That's not going to work. So, let us put this over the common denominator of x squared times sine squared of x. The resulting numerator is x squared minus sine squared of x. Now we can apply L'Hopital's rule, or in this case, Taylor expansion. If we Taylor expand, well, the only thing we need to worry about is sin squared of x, which is the Taylor series for sin of x, quantity squared. What we really want to do is compute the leading order term. So we're going to have a little bit of algebra to do when we square x minus x cubed over 3 factorial plus higher order terms, what do we get? The first term is x squared, the second term is 2 times x times x cubed over 3 factorial. Now, what do we note here? We note that the x squareds cancel. Those second ordered terms, they go away and we're left with the next term. The fourth order term as the leading order coefficient. Likewise, in the denominator, we see that the leading order term is simply x to the 4th, thus cancelling the x to the 4ths gives us leading order coefficients of 1 3rd in the numerator and one in the denominator. Our answer is 1 3rd. Likewise, if we consider x times log of x and send x to 0. We're going to have to be a little careful. This is a one-sided limit, sending x to 0 from the right. Then, what would this be? While x is going to 0, log of x is going to minus infinity. 0 times minus infinity, that's not going to work. Once again, let us put this over a denominator. In this case, we'll move the x to the denominator and call it 1 over x. So that we have a ratio of two functions. In this case, log of x over x to the minus 1. Now, we're going to apply L'Hopital's Rule. I'm a little nervous about Taylor expansions here, because both log of x and 1 over x, don't seem to have good Taylor expansions at x equals 0. So, applying L'Hopital's Rule gives us what? The derivative of log of x is 1 over x. The derivative of 1 over x is minus 1 over x squared. These simplify to minus x and taking the limit as x goes to 0 from the right, we see that the answer is 0. Now, L'Hopital's rule can also help in evaluating limits at infinity. Consider the limit as x goes to infinity. Of log of x over square root of x. It's maybe not apparent what that limit is going to be. Log of x and square root of x, both become infinite as x goes to infinity. But at what rate? Is there one that is bigger than the other? Well, let's apply L'Hopital's Rule. This gives us the limit as x goes to infinity of what? The derivative log of x is 1 over x. The derivative of x to the one half is one half x to the minus one half. This simplifies to twice x to the minus 1 half as x goes to infinity, this clearly goes to 0. Well, that's the answer. But what does that really mean? A log of x is going to infinity, square root of x is going to infinity, their ratio is going to 0. What that really means is that the square root of x dominates the log of x. It grows much faster than the logarithm does. While it's true that L'Hopital's rule tends to be helpful in evaluating limits and infinity, it's not universally helpful. Sometimes you have to think, consider the limit as x goes to infinity, the hyperbolic tangent of x. That is by definition the limit. The hyperbolic sine over the hyperbolic cosine. Let's apply L'Hopital's rule. Well, this is easy. What's the derivative of sinh? It's cosh. What's the derivative of cosh? It's sinh. And so we see, we get the limit as x goes to infinity of the hyperbolic cotangent of x. I don't know what that is. So, let's apply L'Hopitals rule. Again, the derivative of sinh is cosh and of cosh is sinh. And unfortunately, we're stuck in a loop and we'll never get anywhere. But, using our collective head, we know the definition for the hyperbolic tangent. What we really care about is the ratio of e to the x minus e to the minus x over e to the x plus e to the minus x. Now, let's think about that. Those first terms are big, e to the x gets large very quickly as x goes to infinity and e to the minus x gets very, very small. Let's ignore it. What would we get? Well, I think you could argue that the limit to be 1. Now, how could we make that a little more precise? If we factor out an e to the x, we're left with 1 minus something going to 0 in the numerator and 1 plus something going to 0 in the denominator. Canceling gives us, easily, this limit. This is a useful way to argue. Consider the limit of x times log of x over log, the hyperbolic cosine as x goes to infinity. I'm going to let you do the work to apply L'Hopital's Rule and see what we get. What we're going to get winds up looking a little complicated. Fortunately, there's a hyperbolic tangent involved which allows us to use a previous result to say that the numerator is going to infinity, while the denominator goes to 1. What I want you to do is think about how that answer of infinity could be obtained in your head without L'Hopital's Rule. Consider the hyperbolic cosine of x. That's really e to the x plus something small up to a constant of 1 half. Now, if we take the natural log of that, that should look something like x. Not exactly, but it should grow linearly. And so, I would argue that x times log of x divided by something that grows like x should give us an infinite limit. That's a foreshadowing of what is to come. Where we want to have a language for discussing or controlling growth of functions, this is called big O, and it's a beautiful language. L'Hopital's Rule, together with Taylor Series, form a wonderful set of tools for evaluating limits. In our next lesson, we'll put these tools to use in studying asymptotics or growth rates of functions. Along the way, we'll augment our tools with one more device, that of big O.