Math · Calculus

Trapezoidal Rule Calculator

Approximate a definite integral numerically with the trapezoid rule, Simpson’s rule and the midpoint rule — with per-interval values and error estimates.

Examples:
Approximate integral ∫ab f(x) dx
Trapezoid rule—
Step size h
—
f(a)
—
f(b)
—
Reference (n=2000)
—
Abs. error
—
Enter a function and limits to see the step-by-step breakdown.
Trapezoidal rule
∫ab f(x)dx ≈ (h/2) · [ f(x₀) + 2f(x₁) + 2f(x₂) + … + 2f(xn−1) + f(xn) ]
The interval [a, b] is split into n equal strips of width h = (b − a)/n. Each strip is treated as a trapezoid, and the areas are summed. The error decreases as ∼ h², so doubling n shrinks the error by about a factor of 4. Simpson’s 1/3 rule fits parabolas over pairs of strips (requires even n) and converges much faster at ∼ h⁴. The midpoint rule samples the function at the centre of each strip.

⏱ Step-by-step intervals

Every xₛ, f(xₛ) and strip area is listed so you can follow the sum.

🏷 Three methods

Trapezoid, Simpson’s 1/3 and midpoint rules compared side by side.

⌀ Error estimate

Compare against a high-resolution reference to see how accurate each rule is.

∞ Rich functions

Supports sin, cos, exp, log, sqrt and powers — write x^2, sin(x), e^x…

Need more Math tools?

Try the Simpson’s-rule friendly integral calculator or the derivative workhorse in our math suite.

Integral Calculator