L'Hôpital's Rule: What It Is and When to Apply It

Plug in the number and you get 0/0. That's not a broken calculator, it's a tie that needs breaking. Here's the runner's-finish-line trick that breaks it, and the trap most people fall into when they try to use it.

By Petrus Sheya

August 4, 2026 · 6 min read

Try plugging in the number. Take limx0sin(x)x\lim_{x \to 0} \frac{\sin(x)}{x} and put x=0x = 0 straight into it. You get 00\frac{0}{0}.

That's not a small number. It's not a big number. It's not really a number at all, it's a contradiction wearing a fraction's clothes. And yet this exact limit shows up constantly in calculus, and it has a perfectly clean answer: 11.

So what do you do when direct substitution just breaks? You stop asking "what is it" and start asking "how fast is each side getting there." That shift is the entire idea behind L'Hôpital's rule.


Zero over zero isn't nothing, it's a tie

Picture two runners crossing a finish line at the exact same moment. Runner ff has a certain distance left to run. Runner gg has a certain distance left too. Right as they cross, both distances hit zero at once.

Now someone asks: "who was ahead, in terms of the ratio of their remaining distances?" At the instant they cross, that question sounds meaningless. Both numbers are zero. Zero divided by zero doesn't pick a winner.

But here's the thing. Just before the line, both runners were still moving, and each one has a speed. If you look at the last tiny sliver of the race instead of the exact instant of crossing, the ratio of how much ground they still had to cover stops being a coin flip. It settles down to the ratio of their speeds.

That's the whole trick, stated in plain English. Swap "speed" for "derivative," and "distance left" for "the function's value," and you've got L'Hôpital's rule.


Watching two functions race to zero

Let's make the runner's-finish-line picture concrete with real functions. Take f(x)=sin(x)f(x) = \sin(x) and g(x)=xg(x) = x. Both are zero at x=0x = 0, and as xx shrinks toward 00, both f(x)f(x) and g(x)g(x) shrink toward 00 right alongside it.

Drag toward the finish line at x = 0. Both racers, f(x) = sin(x) and g(x) = x, shrink to zero. Hover anywhere to preview a point without moving the slider.

g(x) = xf(x) = sin(x)fg
f(x) = sin(x)0.7513
g(x) = x0.8500
f(x) / g(x)0.8839
converging to1

Drag xx down toward the finish line. Notice the bars for f(x)f(x) and g(x)g(x) both shrink together, and yet the ratio f(x)/g(x)f(x)/g(x) doesn't do anything scary. It calmly settles near 11. Two quantities can both vanish and still leave behind a perfectly well-defined ratio. That's the entire mystery we need to explain, not "why is it zero," but "why does the ratio survive."


Why the ratio survives: zoom in and every curve goes straight

Here's the part that actually explains it, instead of just showing it. Take any smooth function and zoom in close enough around a point, and it stops looking curved. It starts looking like a straight line, its tangent line. That's basically the definition of a derivative: the slope of the line the function turns into once you zoom in far enough.

So if both ff and gg hit zero at the same point cc, and you zoom in close enough, ff starts looking like the straight line f(c)(xc)f'(c) \cdot (x - c), and gg starts looking like g(c)(xc)g'(c) \cdot (x - c). Divide one by the other and the (xc)(x - c) part, the leftover distance to the finish line, cancels clean out of both. What's left is just f(c)g(c)\frac{f'(c)}{g'(c)}.

Crank the zoom on f(x) = sin(3x) and g(x) = x near x = 0. The curves (solid) merge into their tangent lines (dashed), and the live ratio locks onto f'(0) / g'(0) = 3.

(c, 0)
window half-width1.1000
f'(0)3
g'(0)1
f(x) / g(x) at edge-0.1434

Crank the zoom slider up. Watch the solid curves peel away from being curvy and lock onto their dashed tangent lines. The ratio of the two curves at the edge of the window locks onto 33, which is exactly f(0)/g(0)f'(0)/g'(0). Nothing mysterious is happening here. You're just watching two curves turn into two straight lines through the origin, and the ratio of two lines through the origin is just the ratio of their slopes.


Writing the promise in symbols

Now that the idea is solid, the notation is just shorthand for it. If limxcf(x)=0\lim_{x \to c} f(x) = 0 and limxcg(x)=0\lim_{x \to c} g(x) = 0 (or both go to ±\pm\infty), and ff and gg are differentiable near cc, then:

limxcf(x)g(x)=limxcf(x)g(x)\lim_{x \to c} \frac{f(x)}{g(x)} = \lim_{x \to c} \frac{f'(x)}{g'(x)}

as long as that second limit actually exists, or heads to ±\pm\infty. And cc doesn't have to be a finite number. It can be \infty too, the rule doesn't care, it only cares about the shape of the tie you're trying to break.

Let's use it. For limx0sin(x)x\lim_{x \to 0} \frac{\sin(x)}{x}: differentiate top and bottom separately, giving cos(x)1\frac{\cos(x)}{1}. Plug in x=0x = 0, and cos(0)=1\cos(0) = 1. Limit found: 11. No factoring tricks, no algebra gymnastics, just two derivatives and a substitution.


A zero on the bottom doesn't always mean "apply the rule"

Here's the misconception that trips people up more than anything else with this rule. Seeing a zero anywhere in a limit does not mean you get to differentiate. The rule only fires on a genuine tie: 00\frac{0}{0} or \frac{\infty}{\infty}. Anything else, and differentiating top and bottom doesn't just fail to help, it gives you the wrong answer.

Click through each limit. Before touching a derivative, check the form you actually get from plugging in c.

num0.02den0.02form at x -> 0: 0 / 0 · rule applies

Both sides hit zero at the same instant. This is exactly what the rule is for: differentiate top and bottom.

expressionsin(x) / x
indeterminate form?yes
limit1

Click through the examples. Notice x+3x+1\frac{x+3}{x+1} at x0x \to 0 plugs straight in to 31\frac{3}{1}, an ordinary number, no tie, no rule needed. And notice xx1\frac{x}{x-1} at x1x \to 1 gives 10\frac{1}{0}, which looks like it might qualify, but it doesn't. A nonzero number over zero isn't a tie, it's a blowup. The function is diverging, not sitting in limbo. Checking the form first, before you touch a single derivative, is the actual skill here.


Sometimes one derivative isn't enough

One more wrinkle. Differentiating top and bottom once doesn't guarantee you're done. If the new ratio f(x)g(x)\frac{f'(x)}{g'(x)} is still 00\frac{0}{0} or \frac{\infty}{\infty} when you plug in cc, you haven't broken the tie yet. You just have a smaller version of the same problem, so you apply the rule again, and keep going until the tie actually breaks.

Take limx0xsin(x)x3\lim_{x \to 0} \frac{x - \sin(x)}{x^3}. Plug in 00 and you get 00\frac{0}{0}. Differentiate once: 1cos(x)3x2\frac{1 - \cos(x)}{3x^2}, plug in 00, still 00\frac{0}{0}. Differentiate again: sin(x)6x\frac{\sin(x)}{6x}, plug in 00, still 00\frac{0}{0}. Only on the third round does it break.

Every round differentiates the top and bottom again and checks the form at x = 0. Watch how many rounds (x − sin x) / x³ needs before the tie finally breaks.

f⁽0⁾(0) = 0.000g⁽0⁾(0) = 0.000round 0: x − sin(x) / still 0 / 0
round0 / 3
status0 / 0
limit found

Watch the bars stay flat at zero for rounds 00, 11, and 22, both racers still perfectly tied. Then round 33 finally shows daylight between them: cos(0)=1\cos(0) = 1 on top, a plain constant 66 on the bottom. Limit: 16\frac{1}{6}. The rule doesn't promise one derivative fixes everything. It promises that if you keep differentiating through genuine ties, you'll eventually reach one that isn't.


The short version

A limit that plugs in to 00\frac{0}{0} or \frac{\infty}{\infty} isn't broken. It's a photo finish, both sides reaching zero (or infinity) at the exact same moment, so comparing their raw values tells you nothing. L'Hôpital's rule breaks the tie by comparing rates instead: differentiate the top, differentiate the bottom, and check the new ratio.

Before you reach for it, check the form. Only a real 00\frac{0}{0} or \frac{\infty}{\infty} qualifies, anything else already has an answer sitting right there. And if differentiating once still leaves you tied, differentiate again. The tie always breaks eventually, you just have to keep racing until it does.