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=1
Step 2 — Simpson weights
Use Simpson weights in the point table.
i012x012f0116w141wf0416
Step 3 — Weighted sum
Add the weighted Simpson values.
Step 4 — Simpson estimate
Multiply by h over 3 for Simpson's estimate.
Simp=31⋅20=320
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))