# Trapezoidal Rule Integrator (∫f(x)dx)

Composite trapezoidal rule for ∫f(x)dx: node table, integral estimate, optional exact value and O(h²) error report.

> Canonical page: https://elysiatools.com/en/tools/numerical-integration-trapezoid

- **Category:** Math & Numbers

- **Keywords:** trapezoidal rule, trapezoid rule, numerical integration, integral calculator, approximate integral, quadrature, composite rule, calculus, definite integral, numerical methods

## Overview

The Trapezoidal Rule Integrator numerically evaluates definite integrals using the composite trapezoidal quadrature formula. It computes the step size h, generates an evaluated node table, calculates the integral approximation, and compares the result against an optional analytical antiderivative to report absolute error.

## Inputs

- **f(x) to integrate** (text): Integrand in x (functions: sin, cos, exp, ln, sqrt, …).
- **Lower Limit a** (number): e.g. 0
- **Upper Limit b** (number): May be less than a (the integral flips sign, as in calculus).
- **Subintervals n** (number): h = (b − a)/n. More subintervals → smaller error, O(h²) globally.
- **Exact Antiderivative F(x) (optional)** (text): Exact antiderivative in x; the tool reports F(b) − F(a) and the absolute error. Leave empty to skip.
- **Decimal Places** (number)

## When to use

- Approximating definite integrals for functions that lack elementary antiderivatives.
- Validating manual homework solutions or numerical analysis coursework with step-by-step node tables.
- Analyzing convergence rates and O(h²) truncation error by testing different subinterval counts.

## How it works

- Enter the integrand f(x), integration limits a and b, and the desired number of subintervals n.
- The tool partitions \[a, b\] into n segments of uniform width h = (b - a) / n and evaluates f(x) at each node x_i.
- It sums the endpoints and weighted interior terms via T = (h / 2) * \[f(a) + 2Σf(x_i) + f(b)\].
- Optionally enter an antiderivative F(x) to compute F(b) - F(a) and output the absolute error.

## Use cases

- Calculus students checking manual composite trapezoid rule calculations and intermediate node evaluations.
- Engineers estimating total work, accumulated flow, or area under continuous function curves.
- Numerical methods instructors demonstrating second-order truncation error and step-size convergence.

## Frequently asked questions

### What is the global truncation error of the trapezoidal rule?

The composite trapezoidal rule has an error order of O(h²), meaning doubling the number of subintervals roughly reduces the error by a factor of four.

### Can the upper limit b be smaller than the lower limit a?

Yes. When b < a, the step size h becomes negative, correctly reversing the sign of the definite integral.

### What math functions are supported in f(x)?

Standard expressions including polynomials, powers (^), sin, cos, exp, ln, sqrt, and basic arithmetic operations are supported.

### Is entering an antiderivative F(x) mandatory?

No. The antiderivative field is optional and only used to compute the analytical benchmark and absolute error.

### How many subintervals can I specify?

You can set n from 1 up to 100,000 subintervals to balance computational precision and table detail.

## Related tools

- [First-Order ODE Solver (Separation of Variables)](https://elysiatools.com/en/tools/first-order-ode-solver): Solve separable dy/dx = g(x)·h(y) symbolically: H(y) = G(x) + C, explicit inversion, initial conditions, and partial fractions for quadratics like y(1−y).
- [Newton-Raphson Root Finder](https://elysiatools.com/en/tools/newton-raphson-root-finder): Newton-Raphson iteration for f(x) = 0 with analytic or numeric derivative, full iteration table, and explicit convergence/divergence reporting.
- [Simpson's Rule Integrator (∫f(x)dx)](https://elysiatools.com/en/tools/numerical-integration-simpson): Composite Simpson's 1/3 rule for ∫f(x)dx (even n): node table with weights, integral estimate, optional exact value, O(h⁴) accuracy.
- [Runge-Kutta RK4 Solver (dy/dx = f(x, y))](https://elysiatools.com/en/tools/runge-kutta-rk4-solver): Classical fourth-order Runge-Kutta for dy/dx = f(x, y): step table, k1–k4 stage details, final estimate, and optional exact-solution error column.
- [Series Convergence Tester (Ratio/Root/Integral/Comparison)](https://elysiatools.com/en/tools/series-convergence-tester): Numeric convergence tests for Σ aₙ: nth-term, ratio, root, p-series comparison, and integral test; alternating series classified by Leibniz with a sum estimate.
- [Skewness Analyzer](https://elysiatools.com/en/tools/skewness-analyzer): Analyze data skewness to measure the asymmetry of probability distribution and identify data patterns
- [Convolution Integral Calculator (Numeric)](https://elysiatools.com/en/tools/convolution-integral-calculator): Numeric (f*g)(t) = ∫ f(τ)g(t−τ)dτ by composite Simpson, in causal or direct-window mode, at up to 8 output points.
- [Euler Method Solver (dy/dx = f(x, y))](https://elysiatools.com/en/tools/euler-method-solver): Explicit Euler integration for dy/dx = f(x, y): step table, final estimate, and optional exact-solution error column.

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion

## Related content

- [Audio Encoding and Format Conversion Tools](https://elysiatools.com/en/hubs/audio-convert): Compare audio format conversion, bitrate changes, sample-rate conversion, codec swaps, and export tools in one hub for delivery and archive workflows.
- [Image Format Conversion and Animated Export Tools](https://elysiatools.com/en/hubs/image-convert): Compare image format converters for JPG, PNG, GIF, AVIF, WebP, TIFF, ICO, base64, and animation-friendly exports in one hub.
- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
- [Color Space Conversion Tools for Web and Print](https://elysiatools.com/en/hubs/design-convert): Curated tools for web-to-print color space conversion in one hub.
