Trapezoidal Rule Calculator

Numerical integration with trapezoids

CalculatorsFreeNo Signup
4.3(488 reviews)
All Tools

Loading tool...

About Trapezoidal Rule Calculator

A trapezoidal rule calculator for numerical integration. Approximates ∫f(x)dx using trapezoids: T = (h/2)[f(a)+2f(x₁)+...+2f(xₙ₋₁)+f(b)]. Shows error estimate, compares with Simpson's rule, and allows adjustable subdivisions. All calculations are client-side. Essential for numerical analysis, physics, and engineering.

Trapezoidal Rule Calculator Features

  • 6 functions
  • Adjustable n
  • Error estimate
  • Simpson compare
  • Step values
Trapezoidal rule: T = (h/2)[f(a)+2Σf(xᵢ)+f(b)] where h=(b−a)/n. Error ≤ (b−a)³/(12n²)·max|f″|. More accurate than left/right Riemann sums. Simpson's rule (using parabolas) is even more accurate: S = (h/3)[f(a)+4f(x₁)+2f(x₂)+...+f(b)].

How to Use

Set up the integral:

  • Function: Choose from presets
  • Bounds: a and b
  • Subdivisions: n trapezoids

Error Analysis

  • Error = O(h²) — doubles n, cuts error by 4
  • Exact for linear functions
  • Simpson: O(h⁴) — much more accurate

Composite Formula

Split [a,b] into n equal parts. Each trapezoid has width h. Interior points are counted twice (shared edges). End points counted once.

Step-by-Step Instructions

  1. 1Select a function.
  2. 2Set lower bound a.
  3. 3Set upper bound b.
  4. 4Choose number of subdivisions.
  5. 5Compare with Simpson's rule.

Trapezoidal Rule Calculator — Frequently Asked Questions

Why is the trapezoidal rule better than rectangles?+

Trapezoids approximate the curve with straight lines between points, capturing the slope. Rectangles use flat tops, ignoring the function's behavior between sample points.

How many subdivisions do I need?+

Depends on the function. For smooth functions, 10-100 subdivisions often give good accuracy. Error decreases as 1/n², so doubling n gives 4× more accuracy.

When is the trapezoidal rule exact?+

For linear functions f(x) = mx+b. The trapezoids perfectly match the straight line. For quadratics, use Simpson's rule instead (it's exact for cubics too).

Share this tool: