← SciSim / Mathematics

L'Hôpital's Rule & Indeterminate Forms

0/0, ∞/∞ -- f/g and f'/g' both converge to the same limit.
🎓 Tier: Standard Undergraduate -- Single-Variable Calculus

📊 Section 1 -- Interactive Simulation

f(x)/g(x)
--
fp/gp
--
f(x)
--
g(x)
--
Limit L
--
Form
--

Controls

Expression

Display

💡 Section 2 -- The Idea, Step by Step

Start -- the everyday picture

Share 4 cookies between 2 kids and everyone gets 2 -- easy. But what if the cookies AND the kids both dwindle to zero at the very same moment? "Zero cookies among zero kids" doesn't have to be nothing; the answer depends on how fast each one ran out. That is exactly the puzzle of $0/0$: two quantities racing to zero together, and who "wins" is decided by their speeds, not by the fact that both hit zero.

Build -- name the pieces

Call the top of the fraction $f(x)$ and the bottom $g(x)$, and let $a$ be the point where both collapse to $0$ (or both blow up to $\infty$). The raw ratio $f(x)/g(x)$ turns into the meaningless $0/0$. The trick is to stop staring at the values and compare their speeds instead -- the derivatives $f'(x)$ and $g'(x)$. That is L'Hôpital's rule:

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

Worked number: $\sin(x)/x$ at $x=0$ is $0/0$. The speeds are $\cos(x)$ over $1$, and at $x=0$ that is $\cos(0)/1=1$. So $\sin(x)/x\to1$ -- the fact hiding behind the small-angle approximation in every pendulum and lens problem.

Deepen -- the precise rule and the sliders

Formally: $f$ and $g$ must be differentiable near $a$ with $g'(x)\neq0$ nearby, and the form must genuinely be $0/0$ or $\pm\infty/\infty$. Why it works: Cauchy's Mean Value Theorem says $f(x)/g(x)=f'(c)/g'(c)$ for some $c$ between $a$ and $x$, and as $x\to a$ that $c$ is squeezed to $a$ too. If $f'/g'$ is still $0/0$, just apply again -- each pass peels off one Taylor order, and the limit equals the ratio of the first non-vanishing Taylor coefficients. Other shapes ($0\cdot\infty$, $1^\infty$, $\infty-\infty$) are first rearranged or log-transformed into a $0/0$ or $\infty/\infty$. In the sim, the Expression menu sets $f$ and $g$, while the x value slider walks $x$ toward the limit point; the orange $f/g$ curve and the green $f'/g'$ curve both home in on the gold limit line $L$.

Try this in the sim above

Pick $\sin(x)/x$ and drag x toward 0 -- watch the orange and green curves meet on the gold line at $L=1$. Switch to $x^2/e^x$ and press Animate: the polynomial loses the race and the ratio dives to $0$. Then choose $(1-\cos x)/x^2$ -- one L'Hôpital pass leaves you at $\sin x/(2x)$, still $0/0$, yet the curve settles at $\tfrac12$, showing exactly why a second pass is needed.

📐 Section 3 -- L'Hôpital's Rule

L'Hôpital's Rule

If $\lim_{x\to a}f(x)=\lim_{x\to a}g(x)=0$ (or $\pm\infty$) and $\lim f'(x)/g'(x)=L$ exists:

$$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{f'(x)}{g'(x)}=L.$$

Differentiate numerator and denominator SEPARATELY. Not the quotient rule.

FormConvert toExample
$0/0$Apply directly$\sin x/x\to\cos x/1=1$
$\infty/\infty$Apply directly$x^2/e^x\to2x/e^x\to2/e^x\to0$
$0\cdot\infty$Write as $f/(1/g)$$x\ln x=\ln x/(1/x)\to0$
$1^\infty$Take $\ln$, get $0/0$$(1+1/x)^x\to e$
Step 1 -- Proof via Cauchy MVT

By Cauchy MVT on $[a,x]$: $(f(x)-f(a))/(g(x)-g(a))=f'(c)/g'(c)$. With $f(a)=g(a)=0$ and $c\to a$ as $x\to a$: $f(x)/g(x)\to f'(a)/g'(a)$.

Step 2 -- Canonical example: sin(x)/x

Form $0/0$. Apply: $\cos x/1\to1$. Taylor confirms: $(x-x^3/6)/x=1-x^2/6\to1$.

Step 3 -- x^2/e^x as x to inf

Form $\infty/\infty$. First: $2x/e^x$ (still $\infty/\infty$). Second: $2/e^x\to0$. Exponential beats all polynomials.

Step 4 -- (1+1/x)^x as x to inf

Form $1^\infty$. Take $\ln$: $y=x\ln(1+1/x)=\ln(1+1/x)/(1/x)$, form $0/0$. L'H: $(-1/x(x+1))/(-1/x^2)=x/(x+1)\to1$. So $y\to e$.

Step 5 -- When L'H fails

$\lim_{x\to\infty}(x+\sin x)/x=1$ (divide by $x$). Applying L'H: $(1+\cos x)/1$ oscillates. L'H silent when derivative ratio does not converge.

Step 6 -- (e^x-1-x)/x^2

Two applications: $(e^x-1)/(2x)$ then $e^x/2\to1/2$. Taylor: $(x^2/2)/x^2=1/2$ ✓.

Reference: Stewart -- Calculus §4.4; Spivak -- Calculus Ch.11; Abbott -- Understanding Analysis §6.

❓ Section 4 -- FAQ

🧮Conceptual  Must I verify indeterminate form first?

Always. L'H applies only to 0/0 and inf/inf forms. Applying to (x+3)/(x-1) at x=2 gives 1/1=1 instead of correct answer 5/1=5.

Key takeaway: Check 0/0 or inf/inf FIRST or get wrong answers.
🔬Simulation  What does the animation show?

As x shrinks toward 0, f(x)/g(x) (orange) and fp(x)/gp(x) (green) both approach L (dashed gold line). The theorem guarantees they track each other near the limit point.

Key takeaway: f/g and fp/gp converge together to L. Watch them track the dashed limit line.
🌍Applied  Real-world uses?

Small-angle physics: sin(theta)/theta=1 (pendulum, optics). Entropy: x*ln(x) to 0 (information theory). Sinc function: sin(pi*x)/(pi*x) in signal processing. MGF derivatives. Taylor series computation.

Key takeaway: Small-angle physics, entropy, sinc function, MGF -- all L'Hopital.
💡Non-Obvious  Can the original limit exist when fp/gp oscillates?

Yes. lim (x+sin x)/x = 1 trivially, but fp/gp = (1+cos x)/1 oscillates. L'H gives no information when fp/gp has no limit -- does NOT mean original limit fails. Always try algebraic simplification first.

Key takeaway: Oscillating fp/gp means L'Hopital is silent. Original limit may still exist via other methods.
📐Computational  Evaluate lim (1-cos x)/x^2 as x to 0.

Form 0/0. Apply: sin(x)/(2x) -- still 0/0. Apply again: cos(x)/2 to 1/2. Taylor confirms: (1-cos x)/x^2 = (x^2/2 - x^4/24 + ...)/x^2 = 1/2 + O(x^2) to 1/2.

Key takeaway: Two L'Hopital applications: 1/2. Taylor also gives 1/2 immediately.
🎓Deep  Taylor series and L'Hopital equivalence.

L'Hopital applied k times to f/g (both zero to order k-1) gives f^(k)(a)/g^(k)(a). This is exactly the ratio of k-th Taylor coefficients. Taylor is often faster for polynomial-type limits; L'Hopital for transcendental functions. They are dual methods.

Key takeaway: L'Hopital = ratio of first nonvanishing Taylor coefficients. Mathematically equivalent.
Best resources: 3Blue1Brown -- Limits; Paul's Online Math Notes; Stewart §4.4.

⚠️ Section 5 -- Misconceptions

A · Conceptual Misconceptions
❌ Misconception: L'Hopital works for any quotient.✅ Correction: Only 0/0 and inf/inf. For 3/0 (blow-up) or 5/2 (just compute), applying gives wrong answers.🔍 Students apply to every fraction without checking form.📖 Stewart §4.4.
❌ Misconception: fp/gp oscillating means original limit fails.✅ Correction: L'Hopital is one-directional: fp/gp converging implies f/g converges (to same limit). Converse false.🔍 Students reverse the implication of the theorem.📖 Spivak Ch.11.
❌ Misconception: For 0^0 or 1^inf, apply L'Hopital directly.✅ Correction: First take ln to convert to 0*inf, then write as 0/0 or inf/inf, then apply.🔍 Students skip the ln transformation step for exponential forms.📖 Stewart §4.4.
B · Common Procedural Errors
❌ Error: d/dx[sin(x)/x] = (cos(x)*x - sin(x))/x^2 (quotient rule) when applying L'Hopital.✅ Correct: L'Hopital: differentiate TOP separately (cos x) and BOTTOM separately (1). Ratio = cos(x)/1 to 1.🔍 Students apply quotient rule instead of differentiating numerator and denominator separately.📖 Stewart §4.4.
❌ Error: After getting e^x/1 at x=0, applying L'Hopital again.✅ Correct: e^x/1 = e^0 = 1. Once non-indeterminate, STOP and evaluate directly.🔍 Students keep applying L'Hopital past where form becomes determinate.📖 Stewart §4.4.
❌ Error: x*ln(x): applying L'Hopital to the product directly.✅ Correct: Rewrite as ln(x)/(1/x), form -inf/+inf. Then: (1/x)/(-1/x^2) = -x to 0.🔍 Students forget to convert 0*inf to a quotient form first.📖 Stewart §4.4.
Education research: Cornu -- Limits in Advanced Mathematical Thinking (1991).