🧮
🧮 Math & statistics

Numerical Integration (Simpson’s rule) for Polynomials

Results update as you type.

Your numbers

Understanding the Simpson's rule integration calculator — concept and principle

A definite integral ∫ₐᵇ f(x) dx measures the signed area between a curve and the x-axis from x = a to x = b. This calculator estimates it numerically for a polynomial with Simpson's rule and the trapezoidal rule, and also shows the exact value from the antiderivative so you can see how accurate each method is. Numerical methods are how computers integrate measured data and functions with no closed-form antiderivative.

Trapezoid versus Simpson for x² on 0 to 3Straight trapezoid tops overshoot slightly (9.00045 with 100 strips); Simpson’s parabolas match x² exactly, giving 9.Area under x² from 0 to 3Trapezoidstraight tops overshootSimpsonparabola tops fit x²≈ 9.00045= 9 exactly(h/3)[f₀ + 4f₁ + 2f₂ + … + 4f₉₉ + f₁₀₀]h = 3 ÷ 100 = 0.03 · exact: 3³ ÷ 3 = 9Drawn with only a few strips; the calculator uses 100.
Red slivers are the trapezoid overshoot; Simpson’s parabola arcs fit x² with no gap.

How it is calculated

Split [a, b] into N equal intervals of width h = (b − a) ÷ N and let fᵢ = f(a + i·h).

Coefficients are entered from the highest power down, so "1 0 0" is f(x) = x².

The principle

The trapezoidal rule joins neighbouring points with straight lines and adds up the trapezoids. Simpson's rule fits a parabola through every three consecutive points and integrates the parabolas exactly; the weights 1, 4, 1 (times h/3) come from that parabola's area. Because a parabola matches curvature, Simpson's error shrinks like h⁴, while the trapezoid error shrinks only like h². Simpson's rule is exact for every polynomial of degree 3 or less.

Worked example

  1. Default inputs: f(x) = x², a = 0, b = 3, N = 100, so h = 0.03.
  2. Exact: F(x) = x³/3, so F(3) − F(0) = 27/3 = 9.
  3. Simpson: x² has degree 2, so the rule is exact and gives 9.
  4. Trapezoid: its error for a smooth f is (b − a)h²f″ ÷ 12 = 3 × 0.0009 × 2 ÷ 12 = 0.00045, so the result is 9.00045.
How Simpson changes with From aHow Simpson changes with From a-80-60-40-200200123456Example: 0From a
Each point is the calculator re-run with only “From a” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
From aSimpson
09
18.666666667
26.333333333
30
4-12.33333333
5-32.66666667
6-63

How to read the result

Compare the numerical results with the exact value. If Simpson and the exact value agree to many digits, the interval count is ample. The trapezoid result overestimates when the curve bends upward (f″ > 0) and underestimates when it bends downward. Doubling N cuts the trapezoid error by about 4 and the Simpson error by about 16. A negative result means more area lies below the x-axis than above it.

Common mistakes

Keep in mind: The error formulas assume a smooth function. For real data with noise, sharp corners or singularities, numerical integrals can be much less accurate than these examples suggest.

Frequently asked questions

Why is Simpson's rule exact for cubics even though it fits parabolas?

The error of the cubic term cancels by symmetry over each pair of intervals, so the leading error depends on the fourth derivative, which is zero for cubics.

How many intervals should I use?

Increase N until the result stops changing in the digits you care about.

What is Simpson's 3/8 rule?

A variant that fits cubics through four points with weights 1, 3, 3, 1 and factor 3h/8; it needs N divisible by 3.

Sources: Burden, R. L., Faires, J. D., Numerical Analysis, Chapter 4: Numerical Differentiation and Integration · NIST Digital Library of Mathematical Functions, §3.5 Quadrature (dlmf.nist.gov)

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →