L’Hôpital’s Rule Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Series & Limits#18

L'Hôpital's Rule Evaluator

Resolves \(\tfrac{0}{0}\) and \(\tfrac{\infty}{\infty}\) forms by differentiating top and bottom.

This L’Hôpital’s rule calculator evaluates limits. It handles quotients ( frac{f(x)}{g(x)} ) that become ( tfrac00 ) or ( tfrac{infty}{infty} ) upon substitution. You input the numerator and denominator. The l’hopital’s rule calculator then shows each differentiation step. This continues until the limit is clear.

It is a quick way to check homework, or to see how many applications of the rule a problem really needs. It’s free, with no sign-up.

L'hopital's rule calculator: A 0/0 limit solved by L’Hôpital’s rule: (eˣ − 1)/x approaches the ratio of derivatives eˣ/1…
A 0/0 limit solved by L’Hôpital’s rule: (eˣ − 1)/x approaches the ratio of derivatives eˣ/1, which is 1 at x = 0.

Using the l'hopital's rule calculator

  1. Type the numerator ( f(x) ) in the first box and the denominator ( g(x) ) in the second. Use ^ for powers, e^(x) or exp(x), ln(), sin(), sqrt() and pi. Implicit multiplication like 3x works.
  2. Enter the value that ( x ) approaches. You can also type inf or -inf.
  3. Press Apply rule. Each application appears as its own row, showing the new quotient ( frac{f’}{g’} ). A final Substitute row gives the value, and the limit is highlighted at the bottom.
  4. If the output says there is no indeterminate form, substitution already works and the rule isn’t needed.

Formula

If ( f(c) = g(c) = 0 ), or both tend to ( pminfty ), and ( f ) and ( g ) are differentiable near ( c ) with ( g'(x) ne 0 ) there, then

HP 12c Platinum calculator on a white background

$$lim_{xto c}frac{f(x)}{g(x)} = lim_{xto c}frac{f'(x)}{g'(x)}$$

whenever the right side exists or is infinite. You differentiate the top and bottom separately, not with the quotient rule. If the new quotient is still ( tfrac00 ) or ( tfrac{infty}{infty} ), apply the rule again.

The calculator does exactly this at a finite point, up to six rounds, using its symbolic derivative engine. For ( x to pminfty ), or when the rule doesn’t resolve the form, it says so and estimates the limit numerically from values of ( frac{f}{g} ) instead.

Worked example

Example 1: two applications. Find

A calculator with '100' on its display.

$$lim_{xto0}frac{e^{3x} - 1 - 3x}{x^2}.$$

At ( x = 0 ): the top is ( 1 – 1 – 0 = 0 ) and the bottom is 0, so the form is ( tfrac00 ).

Round 1: ( f'(x) = 3e^{3x} – 3 ) and ( g'(x) = 2x ). At 0 this is ( frac{3 – 3}{0} = tfrac00 ) again.

Round 2: ( f”(x) = 9e^{3x} ) and ( g”(x) = 2 ). Now substitution works:

$$lim_{xto0}frac{9e^{3x}}{2} = frac{9}{2}.$$

This is the example loaded in the calculator above, so you can compare each row with your own work.

Example 2: an answer that isn’t a whole number. Find ( lim_{xto0}frac{2^x – 1}{x} ). The form is ( tfrac00 ). Since ( frac{d}{dx}2^x = 2^xln 2 ), one round gives

$$lim_{xto0}frac{2^xln 2}{1} = ln 2 approx 0.693147.$$

Enter 2^x - 1 over x and the calculator shows the result as ( ln 2 ).

Mistakes to avoid

  • Using the rule when the form isn’t indeterminate. For ( frac{x^2+3}{x+1} ) at 0, substitution gives ( frac31 = 3 ). Differentiating anyway would give ( frac{2x}{1} to 0 ), which is wrong. Always substitute first, as the calculator does.
  • Using the quotient rule. ( left(frac fgright)’ ) is a different object. The rule uses ( frac{f’}{g’} ).
  • Forgetting other indeterminate forms need rewriting. ( 0cdotinfty ), ( infty – infty ), ( 1^infty ) and ( 0^0 ) must become a quotient first. For example, ( x,(e^{1/x} – 1) ) as ( xtoinfty ) is an ( inftycdot0 ) form. Rewrite it as ( frac{e^{1/x}-1}{1/x} ), which is ( tfrac00 ), and the limit is 1. Enter e^(1/x) - 1 and 1/x with inf to check it.
  • Missing a factor you could cancel. ( frac{x^2-9}{x^2-2x-3} ) at 3 gives ( frac32 ) either by the rule or by cancelling ( x – 3 ). Both are fine, and algebra is often faster.

The full reasoning, including why the rule works, is in the guide to L’Hôpital’s rule. Many of the same limits can also be found with Taylor series, and the Taylor series calculator will build the expansions for you.

Two notebooks, one labeled 'SCIENCE' and the other 'MATH'.

Worked example: applying the rule twice

\( \lim_{x \to 0} \frac{1 - \cos x}{x^2} \) gives \( \frac{0}{0} \). Differentiate top and bottom: \( \frac{\sin x}{2x} \), still \( \frac{0}{0} \). Again: \( \frac{\cos x}{2} \to \frac{1}{2} \). So the limit is \( \frac{1}{2} \).

Limits at infinity

\( \lim_{x \to \infty} \frac{x}{e^x} \) gives \( \frac{\infty}{\infty} \). Differentiating gives \( \frac{1}{e^x} \to 0 \). Exponentials beat any power of \( x \), and logarithms lose to any power: \( \lim_{x \to \infty} \frac{\ln x}{x} = \lim \frac{1/x}{1} = 0 \).

Other indeterminate forms

L’Hôpital’s rule only applies to \( \frac{0}{0} \) and \( \frac{\infty}{\infty} \). Rewrite the others first:

FormHow to rewrite
\( 0 \cdot \infty \)write \( fg \) as \( \frac{f}{1/g} \)
\( \infty - \infty \)combine into a single fraction
\( 1^\infty, 0^0, \infty^0 \)take logarithms, then exponentiate

Example: \( \lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x \). Let \( y \) be the expression; \( \ln y = x\ln(1 + 1/x) = \frac{\ln(1 + 1/x)}{1/x} \to 1 \) by L’Hôpital, so \( y \to e \).

Is L’Hôpital always the best route?

Not always. \( \lim_{x \to 0} \frac{\sin x}{x} = 1 \) is usually proved geometrically, because using L’Hôpital there assumes the derivative of \( \sin x \), which itself depends on that limit. Factoring, multiplying by a conjugate or using a known standard limit is often faster, see limits at infinity.

Practice problems

  1. \( \lim_{x \to 0} \frac{\sin 3x}{x} \)
  2. \( \lim_{x \to 0^+} x\ln x \)
  3. \( \lim_{x \to \infty} \frac{x^2}{e^x} \)

Answers: 1. \( \frac{3\cos 3x}{1} \to 3 \). 2. Rewrite as \( \frac{\ln x}{1/x} \to \frac{1/x}{-1/x^2} = -x \to 0 \). 3. Apply twice: \( \frac{2}{e^x} \to 0 \).

Related guides

Further reading

FAQ

Does the L’Hôpital’s rule calculator show steps?

Yes. Every application appears as a row with the new numerator and denominator, followed by the substitution that gives the final value.

Can L’Hôpital’s rule be applied more than once?

Yes, as long as each new quotient is still ( tfrac00 ) or ( tfrac{infty}{infty} ). The calculator repeats it up to six times.

Does it work for limits at infinity?

You can enter inf as the point, and the calculator returns the limit. At infinity it estimates the value numerically instead of listing symbolic rounds. For limits that aren’t quotients, use the limit calculator.

When does L’Hôpital’s rule fail?

It doesn’t apply unless the form is indeterminate. It is also unhelpful when differentiating cycles back to the same form, as with ( frac{e^x + e^{-x}}{e^x – e^{-x}} ) at infinity. Dividing by ( e^x ) there gives 1 directly.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators