Skip to content

Simpson's Rule Calculator

Approximate ∫ f(x) dx with Simpson's 1/3 rule and see the full table of points and weights.

Updated · How we check our maths

Your values

Use x, + − * / ^, sin, cos, tan, exp, ln, log, sqrt, abs, pi, e.

You can type pi or e.

Results
Simpson's rule estimate
5.86827358
Step size h
0.523599
Trapezoid rule (same n)
5.64436367
Difference
0.22390991
x0 = 0 · weight 1
f = 0
x1 = 0.5236 · weight 4
f = 0.137078
x2 = 1.0472 · weight 2
f = 0.949703
x3 = 1.5708 · weight 4
f = 2.467401
x4 = 2.0944 · weight 2
f = 3.798813
x5 = 2.618 · weight 4
f = 3.426946
x6 = 3.1416 · weight 1
f = 0

Quick answer

Simpson's rule estimates a definite integral by fitting parabolas through groups of three points: ∫ₐᵇ f(x) dx ≈ (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 4f(xₙ₋₁) + f(xₙ)], where h = (b − a)/n and n is even. For x²·sin(x) from 0 to π with n = 6 it gives about 5.8683; the exact answer is π² − 4 ≈ 5.8696.

What the Simpson's Rule Calculator does

Enter any function of x, the limits and an even number of subintervals. The calculator lists every point x₀…xₙ with its Simpson weight (1, 4, 2, 4 … 4, 1), adds them up and multiplies by h/3. It also shows the trapezoid-rule result with the same points, so you can see how much the parabola fit improves the estimate.

Simpson's rule is exact for polynomials up to degree 3, and its error shrinks with h⁴ — doubling n usually makes the error about 16 times smaller.

The formula

S = (h/3) · [f(x₀) + 4Σf(x_odd) + 2Σf(x_even, interior) + f(xₙ)], h = (b − a)/n, n even.

Error bound: |E| ≤ (b − a)·h⁴·max|f⁽⁴⁾(x)| / 180.

Worked example

∫₀² x³ dx with n = 2: h = 1, points 0, 1, 2 → f = 0, 1, 8. S = (1/3)(0 + 4·1 + 8) = 4. The exact value is 2⁴/4 = 4 — Simpson's rule is exact for cubics.

How to use the Simpson's Rule Calculator

  1. Type the function using x (for example exp(-x^2)).
  2. Enter the limits a and b — numbers, pi or e are fine.
  3. Choose an even n; larger n gives a more accurate answer.
  4. Read the estimate, and compare it with the trapezoid rule result.

Frequently asked questions

Why must n be even?

Simpson's 1/3 rule fits one parabola across every pair of subintervals, so the subintervals must come in pairs.

How accurate is Simpson's rule?

Very accurate for smooth functions: the error falls with h⁴. It is exact for any polynomial of degree 3 or less.

What is the difference between Simpson's 1/3 and 3/8 rule?

The 3/8 rule fits cubics through groups of four points and needs n to be a multiple of 3. Both have similar accuracy; the 1/3 rule is the common default.

Does it work for improper integrals?

Not directly — f(x) must be finite at every sample point. Split the interval or use a substitution first.

Results are estimates for planning and learning. Check important figures with a qualified professional. How we build and check our calculators.