This L’Hôpital’s rule calculator estimates the limit of f(x)/g(x) at a point, tells you whether the expression is a 0/0 or ∞/∞ form, and compares the limit of f/g with the limit of f′/g′ from the left, the right or both sides. Enter the two functions and the limit point, then use the result to check your hand work.
L’Hôpital’s Rule Calculator
Estimate lim f(x)/g(x), detect 0/0 and ∞/∞ forms and compare f/g with f′/g′ from both sides of the limit point.
Starting values: the calculator opens with f(x) = sin(x), g(x) = x and a = 0, approached from both sides. It reports a 0/0 form and a limit of 1.
The rule in one paragraph
L’Hôpital’s rule says that if f(x)/g(x) tends to 0/0 or to ±∞/∞ as x approaches a, and the limit of f′(x)/g′(x) exists, then the two limits are equal:
lim f(x)/g(x) = lim f′(x)/g′(x)
Where f′ and g′ are the derivatives of the numerator and denominator, taken separately. This is not the quotient rule: you differentiate the top and the bottom on their own, not the fraction as a whole.
How to use the calculator
- Type the numerator in f(x) and the denominator in g(x), using x as the variable. Functions such as sin, cos, exp, ln and sqrt are accepted.
- Enter the limit point a. It can be a number, an expression such as pi/2, or inf or -inf for limits at infinity.
- Choose whether to approach from both sides, from the left only or from the right only.
- Read the limit estimate, the form at the limit point, the limit of f′/g′ and the verdict on whether the rule applies. A convergence table shows the values the ratios take as x gets closer to a.
The result is a numerical estimate, not a symbolic proof. Use it to confirm an answer you derived by hand, or to check whether the rule can be used before you differentiate.
Worked examples
Example 1: the default, sin(x) / x at 0
Both sin(0) and 0 are zero, so the form is 0/0. The derivatives are cos(x) and 1, and cos(0)/1 = 1. The limit is 1. This is the same limit that is usually proved with a geometric argument, which is why textbooks treat it as a special case.
Example 2: a rule applied twice
Take (1 – cos x) / x² as x goes to 0. The form is 0/0. One application gives sin(x) / (2x), which is still 0/0 at x = 0. A second application gives cos(x) / 2, which tends to 1/2. So the limit is 1/2. If the first derivative ratio is still indeterminate, you can apply the rule again, and the calculator shows that f′/g′ and f/g agree in the limit.
Example 3: a limit at infinity
For ln(x) / x as x goes to infinity, the form is ∞/∞. The derivatives are 1/x and 1, so the ratio is 1/x, which tends to 0. The limit is 0, which shows that the logarithm grows more slowly than any positive multiple of x. Enter inf in the limit point to test it.
Example 4: when the rule does not apply
Consider (x + 1) / (x + 2) at x = 0. The value is 1/2, and the form is not indeterminate, so there is nothing to resolve. Applying the rule anyway would give 1/1 = 1, which is wrong. The calculator reports the form at the limit point so that you can see when the rule is not allowed.
Example 5: the derivative ratio has no limit
Take (x + sin x) / x as x goes to infinity. This is an ∞/∞ form, and the limit is 1, because sin(x)/x goes to 0. The derivatives give (1 + cos x) / 1, which keeps oscillating and has no limit. The rule does not apply here, because the limit of f′/g′ must exist. The original limit still exists, and you find it another way.
Other indeterminate forms
The rule covers 0/0 and ∞/∞ directly. The forms 0 × ∞, ∞ – ∞, 0^0, 1^∞ and ∞^0 must be rewritten as a fraction first. For example, x e^(-x) as x goes to infinity can be written as x / e^x, which is an ∞/∞ form with a limit of 0.
Reading the convergence table
The table lists f(x)/g(x) and f′(x)/g′(x) at points that close in on a. If both columns settle on the same number, the rule gives the correct limit. If they settle on different numbers, or one of them does not settle, then one of the conditions has failed. The table also shows when the left and right limits differ, which means the two-sided limit does not exist.
Limits and cautions
- The calculator estimates limits numerically, so a function that oscillates wildly near a point can be misjudged.
- Check that f and g are differentiable near a, and that g′ is not zero near a, before using the rule by hand.
- Do not use the rule on a ratio that is not indeterminate.
For related calculus tools, see the Hessian matrix calculator and the Riemann sum calculator.
Frequently asked questions
When can I use L’Hôpital’s rule?
When f(x)/g(x) tends to 0/0 or to infinity over infinity, f and g are differentiable near the point, and the limit of f′/g′ exists.
Is L’Hôpital’s rule the same as the quotient rule?
No. The rule differentiates the numerator and denominator separately. The quotient rule differentiates the whole fraction.
Can I apply the rule more than once?
Yes, as long as each new ratio is still an indeterminate form.
What if the limit of f′/g′ does not exist?
The rule gives no information. The original limit may still exist, and you need another method.
Is the calculator result a proof?
No. It is a numerical estimate that helps you check the answer you worked out by hand.
