L'Hôpital's Rule

Here is a limit that has stopped a lot of clever people cold: \lim_{x \to 0} \frac{\sin x}{x}. Try direct substitution and you get \tfrac{\sin 0}{0} = \tfrac{0}{0} — the indeterminate form that means "the top and bottom are racing each other down to zero, and the winner is not yet decided." On the previous page the winning move was to factor out the shared (x-c). But \sin x is not a polynomial — there is nothing to factor, no common bracket to cancel. The old trick is dead in the water.

We need a power tool. And it turns out the perfect one has been under our noses the whole time: the derivative. Both the top and the bottom pass through the origin, and near a point a smooth curve is almost exactly its tangent line. So instead of comparing the two functions, compare the two slopes they leave the origin with. That single idea is L'Hôpital's Rule, and it will crack \tfrac{\sin x}{x} in one line.

The rule

Suppose you want \lim_{x \to a} \tfrac{f(x)}{g(x)} and, on substituting, you land on \tfrac{0}{0} or \tfrac{\pm\infty}{\pm\infty}. Then — provided the functions are differentiable and the new limit exists — you may replace top and bottom by their derivatives and try again.

If \tfrac{f(x)}{g(x)} has the indeterminate form \tfrac{0}{0} or \tfrac{\pm\infty}{\pm\infty} as x \to a, then

\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)},

whenever the limit on the right exists (as a finite number or \pm\infty). The point a may be finite or \pm\infty.

Two things to burn into memory before we use it. First, that \tfrac{f'}{g'} is not the derivative of \tfrac{f}{g} — you are not using the quotient rule; you differentiate the top and the bottom separately and stack them. Second, you may only start if the form really is \tfrac{0}{0} or \tfrac{\infty}{\infty}. Always check the form first.

Now watch the hook fall. With f = \sin x and g = x, we have f' = \cos x and g' = 1, so \lim_{x \to 0} \frac{\sin x}{x} = \lim_{x \to 0} \frac{\cos x}{1} = \frac{\cos 0}{1} = 1. One line. No factoring, no conjugates — just the two slopes.

Why it works: it's just a race of slopes

The picture makes the rule feel inevitable. Suppose f and g both pass through (a, 0) — that's what makes the form \tfrac{0}{0}. Zoom right in on that point and each curve becomes indistinguishable from its own tangent line: f(x) \approx f'(a)\,(x-a) and g(x) \approx g'(a)\,(x-a). Form the ratio and the little (x-a) factors cancel: \frac{f(x)}{g(x)} \approx \frac{f'(a)\,(x-a)}{g'(a)\,(x-a)} = \frac{f'(a)}{g'(a)}. The ratio of the two functions collapses to the ratio of the two slopes. That is L'Hôpital's Rule in a nutshell: near a shared zero, how fast you left is all that matters.

Drag the slider to change k, the slope of the top curve \sin(kx). The bottom curve y = x always leaves the origin with slope 1. Notice how, right near x = 0, the top climbs about k times as steeply — so the ratio \tfrac{\sin(kx)}{x} heads straight for \tfrac{k}{1} = k, exactly the ratio of the slopes.

Worked example 1 — a \tfrac{0}{0}

Evaluate \lim_{x \to 0} \frac{e^{x} - 1}{x}.

Step 1 — check the form. Substitute x = 0: the top is e^{0} - 1 = 0, the bottom is 0. Form \tfrac{0}{0} — L'Hôpital is allowed.

Step 2 — differentiate top and bottom, separately. \tfrac{d}{dx}(e^{x} - 1) = e^{x} and \tfrac{d}{dx}(x) = 1:

\lim_{x \to 0} \frac{e^{x} - 1}{x} = \lim_{x \to 0} \frac{e^{x}}{1}.

Step 3 — substitute into the new fraction. It is no longer indeterminate: \lim_{x \to 0} \frac{e^{x}}{1} = \frac{e^{0}}{1} = 1. So \tfrac{e^{x}-1}{x} \to 1. (Sensible: near zero, e^{x} \approx 1 + x, so the top is roughly x and the ratio is roughly 1.)

Worked example 2 — an \tfrac{\infty}{\infty}, applied twice

L'Hôpital also handles the "battle of the giants" form \tfrac{\infty}{\infty}. Here is a famous one — who wins as x \to \infty, the polynomial or the exponential? \lim_{x \to \infty} \frac{x^{2}}{e^{x}}.

Step 1 — check the form. As x \to \infty the top \to \infty and the bottom \to \infty: form \tfrac{\infty}{\infty}. Fair game.

Step 2 — differentiate. \tfrac{d}{dx}(x^{2}) = 2x, \tfrac{d}{dx}(e^{x}) = e^{x}:

\lim_{x \to \infty} \frac{x^{2}}{e^{x}} = \lim_{x \to \infty} \frac{2x}{e^{x}}.

Step 3 — still \tfrac{\infty}{\infty}, so apply it again. This is allowed and is completely normal: if the new fraction is still indeterminate, differentiate once more.

\lim_{x \to \infty} \frac{2x}{e^{x}} = \lim_{x \to \infty} \frac{2}{e^{x}} = 0.

The top is now the constant 2 while the bottom runs off to infinity, so the fraction is squeezed to 0. The exponential wins, crushingly — and this is the fast proof of a deep fact: every power of x loses to e^{x} in the long run.

A shortcut worth knowing. For a ratio of polynomials of the same degree, one round of L'Hôpital (or several) always leaves you with the ratio of the leading coefficients — e.g. \lim_{x\to\infty}\tfrac{3x^{2}+2x}{x^{2}-5} = \tfrac{3}{1} = 3.

These three mistakes are the ones examiners are hoping you'll make:

The name is a small scandal. The rule was first published in 1696 in Analyse des Infiniment Petits, the very first calculus textbook, written by the French aristocrat Guillaume de l'Hôpital, Marquis de Sainte-Mesme — and it has carried his name ever since. There is just one problem: he did not discover it.

A few years earlier, l'Hôpital had struck a remarkable private deal with the brilliant but broke Swiss mathematician Johann Bernoulli. In exchange for a regular salary, Bernoulli agreed to send l'Hôpital his newest mathematical discoveries — and to let l'Hôpital do whatever he liked with them. The rule for \tfrac{0}{0} limits was one of those discoveries. l'Hôpital, true to the bargain, tidied it up, put it in his book, and (mostly) let the world assume it was his own.

Bernoulli fumed about it for the rest of his life, and after l'Hôpital died he loudly claimed the rule as his. Historians now agree he was right. But textbooks are stubborn things, and so a theorem that is really Bernoulli's is stamped forever with the name of the man who paid for it. A cautionary tale: in mathematics, as elsewhere, money can occasionally buy immortality.

L'Hôpital only speaks \tfrac{0}{0} and \tfrac{\infty}{\infty} — but other indeterminate forms can be rewritten into one of those and then handed over. Take \lim_{x \to 0^{+}} x \ln x, which is the form 0 \cdot (-\infty) — indeterminate, but not yet a fraction. Flip the x underneath to manufacture one:

x \ln x = \frac{\ln x}{1/x} \;\to\; \frac{-\infty}{+\infty} \quad(\text{now it's } \tfrac{\infty}{\infty}).

Differentiate top and bottom: \tfrac{d}{dx}\ln x = \tfrac{1}{x} and \tfrac{d}{dx}(1/x) = -\tfrac{1}{x^{2}}, so

\lim_{x \to 0^{+}} \frac{\ln x}{1/x} = \lim_{x \to 0^{+}} \frac{1/x}{-1/x^{2}} = \lim_{x \to 0^{+}} (-x) = 0.

So x \ln x \to 0: the x racing to zero beats the \ln x crawling to -\infty. The same trick — turn the awkward form into a fraction, then apply the rule — also tames \infty - \infty (combine into one fraction first) and the exponential forms 0^{0}, 1^{\infty}, \infty^{0} (take \ln first). L'Hôpital is the engine; a little algebra is the gearbox that connects it.