Mathematics · Calculus · Integral Calculus
Integral Calculator
Calculate definite integrals numerically using Simpson's Rule for accurate approximations of area under a curve.
Calculator
Formula
Where a and b are the lower and upper bounds, h = (b - a) / n is the step size, n is the number of subintervals (must be even), and x_i = a + i·h are the sample points.
Source: Standard numerical analysis — Simpson's Rule (composite form), widely documented in Numerical Methods textbooks.
How it works
Simpson's Rule approximates the area under a curve by fitting parabolic segments between pairs of sample points. The interval [a, b] is divided into n equal subintervals (n must be even), and the weighted sum of function values at each point is multiplied by h/3, where h is the step size. The weights alternate as 1, 4, 2, 4, 2, …, 4, 1.
For polynomial functions up to degree 3, Simpson's Rule is exact because its error term involves the fourth derivative, which vanishes. For higher-degree polynomials or transcendental functions, increasing n reduces the approximation error proportional to h⁴, making it highly efficient.
Worked example
Suppose you want to integrate f(x) = x² + 2x + 1 from a = 0 to b = 3 with n = 4 subintervals.
Step 1 — Step size: h = (3 − 0) / 4 = 0.75
Step 2 — Sample points: x₀ = 0, x₁ = 0.75, x₂ = 1.5, x₃ = 2.25, x₄ = 3
Step 3 — Function values: f(0) = 1, f(0.75) = 3.0625, f(1.5) = 6.25, f(2.25) = 10.5625, f(3) = 16
Step 4 — Apply weights (1, 4, 2, 4, 1): Sum = 1·1 + 4·3.0625 + 2·6.25 + 4·10.5625 + 1·16 = 1 + 12.25 + 12.5 + 42.25 + 16 = 84
Step 5 — Multiply by h/3: (0.75 / 3) × 84 = 21
Exact check: ∫₀³ (x² + 2x + 1) dx = [x³/3 + x² + x]₀³ = (9 + 9 + 3) − 0 = 21 ✓
Limitations & notes
This calculator is limited to quadratic polynomial functions (ax² + bx + c). Transcendental functions such as sin(x), e^x, or ln(x) cannot be entered directly — a dedicated symbolic or general numerical integrator is needed for those. Simpson's Rule also requires an even number of subintervals; the calculator automatically increments odd inputs by 1. For very wide intervals with rapidly oscillating functions, n may need to be very large for sufficient accuracy.
Frequently asked questions
What is a definite integral?
A definite integral computes the net signed area between a function f(x) and the x-axis over an interval [a, b]. Regions above the x-axis contribute positive area, while regions below contribute negative area.
Why does Simpson's Rule require an even number of subintervals?
Simpson's Rule fits parabolas across pairs of consecutive subintervals, so it requires an even number n to pair them correctly. Using an odd n leaves one subinterval unmatched, making the formula undefined.
How accurate is Simpson's Rule?
Simpson's Rule is exact for polynomials of degree 3 or lower and has an error of order O(h⁴) for smoother functions. Doubling n reduces the error by a factor of roughly 16.
Can I integrate functions like sin(x) or e^x with this calculator?
No — this calculator supports only quadratic polynomials (ax² + bx + c). For other functions, a general-purpose computer algebra system or numerical integrator is required.
What does a negative integral value mean?
A negative result means the function lies predominantly below the x-axis over the integration interval. It represents a net negative signed area, not a geometric area.
Last updated: 2025-01-15 · Formula verified against primary sources.