Slope estimate

Numerical derivative calculator

Educational tool; results are estimates for learning, verify with your textbook or instructor.

A scientific calculator and pencils on a wooden desk.
A desk calculator for checking a slope after you know what the derivative means.

This tool estimates the slope of a simple function at one point by a difference quotient. You type an expression in $x$, a point $x_0$, and a step size $h$. The number you get is a numerical estimate of $f'(x_0)$ when $f$ is smooth enough near that point.

The estimate is meaningful when $f$ is defined at the sample points the method uses, and when $h$ is small enough that the secant looks like the tangent, yet large enough that rounding does not swallow the change in $f$.

This is not a computer algebra system. It does not simplify a formula, it does not prove that $f$ is differentiable, and it does not solve an implicit equation $F(x,y)=0$. For the meaning of the number itself, read what a derivative actually measures.

Allowed pieces: numbers, $x$, plus, minus, times, divide, powers, parentheses, and $\sin$, $\cos$, $\tan$, $\mathrm{sqrt}$, $\mathrm{abs}$, $\log$ (natural), $\exp$, $\pi$, $e$. Type them as sin, cos, tan, sqrt, abs, log, exp, pi, e.

How to use the estimator

Start with a function you already know. The default $x^2$ at $x_0=3$ with $h=0.001$ is a good first check. The true derivative is $2x$, so a trustworthy run should land near $6$. If it does not, check the expression spelling before you trust a harder example.

Pick a method. Central difference samples both sides and is usually the most accurate on a smooth graph. Forward difference only looks to the right of $x_0$. Backward difference only looks to the left. Use a one sided method when the formula is missing on the other side, such as $\sqrt{x}$ at $0$.

Press Estimate slope. The large number is the estimate. The note under it repeats the difference formula and the sampled values, so you can see what was subtracted.

How to read the output

Treat the output as a probe, not a certificate. Cut $h$ by a factor of ten and run again. If the estimate barely moves, you are probably near a stable slope. If it jumps around as $h$ shrinks, you are seeing rounding noise or a corner the tangent cannot settle on.

Units still belong to you. If $f$ is position in meters and $x$ is time in seconds, the estimate is meters per second. The page does not know units. You attach them after you know what $f$ measures.

Common pitfalls

A huge $h$ measures a long secant, not a tangent. A tiny $h$, such as $10^{-16}$, can make $x_0$ and $x_0+h$ identical in floating point, so the quotient becomes junk. Stay in a band like $10^{-2}$ down to $10^{-6}$ unless you have a reason to leave it.

A jump, a corner, or a vertical tangent will not settle no matter how carefully you pick $h$. The parser only accepts the short list above. It is not general code, and it will reject extra names.

A central difference at a point that is defined on only one side can look worse than a one sided difference. Match the method to the domain you actually have.

Related reading

Read what a derivative actually measures before you treat the output as a rate. If the slope is hidden in an equation rather than an explicit $y=f(x)$, use implicit differentiation intuition. For the limit idea behind the difference quotient, see epsilon delta intuition and the derivative glossary entry.

The matching map is calculus foundations. A course shaped path is the AP Calculus AB bridge. Nearby tools: numerical limit estimator and Riemann sum calculator.

Disclaimer. Educational estimate only. This page is not a computer algebra system and not a proof. See the site disclaimer and the FAQ on calculators versus understanding.

Common questions

What does the output number mean?

It is a difference quotient that approximates the slope of f at x0. If f is differentiable there, the number should sit near f prime of x0. It is an estimate, not a symbolic derivative.

Why does a smaller step size sometimes look worse?

Truncation error falls as h shrinks, then rounding error rises. Past a point the computer cannot see the change in f, so the quotient becomes noisy. Try a few values of h and keep the plateau, not the tiniest h.

Is this the same as a computer algebra derivative?

No. The page never rewrites your formula. It only evaluates numbers. A course that wants an exact derivative still wants algebra on paper.

When should I use a one sided difference?

Use forward or backward when the function is missing on one side of the point, or when a one sided derivative is the object you care about. Central difference needs both sides.

Can I type any formula?

No. Only a short list of operations and named functions is accepted. That limit is intentional. The tool is a numerical probe, not a general interpreter.

Want a tool that matches a new explainer, or a check that a page and a calculator disagree? Write a short note.

Suggest a topic or tool