# What is the limit by L'Hopital's rule?

Finds the limit of f(x)/g(x) at a number or infinity with L'Hopital's rule for 0/0 and ∞/∞ forms, checked numerically.

- Page: https://www.acalculator.org/math/lhopitals-rule-calculator
- JSON spec: https://www.acalculator.org/math/lhopitals-rule-calculator.json
- Version: 006ae888d59c

## Default answer

Example with the default inputs (Numerator f(x) sin(pi x), Denominator g(x) ln(x), x approaches 1): The limit of (sin(pi x))/(ln(x)) as x approaches 1 is -π.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| f | Numerator f(x) | The top of the quotient, typed like 1 - cos(x) or ln(x). |
| g | Denominator g(x) | The bottom of the quotient, typed like x, x^2 or ln(x). |
| a | x approaches | A number or a constant such as pi, or inf or -inf. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| limit | Limit | The limit of f(x)/g(x), written exactly. |
| value | As a decimal | The limit to 10 significant figures. |
| form | Form | 0/0 or ∞/∞ when the rule applies; otherwise the rule does not apply. |
| ratio | f′(x)/g′(x) = | The quotient of the derivatives, whose limit is the same. |

## Method

If f/g is 0/0 or ∞/∞ at a, lim f/g = lim f′/g′ (L'Hôpital's rule), applied up to 3 times.

## Assumptions

- The limit is two-sided at a number.
- x in radians; ln is the natural logarithm.

## Worked examples

1. f = sin(pi x), g = ln(x), a = 1 gives limit = -π, value = -3.141593, form = 0/0. Source: OpenStax, Calculus Volume 1, section 4.8 L'Hôpital's Rule, Example 4.38(b). https://openstax.org/books/calculus-volume-1/pages/4-8-lhopitals-rule.
2. f = 1 - cos(x), g = x, a = 0 gives limit = 0, value = 0, form = 0/0.
3. f = 3x + 5, g = 2x + 1, a = inf gives limit = 3/2, value = 1.5, form = ∞/∞.

## FAQ

### What is L'Hôpital's rule?

If f(x) and g(x) both tend to 0, or both tend to ±∞, as x approaches a, then lim f(x)/g(x) = lim f′(x)/g′(x), provided the right-hand limit exists (or is infinite). It turns a limit you cannot read off into one that is often easy.

### When does the rule apply?

Only to the indeterminate forms 0/0 and ∞/∞, and only when f and g are differentiable near a with g′(x) ≠ 0 there. For (x + 1)/(x + 2) at 0 the form is 1/2, not indeterminate: the limit is 1/2, while the quotient of the derivatives would wrongly give 1. The page labels the form and gives the right limit either way.

### What if f′/g′ is still 0/0?

Apply the rule again: lim f/g = lim f″/g″, and so on. (1 − cos x)/x² at 0 is 0/0; so is sin(x)/(2x); and cos(x)/2 gives 1/2. The page tries up to three rounds.

### How do I use it for 0 · ∞ or ∞ − ∞?

Rewrite the expression as a quotient first. x ln(x) at 0 from the right is 0 · (−∞); written as ln(x)/(1/x) it is −∞/∞, and the rule gives lim (1/x)/(−1/x²) = lim (−x) = 0. For ∞ − ∞, combine the two terms over a common denominator.

### Why is there no answer for some limits?

The page shows only finite limits that it can check. An infinite limit, such as eˣ/x² at ∞, or one that does not exist, such as x/x² at 0 (−∞ on one side, ∞ on the other), gives no answer.

### How is the answer checked?

Every derivative the algebra finds is checked against a numeric difference quotient, and the limit against the quotient f(x)/g(x) itself, evaluated closer and closer to a from each side. If the check fails, the page says "No verified answer".

## Sources

- OpenStax, Calculus Volume 1, section 4.8 L'Hôpital's Rule: https://openstax.org/books/calculus-volume-1/pages/4-8-lhopitals-rule
