Mathematics & Graphing

Calculus Visualizer

Tangent, derivative and the area under the curve — analytic and numerical, side by side.

Standards: Differential and integral calculus Format: browser simulator Cost: free, no sign-up Reviewed: November 2026
Calculus Visualizer — live Differential and integral calculus
The shaded area is the integral; the tangent line is the derivative. Both are read off the same curve at the same point.

Inputs

0.4
-1
1
2

Presets

f(x₀)0.6000
Derivative at x₀ (exact)0.6000
Derivative (numerical)0.6000
Definite integral 0 → x₀1.0667
Tangent equationy = 0.600x + -0.600
Stationary pointx = 1.250
Second derivative0.800
Curvature directionconcave up (minimum)

Every number below is substituted from the current input state — change a slider and the arithmetic changes with it.

Function
→ f(x) = 0.4x² + -1x + 1
Derivative
→ f'(x) = 0.8x + -1 → f'(2) = 0.600
Numerical derivative
→ (f(x+h) − f(x−h))/2h with h = 1e-6 = 0.6000
Integral
→ ∫₀^2 f(x)dx = [0.4/3·x³ + -1/2·x² + 1x] = 1.0667
Tangent
→ y = f(x₀) + f'(x₀)(x − x₀)

The numerical derivative matches the analytic one to three decimal places — a central difference with h = 1e-6 is accurate to about h², which is why it is the default in most code.

Practice problem

The derivative is a slope and the integral is an area, but both are limits — and the value of seeing them drawn is that the limit stops being an abstraction.

This simulator draws the tangent at a chosen point, computes the derivative both analytically and by central difference, and shades the area under the curve from zero to that point, checked against Simpson’s rule.

The derivative as a local slope

For f(x) = ax² + bx + c the derivative is 2ax + b — the slope of the tangent at any x. At the vertex that slope is zero, which is exactly what "stationary point" means.

The numerical version, (f(x+h) − f(x−h))/2h, approximates the same number. With h = 1e-6 the error is around h², so six or seven digits agree; halving h again does not help, because floating-point subtraction starts to dominate.

The integral as accumulated area

The definite integral from 0 to x₀ is the signed area between the curve and the axis. Signed matters: area below the axis counts negative, which is why an integral can be zero even when the curve is visibly above and below the line.

For a quadratic the antiderivative is (a/3)x³ + (b/2)x² + cx, so the integral has a closed form. Simpson’s rule reproduces it to machine precision here because the rule is exact for polynomials up to cubic.

Analytic versus numerical

Simpson’s advantage is why numerical libraries use it for smooth integrands: doubling the number of points cuts the error by sixteen, against four for the trapezoid rule.

MethodFormulaBehaviour
Forward difference(f(x+h) − f(x))/hFirst-order error, biased
Central difference(f(x+h) − f(x−h))/2hSecond-order, symmetric
Trapezoidh/2·(f₀ + 2f₁ + … + fₙ)Second-order, simple
Simpsonh/3·(f₀ + 4f₁ + 2f₂ + …)Fourth-order, exact for cubics

What the picture does not show

The tangent is drawn over a short window, so it looks like it touches the curve along a stretch. It touches at exactly one point; the visual coincidence is a consequence of curvature being small at that scale.

The shaded area is likewise an approximation of the limit, computed with 200 subintervals. For a polynomial that is exact up to rounding, but for a function with a sharp feature the same visual would be misleading.

Frequently asked questions

Why do the analytic and numerical derivatives differ in the last digits?

Because the numerical version subtracts two nearly equal numbers and divides by a tiny h, which amplifies floating-point error. Agreement to six or seven decimals is the expected result, not a bug.

What does a negative integral mean?

That the area below the axis outweighs the area above it over that interval. The integral is a signed sum, not a geometric area; take absolute values if you want the total area.

Why is the tangent flat at some points?

Because the derivative is zero there — a stationary point. For a quadratic that happens only at the vertex, where the curve turns from falling to rising.

Can this handle other functions?

The page is limited to quadratics so that the closed-form answers stay simple and checkable. The numerical methods it shows apply to any smooth function, which is the point of comparing them.

BR

Written and reviewed by Bloom Rocket editorial desk

Bloom Rocket is built and maintained by a small independent team. Every page states the equations it implements and the standards it references, so the working can be checked rather than taken on trust.

How these simulators are built and checked →

Keep going

More mathematics simulators

All Mathematics →