Simpson’s Rule Calculator

Fit a parabola through every pair of slices. Enter f(x), [a, b] and an even n to get Sₙ, the arcs drawn on the graph, the 1-4-2-4-1 weight table and the error against the exact integral.

Reads as x2x^{2}
Try:

Simpson sum with n = 4

9

Exact ∫03x2 dx=9\int_{0}^{3} x^{2}\,dx = 9 · error 0

0.511.522.5324681012

The formula

S4=Δx3[f(x0)+4f(x1)+2f(x2)+⋯+4f(xn−1)+f(xn)],Δx=0.75S_{4} = \frac{\Delta x}{3}\left[f(x_0) + 4f(x_1) + 2f(x_2) + \dots + 4f(x_{n-1}) + f(x_n)\right],\quad \Delta x = 0.75
Each slice
iixix_if(xi)f(x_i)weight
0001
10.750.56254
21.52.252
32.255.06254
4391

All five methods, n = 4

MethodEstimateError
Left5.90625-3.09
Right12.656253.66
Midpoint8.859375-0.141
Trapezoid9.281250.281
Simpson90

Still stuck? Ask the tutor

An AI tutor reads the problem and steps above and explains them in plain words. It can make mistakes, so check it against the worked steps.

The simpson’s rule formula

Sn=Δx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+⋯+4f(xn−1)+f(xn)]S_n = \frac{\Delta x}{3}\left[f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + \cdots + 4f(x_{n-1}) + f(x_n)\right]

Simpson’s rule replaces the curve over each pair of slices with the parabola through three points. Integrating that parabola exactly gives the weights Δx3(1,4,1)\frac{\Delta x}{3}(1, 4, 1), and overlapping pairs produce the 1, 4, 2, 4, …, 4, 1 pattern.

nn must be even. If you enter an odd nn, the calculator rounds up to the next even number.

Error bound: if ∣f(4)(x)∣≤K|f^{(4)}(x)| \le K on [a,b][a,b], then ∣ES∣≤K(b−a)5180n4|E_S| \le \frac{K(b-a)^5}{180n^4}. Doubling nn cuts the error by about 16, and the rule is exact for every polynomial up to degree 3.

Simpson’s rule is a weighted average of the other two: S2n=2Mn+Tn3S_{2n} = \frac{2M_n + T_n}{3}.

Compare all five methods side by side on the Riemann sum calculator, or try another single rule: Trapezoidal rule, Midpoint rule, Left Riemann sum, Right Riemann sum.

Questions students ask

What is Simpson’s rule formula?

Sn=Δx3[f(x0)+4f(x1)+2f(x2)+⋯+4f(xn−1)+f(xn)]S_n = \frac{\Delta x}{3}[f(x_0) + 4f(x_1) + 2f(x_2) + \cdots + 4f(x_{n-1}) + f(x_n)] with Δx=b−an\Delta x = \frac{b-a}{n} and nn even.

Why does Simpson’s rule need an even number of intervals?

Each parabola spans two subintervals (three points), so the subintervals must pair up exactly.

What is the error bound for Simpson’s rule?

∣ES∣≤K(b−a)5180n4|E_S| \le \frac{K(b-a)^5}{180n^4} where KK bounds ∣f(4)∣|f^{(4)}| on [a,b][a,b].

Why is Simpson’s rule exact for cubics?

The fourth derivative of a cubic is zero, so the error bound is zero. Try x3x^3 in the calculator: the error column shows 0.

What is Simpson’s 3/8 rule?

A variant that fits cubics through four points, with weights 3Δx8(1,3,3,1)\frac{3\Delta x}{8}(1, 3, 3, 1). It needs nn to be a multiple of 3 and has a similar accuracy to the 1/3 rule.