# Simpson's Rule Integrator (∫f(x)dx)

Composite Simpson's 1/3 rule for ∫f(x)dx (even n): node table with weights, integral estimate, optional exact value, O(h⁴) accuracy.

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

- **Category:** Math & Numbers

- **Keywords:** simpson's rule, simpson rule, numerical integration, integral calculator, approximate integral, quadrature, simpson 1/3, calculus, definite integral, numerical methods

## Overview

The Simpson's Rule Integrator approximates definite integrals using the composite Simpson's 1/3 rule. It evaluates mathematical expressions over an interval divided into an even number of subintervals, producing a node-by-node table with quadrature weights, an integral estimate with O(h⁴) convergence, and optional error analysis against an exact antiderivative.

## 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 (even)** (number): Must be even. h = (b − a)/n; global error is O(h⁴) — halving h divides the error by ~16.
- **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

- Integrating non-elementary functions like e^(-x^2) or sin(x)/x that lack closed-form antiderivatives.
- Verifying numerical analysis coursework and homework against exact algebraic antiderivatives.
- Approximating definite integrals quickly with high fourth-order accuracy using a modest number of intervals.

## How it works

- Enter the integrand f(x), lower bound a, upper bound b, and an even number of subintervals n to set step size h = (b - a) / n.
- The tool evaluates f(x) at each grid point x_i and applies alternating Simpson weights (1, 4, 2, 4, ..., 1).
- It sums the weighted values and multiplies by h/3 to compute the composite Simpson integral approximation.
- If an exact antiderivative F(x) is supplied, it calculates F(b) - F(a) and outputs the absolute truncation error.

## Use cases

- Evaluating Gaussian probability integrals and error functions over finite intervals.
- Engineering simulations requiring rapid quadrature for non-linear load curves and response spectra.
- Numerical methods coursework demonstrating O(h⁴) error reduction across varying grid sizes.

## Frequently asked questions

### Why does the number of subintervals n need to be an even number?

Composite Simpson's 1/3 rule fits parabolas across pairs of adjacent subintervals, which requires an even number of divisions.

### What functions and operators can I use in f(x)?

You can use standard mathematical operations and built-in functions such as sin, cos, exp, ln, sqrt, and power expressions.

### Why is the estimate exact for quadratic and cubic polynomials?

Simpson's 1/3 rule has a degree of precision of 3, meaning its truncation error term relies on the fourth derivative, which is zero for polynomials up to degree 3.

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

Yes. When b is less than a, the step size h is negative, and the integral flips sign according to standard calculus rules.

### What is the purpose of the exact antiderivative field?

Entering F(x) computes the theoretical value F(b) - F(a) to display the exact absolute error alongside the numerical approximation.

## 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.
- [Trapezoidal Rule Integrator (∫f(x)dx)](https://elysiatools.com/en/tools/numerical-integration-trapezoid): Composite trapezoidal rule for ∫f(x)dx: node table, integral estimate, optional exact value and O(h²) error report.
- [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.
- [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.
- [Fitness Workout PDF Generator](https://elysiatools.com/en/tools/fitness-workout-pdf-generator): Generate a printable workout-plan PDF from JSON or CSV data with exercise tables, progress boxes, and optional QR video links

## 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.
