Home | 18.013A | Chapter 25 | | Tools Glossary Index Up Previous Next

25.2 Simpson's Rule

In the notation of the last section the actual area under the function f in the interval between − d 2 and d 2 will be

f ( 0 ) d + b d 3 12 + e d 5 80 + ⋯

The trapezoid rule that we have described, on the other hand, gives the following proposed answer for this area

f ( 0 ) d + b d 3 4 + e d 5 16 + ⋯

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 − d 2 and d 2

( f ( − d 2 ) + 4 f ( 0 ) + f ( d 2 ) ) d 6

Notice that in this formula f is evaluated at intervals d 2 apart . If we give the parameter d 2 a new name here, calling it h , the Simpson's rule formula in terms of h becomes

( f ( − h ) + 4 f ( 0 ) + f ( h ) ) h 3

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 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 d 2 .

The midpoint rule gives equal weight to the odd numbered evaluations of d or 2 h .

Simpson's rule gives weights that form the pattern 14242 … 41 multiplied by h 3 , since the midpoints get weight 2 3 and the trapezoid rule divided by 3 accounts for the rest.

endpoint

a

midpoint first interval

a + h

end first interval

a + 2 h

midpoint second interval

a + 3 h

end second interval

a + 4 h

etc.

Trapezoid rule terms | h f ( a ) | 0 | 2 h f ( a + 2 h ) | 0 | 2 h f ( a + 4 h ) | etc.
Midpoint rule terms | 0 | 2 h f ( a + h ) | 0 | 2 h f ( a + 3 h ) | 0 | etc.
Simpson's rule terms | h f ( a ) 3 | 4 h f ( a + h ) 3 | 2 h f ( a + 2 h ) 3 | 4 h f ( a + 3 h ) 3 | 2 h f ( a + 4 h ) 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.

Up Previous Next