Skip to content
Henry, founder and creator of Calculus Solver

Henry

Founder & Creator of Calculus Solver

About Henry

Hi, I'm Henry, the founder and creator of Calculus Solver. I'm passionate about mathematics, technology, and building educational tools that make complex mathematical concepts easier to understand.

Through Calculus Solver, my goal is to help students, teachers, and independent learners solve calculus problems with clear, step-by-step explanations. I focus on creating simple, reliable, and accessible tools that make learning mathematics easier and more effective.

I believe every complex problem becomes easier when you understand it one step at a time.

My Expertise

  • Website Development & Technology
  • Online Calculator Development
  • Educational Tools & Resources
  • User Experience & Interface Design

My Mission

My mission is to make mathematics easier to understand through accessible online tools, clear explanations, and step-by-step learning experiences.

My Philosophy

Learn step by step. Understand every rule. Solve with confidence.

Search Calculus Solver

Calculators

TutorialLimits

L'Hôpital's Rule Explained With Examples (Step by Step)

Many limits come out as 0/0 or ∞/∞ when you substitute, which tells you nothing about the actual answer. L'Hôpital's rule resolves these by replacing the fraction with the ratio of the derivatives. This guide shows exactly when the rule applies, how to use it step by step, how to turn the other indeterminate forms into 0/0 or ∞/∞, and the cases where it fails. Eight fully worked examples follow.

By Calculus Solver teamPublished 8 min read
Worked examples verified
0/0→f′/g′fg
On this page
  1. What L'Hôpital's rule says
  2. When can you use L'Hôpital's rule?
  3. How to use L'Hôpital's rule, step by step
  4. Rewriting other indeterminate forms
  5. When L'Hôpital's rule fails
  6. Common mistakes to avoid
  7. Worked examples
  8. Questions about this topic
Two curves that both pass through the origin, each with a dashed tangent line showing a different slope there
Both functions are 0 at the same point, so their ratio there is 0/0. Near that point each curve follows its tangent line, so the ratio approaches the ratio of the slopes, f′/g′.

What L'Hôpital's rule says

Suppose f and g are differentiable near a (except possibly at a), g′(x) ≠ 0 near a, and the limit of f(x)/g(x) is an indeterminate form 0/0 or ±∞/±∞. Then the limit of the fraction equals the limit of the ratio of derivatives, provided that second limit exists (or is ±∞):

lim⁡x→af(x)g(x)=lim⁡x→af′(x)g′(x)\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}

The rule also works for one-sided limits and for limits as x → ∞ or x → −∞. The important detail is that you differentiate the numerator and the denominator separately. It is not the quotient rule: you never differentiate the fraction as a whole.

Why it works: near a point where f(a) = g(a) = 0, both functions are close to their tangent lines, so f(x) ≈ f′(a)(x − a) and g(x) ≈ g′(a)(x − a). The factors (x − a) cancel, leaving f′(a)/g′(a).

When can you use L'Hôpital's rule?

Only when direct substitution gives one of these two forms:

00or±∞±∞\frac{0}{0} \qquad\text{or}\qquad \frac{\pm\infty}{\pm\infty}

Always substitute first. If you get a number, that is the answer and L'Hôpital's rule must not be used. For example, the limit of (x + 1)/(x + 2) as x → 0 is 1/2 by substitution. Applying the rule anyway would give 1/1 = 1, which is wrong.

Forms such as 1/0, 5/∞ or ∞/3 are not indeterminate either. 1/0 means the limit is infinite or does not exist, and 5/∞ means the limit is 0. Neither needs the rule.

Note: Substitute first, every time. If you get a number, that is the answer; L'Hôpital's rule only applies to 0/0 and ∞/∞.

How to use L'Hôpital's rule, step by step

  • Step 1: Substitute the limit point. Confirm the result is exactly 0/0 or ∞/∞. If it is another indeterminate form, rewrite it first (see below).
  • Step 2: Differentiate the numerator and the denominator separately. Do not use the quotient rule.
  • Step 3: Take the limit of the new fraction f′(x)/g′(x), simplifying first if you can.
  • Step 4: If the result is still 0/0 or ∞/∞, apply the rule again. Check the form before every application.

Simplify between steps whenever possible. Cancelling a common factor or using a known limit such as sin(x)/x → 1 can save one or two rounds of differentiation.

Tip: Differentiate the numerator and the denominator separately. If you find yourself writing the quotient rule, stop: that is a different rule.

Rewriting other indeterminate forms

Five more indeterminate forms can be turned into 0/0 or ∞/∞, after which L'Hôpital's rule applies:

How to convert each indeterminate form
FormTypical exampleRewrite as
0⋅∞0 \cdot \inftyxln⁡x (x→0+)x \ln x \ (x \to 0^{+})ln⁡x1/x  (∞/∞)\dfrac{\ln x}{1/x} \ \ (\infty/\infty)
∞−∞\infty - \infty1x−1ex−1\dfrac{1}{x} - \dfrac{1}{e^{x} - 1}one fraction over a common denominator\text{one fraction over a common denominator}
000^{0}xx (x→0+)x^{x} \ (x \to 0^{+})e xln⁡x, then find lim⁡xln⁡xe^{\,x \ln x} \text{, then find } \lim x \ln x
1∞1^{\infty}(1+3x)x\left(1 + \tfrac{3}{x}\right)^{x}e xln⁡(1+3/x)e^{\,x \ln(1 + 3/x)}
∞0\infty^{0}x1/x (x→∞)x^{1/x} \ (x \to \infty)e ln⁡(x)/xe^{\,\ln(x)/x}

The three power forms all use the same trick: write f(x)^g(x) as e^(g(x) ln f(x)), find the limit L of the exponent, and the answer is e^L. Because eˣ is continuous, the limit can move inside the exponential.

Tip: For any power form, take logarithms: find the limit L of g(x)·ln f(x), and the answer is e^L.

When L'Hôpital's rule fails

The rule says that if lim f′/g′ exists, then lim f/g equals it. It says nothing when lim f′/g′ does not exist. Take the limit of (x + sin x)/x as x → ∞. It is ∞/∞, but the rule gives (1 + cos x)/1, which keeps oscillating between 0 and 2 and has no limit. The original limit is still 1, which you can show by splitting the fraction or with the squeeze theorem. See the squeeze theorem with examples.

The rule can also go round in circles. For x/√(x² + 1) as x → ∞, each application flips the fraction to √(x² + 1)/x and back again. Dividing the numerator and denominator by x gives the answer 1 immediately. When derivatives get more complicated instead of simpler, switch methods.

Common mistakes to avoid

  • Using the quotient rule. L'Hôpital's rule differentiates the top and the bottom separately: f′/g′, not (f′g − fg′)/g².
  • Applying the rule without checking the form. If substitution gives a number, or a form like 1/0, the rule does not apply and will usually give a wrong answer.
  • Forgetting to check the form again before a second application. After one round, the new fraction may no longer be indeterminate.
  • Applying it directly to 0·∞, ∞ − ∞ or a power form. Rewrite as a single fraction first.
  • Forgetting to undo the logarithm in power forms. If the exponent's limit is L, the answer is e^L, not L.
  • Concluding that the limit does not exist because lim f′/g′ does not exist. The rule is simply inconclusive then.

Practice

Worked examples

Each example is checked automatically against the solver. Try it by hand first, then compare.

Example 1

A basic 0/0 limit

lim⁡x→0e2x−1x\lim_{x \to 0} \frac{e^{2x} - 1}{x}
  1. Substituting x = 0 gives (1 − 1)/0 = 0/0, so the rule applies.

  2. Differentiate the top and bottom separately (chain rule on the top):

    lim⁡x→02e2x1\lim_{x \to 0} \frac{2e^{2x}}{1}
  3. Substitute x = 0: 2e⁰/1 = 2.

Answer

22

Example 2

An ∞/∞ limit at infinity

lim⁡x→∞ln⁡xx\lim_{x \to \infty} \frac{\ln x}{x}
  1. As x → ∞, both ln x and x grow without bound: ∞/∞.

  2. Differentiate the top and bottom:

    lim⁡x→∞1/x1=lim⁡x→∞1x\lim_{x \to \infty} \frac{1/x}{1} = \lim_{x \to \infty} \frac{1}{x}
  3. 1/x → 0. This shows that x grows faster than ln x.

Answer

00

Example 3

Applying the rule twice

lim⁡x→01−cos⁡xx2\lim_{x \to 0} \frac{1 - \cos x}{x^{2}}
  1. 0/0. First application:

    lim⁡x→0sin⁡x2x\lim_{x \to 0} \frac{\sin x}{2x}
  2. Still 0/0. Apply the rule again:

    lim⁡x→0cos⁡x2\lim_{x \to 0} \frac{\cos x}{2}
  3. Substitute x = 0: cos 0/2 = 1/2.

Answer

12\frac{1}{2}

Example 4

Exponentials beat polynomials

lim⁡x→∞x2ex\lim_{x \to \infty} \frac{x^{2}}{e^{x}}
  1. ∞/∞. First application:

    lim⁡x→∞2xex\lim_{x \to \infty} \frac{2x}{e^{x}}
  2. Still ∞/∞. Second application:

    lim⁡x→∞2ex\lim_{x \to \infty} \frac{2}{e^{x}}
  3. The numerator is constant and eˣ → ∞, so the fraction → 0. The same argument works for any power xⁿ.

Answer

00

Example 5

A 0 · ∞ form

lim⁡x→0+xln⁡x\lim_{x \to 0^{+}} x\ln x
  1. x → 0 and ln x → −∞, so this is 0 · ∞. Move x into the denominator as 1/x:

    lim⁡x→0+ln⁡x1/x(−∞∞)\lim_{x \to 0^{+}} \frac{\ln x}{1/x} \quad \left(\frac{-\infty}{\infty}\right)
  2. Differentiate the top and bottom, then simplify:

    lim⁡x→0+1/x−1/x2=lim⁡x→0+(−x)\lim_{x \to 0^{+}} \frac{1/x}{-1/x^{2}} = \lim_{x \to 0^{+}} (-x)
  3. −x → 0.

Answer

00

Example 6

An ∞ − ∞ form

lim⁡x→0(1x−1ex−1)\lim_{x \to 0} \left(\frac{1}{x} - \frac{1}{e^{x} - 1}\right)
  1. Combine over a common denominator:

    ex−1−xx(ex−1)(00)\frac{e^{x} - 1 - x}{x\left(e^{x} - 1\right)} \quad \left(\frac{0}{0}\right)
  2. First application (product rule on the bottom):

    ex−1ex−1+xex(00)\frac{e^{x} - 1}{e^{x} - 1 + xe^{x}} \quad \left(\frac{0}{0}\right)
  3. Second application:

    ex2ex+xex  →  x→0    12\frac{e^{x}}{2e^{x} + xe^{x}} \;\xrightarrow{\;x \to 0\;}\; \frac{1}{2}

Answer

12\frac{1}{2}

Example 7

A 0⁰ form

lim⁡x→0+xx\lim_{x \to 0^{+}} x^{x}
  1. Rewrite the power as an exponential:

    xx=e xln⁡xx^{x} = e^{\,x \ln x}
  2. The exponent x ln x → 0, as shown in the 0 · ∞ example above.

  3. So the limit is e⁰ = 1.

Answer

11

Example 8

A 1^∞ form

lim⁡x→∞(1+3x)x\lim_{x \to \infty} \left(1 + \frac{3}{x}\right)^{x}
  1. Write it as e^(x ln(1 + 3/x)). The exponent is ∞ · 0; rewrite it as a fraction:

    xln⁡ ⁣(1+3x)=ln⁡(1+3/x)1/x(00)x\ln\!\left(1 + \frac{3}{x}\right) = \frac{\ln(1 + 3/x)}{1/x} \quad \left(\frac{0}{0}\right)
  2. Differentiate the top and bottom, then simplify:

    −3/x21+3/x−1/x2=31+3/x  →  x→∞    3\frac{\dfrac{-3/x^{2}}{1 + 3/x}}{-1/x^{2}} = \frac{3}{1 + 3/x} \;\xrightarrow{\;x \to \infty\;}\; 3
  3. The exponent tends to 3, so the limit is e³ ≈ 20.09.

Answer

e3e^{3}

Put it into practice

About the author

Calculus Solver team

We build free, private calculus tools that show every step. Our articles are written to be read alongside the calculators, and every worked example in them is checked automatically against the solver before it is published.

About Calculus SolverHow answers are verified

FAQ

Questions about this topic

How do you pronounce and spell L'Hôpital?

It is pronounced “lo-pee-TAHL”. The rule is named after the French mathematician Guillaume de l'Hôpital, and is also spelled L'Hospital's rule, an older spelling of the same name.

Is L'Hôpital's rule the same as the quotient rule?

No. The quotient rule finds the derivative of a fraction. L'Hôpital's rule finds a limit by replacing f/g with f′/g′, where the numerator and denominator are differentiated separately.

Can I apply L'Hôpital's rule more than once?

Yes, as many times as needed, as long as the limit is still 0/0 or ∞/∞ before each application. Check the form every time.

Does L'Hôpital's rule work for limits at infinity?

Yes. It works for x → ∞ and x → −∞, and for one-sided limits, as long as the form is 0/0 or ∞/∞.

What if L'Hôpital's rule doesn't give an answer?

If lim f′/g′ does not exist or the derivatives keep getting worse, the rule is inconclusive. Try algebra instead: factoring, dividing by the highest power, combining fractions, a known limit, or the squeeze theorem.

Keep reading

  • xⁿf · gf / gf ∘ gddx

    Study guideDerivatives

    Derivative Rules: A Complete Guide with Examples

    Learn every core derivative rule with clear explanations, a reference table, and worked examples, plus a step-by-step strategy for differentiating any function.

    4 min read
  • ∫u-substitutionby partstrig identitiespartial fractions

    Study guideIntegrals

    Integration Techniques: How to Choose the Right Method

    A practical guide to choosing an integration technique: basic forms, u-substitution, integration by parts, trig identities and partial fractions, with worked examples.

    4 min read

All study guides All blog posts

Practice what you learned

Try the worked examples above in the calculator and compare each step with your own. You can also use the main Calculus Solver for every operation in one place.

Check any limit step by step with the Limit Calculator