Definite Integral Calculator
Compute definite integrals using Simpson's rule, trapezoid rule, and adaptive quadrature. Compare accuracy across subinterval counts n=10, 100, 1000.
Simpson's Rule ∫ₐᵇ f(x)dx (numerical approx.)
—
Average value of f on [a,b] —
Area (unsigned, |f(x)|) —
Extended More scenarios, charts & detailed breakdown ▾
Simpson's 1/3 (numerical approx.)
—
Professional Full parameters & maximum detail ▾
Integration Results
Adaptive (recursive midpoint, numerical approx.) —
Simpson's 1/3 (n=1000) —
Error estimate |adaptive − Simpson| —
Interpretation
Average value of f —
Signed vs unsigned area difference —
How to Use This Calculator
- Enter f(x), lower bound a, and upper bound b.
- Set the number of subintervals n (must be even for Simpson's rule).
- Switch to the Trapezoid tab to compare with the trapezoid rule.
- Use Compare n to see how accuracy improves with more subintervals.
- The Professional tab adds adaptive quadrature and error bounds.
Formula
Simpson's 1/3: (h/3)[f(x₀)+4f(x₁)+2f(x₂)+4f(x₃)+…+f(xₙ)]
Trapezoid: (h/2)[f(x₀)+2f(x₁)+…+2f(xₙ₋₁)+f(xₙ)]
Example
∫₀^π sin(x) dx = 2.000000 (exact). Simpson n=1000 gives 2.00000000 — 8 correct digits.
Frequently Asked Questions
- The trapezoid rule approximates the area using trapezoids (linear interpolation). Simpson's rule uses parabolas (quadratic interpolation) and is typically 4th-order accurate vs 2nd-order for trapezoid.
- For a smooth function, Simpson's 1/3 rule with n=1000 gives accuracy of about O(h⁴) = O(10⁻¹²), well beyond the precision needed for most calculations.
- The mean value theorem for integrals states the average value is (1/(b−a))∫ₐᵇ f(x)dx. This represents the height of a rectangle with the same area as under the curve.
- The definite integral gives signed area — regions below the x-axis contribute negatively. Unsigned area uses |f(x)| so all regions contribute positively.
- More subintervals means each parabolic/trapezoidal piece covers a smaller interval, reducing approximation error. The 'Compare n' tab shows how the result converges as n grows.
Related Calculators
Sources & References (5) ▾
- Numerical Integration — Paul's Online Math Notes — Lamar University
- MIT OCW 18.01 Numerical Integration — MIT
- NIST Digital Library of Mathematical Functions — NIST
- Burden & Faires — Numerical Analysis (reference) — Cengage
- Calculus Volume 2 (OpenStax) — OpenStax