Simpson's rule approximates a definite integral using three equally-spaced points with h=(b-a)/2: S = (h/3)(f(a) + 4f(a+h) + f(b)). Example: f(x)=x⁴, [0,2], h=1 gives S=20/3; true=32/5, error=4/15.

Simpson's rule is exact for polynomials of degree ≤ 3.

Example

Use Simpson weights to estimate the integral.

highlighted = computed this step

Step 1 — Set up

Set up Simpson's rule on the interval.

f(x)=x4[0,2]h=1f(x)= x^{4} \quad [ 0 , 2 ]\quad h= 1

Step 2 — Simpson weights

Use Simpson weights in the point table.

ixfwwf00010111442216116\begin{array}{ccccc}\text{i} & \text{x} & \text{f} & \text{w} & \text{wf} \\ 0 & 0 & 0 & \hlmath{1} & \hlmath{0} \\ 1 & 1 & 1 & \hlmath{4} & \hlmath{4} \\ 2 & 2 & 16 & \hlmath{1} & \hlmath{16}\end{array}

Step 3 — Weighted sum

Add the weighted Simpson values.

S=20S= \hl{20}

Step 4 — Simpson estimate

Multiply by h over 3 for Simpson's estimate.

Simp=1320=203Simp= \frac{1}{3} \cdot 20 = \hlmath{\frac{20}{3}}
simpsons-rule For three equally-spaced points x0,x1,x2 with h=x1-x0=x2-x1: S = (h/3)(f(x0) + 4*f(x1) + f(x2))