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

  1. Enter f(x), lower bound a, and upper bound b.
  2. Set the number of subintervals n (must be even for Simpson's rule).
  3. Switch to the Trapezoid tab to compare with the trapezoid rule.
  4. Use Compare n to see how accuracy improves with more subintervals.
  5. 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)
  1. Numerical Integration — Paul's Online Math Notes — Lamar University
  2. MIT OCW 18.01 Numerical Integration — MIT
  3. NIST Digital Library of Mathematical Functions — NIST
  4. Burden & Faires — Numerical Analysis (reference) — Cengage
  5. Calculus Volume 2 (OpenStax) — OpenStax