L'Hôpital's Rule Calculator
Resolve a 0/0 or ∞/∞ limit of f(x)/g(x) by repeated differentiation, showing the indeterminate form found at each pass and the full chain of derivatives down to the final answer.
Input
A number, or Infinity / -Infinity for a limit at infinity.
Output
More ways to use this tool
REST API
curl -X POST https://api.iotools.cloud/v1/tool/lhopitals-rule-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"f": "sin(x)",
"g": "x",
"variable": "x",
"point": "0"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `lhopitals-rule-calculator` tool (L'Hôpital's Rule Calculator) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.
Embed widget
<iframe
src="https://iotools.cloud/embed/lhopitals-rule-calculator/"
width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
title="L'Hôpital's Rule Calculator — iotools.cloud"
sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
allow="clipboard-write"
style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>Drop this into your own page — free, no key required, just a link back.
| Cost per API/MCP call | From 5 credits |
|---|---|
| Need more credits? | View pricing |
Also available with
Guides
The L'Hôpital's Rule Calculator resolves a limit of the form f(x)/g(x) as x approaches a point a, whenever direct substitution gives an indeterminate 0/0 or ∞/∞ form. It repeatedly differentiates the numerator and denominator until the form is no longer indeterminate, then evaluates the resulting ratio — showing the form found at each pass and the full chain of derivatives down to the final answer.
It's built for calculus students checking a limit by hand, and for anyone who needs to resolve an indeterminate limit without differentiating the same expression over and over on paper.
How to use it
- Enter the numerator f(x) and denominator g(x) — standard math notation works:
^for powers,*for multiplication, plussqrt(),sin(),cos(),log(), and the other functions supported by mathjs's expression parser. - Choose the variable (x, y, z, or t) and enter the limit point a — a plain number, or
Infinity/-Infinityfor a limit at infinity. - Read Limit for the final answer, Indeterminate Form for what direct substitution produced (
0/0,∞/∞, or "not indeterminate" if the rule didn't need to run), and Rule Applications for how many times it differentiated. - Step-by-Step Derivation shows f(a) and g(a) at every pass, each differentiation, and the final evaluation.
Results update automatically as you type. For example, sin(x)/x as x → 0 is a 0/0 form; one application gives cos(x)/1, which evaluates to 1 — so the limit is 1. ln(x)/x as x → Infinity is an ∞/∞ form; one application gives (1/x)/1, which evaluates to 0 at infinity — so the limit is 0.
What is L'Hôpital's rule?
If f(a)/g(a) is 0/0 or ∞/∞ (an indeterminate form — direct substitution gives no real answer), then, provided the derivatives exist and g′ doesn't vanish near a:
lim(x→a) f(x)/g(x) = lim(x→a) f′(x)/g′(x)If the new ratio is still indeterminate, the rule can be applied again to f″/g″, and so on — this calculator applies it automatically, up to 6 times, and stops as soon as substitution gives a genuine number (or diverges to ±∞).
Why check the form before differentiating?
L'Hôpital's rule only applies to a genuine 0/0 or ∞/∞ form — applying it to a limit that already evaluates directly gives a wrong answer, not just an unnecessary one. This calculator evaluates f(a) and g(a) separately (never as one ratio) before touching a derivative, so it only invokes the rule when the form actually justifies it, and reports "not indeterminate" plus the direct answer otherwise.
What functions can I enter?
Anything mathjs's expression evaluator understands: polynomials (x^2 - 1), trigonometric functions (sin(x)), roots, exponentials, and logarithms (sqrt(x), exp(x), log(x)), and combinations of these. Angles in trig functions are in radians by default — write pi for π.
To find a partial derivative of a multivariable function step by step, see the Partial Derivative Calculator.
Privacy
This calculator runs entirely in your browser. Your functions and limit point are never uploaded, logged, or stored — the computation happens locally on your device.