The idea: 0/0 means two curves through one point

Try to compute lim sin x / x as x → 0 by plugging in: you get 0/0, which says nothing. But 0/0 has a picture. The top curve f(x) = sin x and the bottom curve g(x) = x both pass through the point (0, 0). Near that point f(x)/g(x) is the height of one curve divided by the height of the other at the same x. On the canvas the grey line marks x = a + h, and the blue and purple bars are the two heights.

Left: the curves sin x and x/2 cross at the origin, with a small orange zoom box around it. Right: inside the box, zoomed ten times, both curves are straight lines through the origin. At x = h the blue bar has height f′(0)·h and the purple bar g′(0)·h.
Zoom in on (a, 0): both curves become lines, the heights are f′(a)·h and g′(a)·h, and their ratio is the ratio of the slopes.

Why the ratio of slopes is the limit

Zoom in on (a, 0), both axes by the same factor. A smooth curve turns into its tangent line (see local linearity), so near a the two curves are lines through (a, 0) with slopes f′(a) and g′(a). Their heights at a + h are

f(a + h) ≈ f′(a)·h and g(a + h) ≈ g′(a)·h.

Divide and the h cancels. That is L'Hôpital's rule: if f(a) = g(a) = 0 and g′(a) ≠ 0, then lim f(x)/g(x) = f′(a)/g′(a). The table on the canvas shows it for sin x / x: zoom ×2 at a time, both heights halve, their ratio settles at cos 0 / 1 = 1. (Demo: sin x / x at 0)

zoomhf = sin hg = hf / g
×12.40.6754632.40.281443
×21.20.9320391.20.776699
×40.60.5646420.60.941071
×80.30.2955200.30.985067
×160.150.1494380.150.996254
×320.0750.0749300.0750.999063

The same works for (x² − 1)/(x − 1) at 1, with slopes 2·1 = 2 and 1, so the limit is 2 (Demo: (x² − 1)/(x − 1)), and for ln x / (x − 1) at 1, with slopes 1/1 and 1, limit 1 (Demo: ln x / (x − 1)). The real theorem is a bit stronger: lim f/g = lim f′/g′ whenever the second limit exists, which follows from the Cauchy mean value theorem.

When the slopes are 0 too: apply it again

For (1 − cos x)/x² at 0 both curves touch the x-axis flat. Zoomed in, both lie on the axis: slopes sin 0 = 0 and 2·0 = 0, so f′(0)/g′(0) is 0/0 again. But the rule says lim f/g = lim f′/g′, so look at the new pair f′ = sin x and g′ = 2x. These cross the axis with slopes 1 and 2, so the limit is 1/2. The table on the canvas already showed f/g heading to 0.5 before the slopes were known. (Demo: (1 − cos x)/x²)

Left: 1 − cos x and x squared both touch the x-axis flat at 0, so their slopes are both 0. An arrow labelled f′, g′ leads to the right panel: sin x and 2x cross the origin with slopes 1 and 2, giving the limit 1/2.
Slopes 0 and 0 give 0/0 again ✗; differentiate once more and sin x vs 2x cross with slopes 1 and 2 ✓, so the limit is 1/2.

When the rule does not apply

The rule needs 0/0 (or ∞/∞). (x + 1)/(x + 2) at 0 is 1/2 by plugging in. Both slopes are 1, so "comparing slopes" gives 1, which is wrong. In the picture the curves do not pass through (0, 0): the heights start at 1 and 2, not at 0, so the slopes only add a little to them. Zooming about (0, 0) pushes both curves out of the window. (Demo: (x + 1)/(x + 2) is not 0/0)

casecheckwhat to do
f(a) = g(a) = 0, g′(a) ≠ 00/0limit = f′(a)/g′(a)
f′(a) = g′(a) = 00/0 againapply the rule to f′/g′
f(a), g(a) not both 0not 0/0no rule: limit = f(a)/g(a) if g(a) ≠ 0
f, g → ∞∞/∞the rule also holds
0·∞, ∞ − ∞, 1^∞other formsrewrite as 0/0 or ∞/∞ first

See also limits and continuity, the derivative as a limit and Taylor series, which give the same limits by expanding sin x = x − x³/6 + … and 1 − cos x = x²/2 − ….

What the page leaves out

The page only shows 0/0 at a finite point a. The ∞/∞ form, limits as x → ∞, and the other indeterminate forms (0·∞, ∞ − ∞, 0⁰, 1^∞, ∞⁰) are only listed. The proof by the Cauchy mean value theorem is mentioned, not drawn. The derivatives come from the known formulas, and 1 − cos x is computed as 2 sin²(x/2) so that tiny h stays exact.

On the mind map

Open the Calculus mind mapCalculusLimits and derivatives: slope at a point, as a limitLimits and derivativesReading derivatives: what f′ and f″ say about fReading derivativesIntegrals: add up thin slicesIntegralsSeries: a function as an infinite sumSeriesNumerical methods: approximate when exact is hardNumerical methodsDifferential equations: know the slope, find the curveDifferential equationsChaos: simple rules, unpredictable pathsChaosVector calculus: fields that spread and spinVector calculusLimits and continuityLimits and continuityfor every ε band there is a δ windowDerivative as a limitDerivative as a limitsecant slope as h → 0 gives f′(x)Local linearityLocal linearityzoom in: a smooth curve becomes a lineDerivative rulesDerivative rulesx² grows by 2x·dx; the dx² corner vanishesChain ruleChain rulerates multiply: dy/dx = dy/du · du/dxWeierstrass functionWeierstrass functioncontinuous everywhere, smooth nowhereImplicit differentiationImplicit differentiationtreat y as y(x), then solve for y′L'Hôpital's rule0/0? compare the slopes insteadOpen the Calculus mind mapCalculusslope at a point, as a limitLimits and derivativesLimits and continuityLimits and continuityfor every ε band there is a δ windowDerivative as a limitDerivative as a limitsecant slope as h → 0 gives f′(x)Local linearityLocal linearityzoom in: a smooth curve becomes a lineDerivative rulesDerivative rulesx² grows by 2x·dx; the dx² corner vanishesChain ruleChain rulerates multiply: dy/dx = dy/du · du/dxWeierstrass functionWeierstrass functioncontinuous everywhere, smooth nowhereImplicit differentiationImplicit differentiationtreat y as y(x), then solve for y′L'Hôpital's rule0/0? compare the slopes instead
This page on the Calculus mind map · 42 pages in 8 branches · open it to see the whole map and test yourself in recall mode.