Trapezoidal Rule Calculator

Approximate the definite integral of any function over [a, b] using the composite trapezoidal rule with n subintervals.

Use the Trapezoidal Rule Calculator

Inputs

Supports: +, -, *, /, ^, sin, cos, tan, exp, log, ln, sqrt, abs, pi, e

Enter values above and click Calculate to see the approximation.

Copied to clipboard!

Summary

The Trapezoidal Rule Calculator approximates the definite integral of a function over a closed interval [a, b] by dividing the interval into n equal subintervals and summing the areas of the trapezoids formed under the curve. It evaluates the function at each partition point and applies the composite trapezoidal formula: h/2 * [f(x0) + 2f(x1) + ... + 2f(x_{n-1}) + f(xn)], where h = (b-a)/n. This numerical integration method is straightforward and useful when an exact antiderivative is difficult or impossible to find.

How it works

  1. Enter a mathematical function such as x^2, sin(x), or e^x in the function field.
  2. Set the lower bound a and upper bound b for the integration interval.
  3. Choose the number of subintervals n (higher values give more accurate results).
  4. Click Calculate to apply the composite trapezoidal rule formula.
  5. Review the approximation result along with the step-size h and the partition table.

Use cases

  • Estimate areas under curves when an exact integral is hard to compute analytically.
  • Verify hand-calculated numerical integration homework answers.
  • Explore how increasing n reduces approximation error.
  • Integrate empirical data functions in physics and engineering problems.
  • Teach or learn the composite trapezoidal method step by step.
  • Quick numerical check before applying more complex methods like Simpson's rule.

Frequently Asked Questions

Last updated: 2026-06-04 · Reviewed by Nham Vu