Home  18.013A  Chapter 25 


In the notation of the last section the actual area under the function $f$ in the interval between $\frac{d}{2}$ and $\frac{d}{2}$ will be
The trapezoid rule that we have described, on the other hand, gives the following proposed answer for this area
while the "midpoint rule" approximates the area as $f(0)d$ .
This means that if we mix two parts of the midpoint rule and one part of the trapezoid rule, we will get the quadratic $b$ term exactly right, and the leading term in the error will come from the $e$ term which will be on the order of ${d}^{4}$ .
The rule for approsimating integrals just described is called Simpson's rule, and it takes the following form in the interval between $\frac{d}{2}$ and $\frac{d}{2}$
Notice that in this formula $f$ is evaluated at intervals $\frac{d}{2}$ apart . If we give the parameter $\frac{d}{2}$ a new name here, calling it $h$ , the Simpson's rule formula in terms of $h$ becomes
and it represents an approximation to the area under the curve defined by $f$ in the interval from $h$ to $h$ ; an approximation whose error is of fourth order in $h$ .
It is worthwhile noticing what these various rules look like when applied to a number of small subintervals in a row.
The trapezoid rule gives equal weight $d$ to evaluations at all intermediate points, since each is the left end and the right end of one subinterval and it gets $\frac{d}{2}$ weight from each end.
The end two evaluations on the other hand are ends of only one subinterval each, and these get weight $\frac{d}{2}$ .
The midpoint rule gives equal weight to the odd numbered evaluations of $d$ or $2h$ .
Simpson's rule gives weights that form the pattern $14242\dots 41$ multiplied by $\frac{h}{3}$ , since the midpoints get weight $\frac{2}{3}$ and the trapezoid rule divided by 3 accounts for the rest.

endpoint $a$ 
midpoint first interval $a+h$ 
end first interval $a+2h$ 
midpoint second interval $a+3h$ 
end second interval $a+4h$ 
etc. 
Trapezoid rule terms 
$hf(a)$ 
0 
$2hf(a+2h)$ 
0 
$2hf(a+4h)$ 
etc. 
Midpoint rule terms 
0 
$2hf(a+h)$ 
0 
$2hf(a+3h)$ 
0 
etc. 
Simpson's rule terms 
$h\frac{f(a)}{3}$  $4h\frac{f(a+h)}{3}$  $2h\frac{f(a+2h)}{3}$  $4h\frac{f(a+3h)}{3}$  $2h\frac{f(a+4h)}{3}$ 
etc. 
Notice that the leading term in the power series for $f$ that produces an error in Simpson's rule is the $e{x}^{4}$ term, and that produces an error which goes down by a factor of 16 if we divide our intervals in half.
