Simpson's Rule


By Marcos Charalambides on Saturday, November 16, 2002 - 11:17 am:

What is Simpson's Rule and how can we derive it?

Thanks


By Colin Prue on Saturday, November 16, 2002 - 02:25 pm:

simpson's rule is almost the trapezium rule, except that it is based on the area under parabolas instead of trapezia

For a parabola on the interval [-h,h]:

-h h (a x2 +bx+c)dx=(3/h)( y0 +4 y1 + y2 )

where if f(x)=a x2 +bx+c

f(-h)= y0 , f(0)= y1 , f(h)= y2
this can be proven, if necessary, by inspection of the general case.

Therefore, if we divide a curve into AN EVEN number of sub-intervals of equal length, its area can be approximated (with more accuracy in most cases than the trapezum rule), with the sum of the areas under parabolas extending across PAIRS of subintervals using the following rule.

a b g(x)dx=h/3(( y0 +4 y1 + y2 )+( y2 +4 y3 + y4 )+( y4 +4 y5 + y6 )++( yn-3 +4 yn-2 + yn-1 )+( yn-2 +4 yn-1 + yn ))

But as every yi where i is even occurs twice, this can be reduced to the following:

a b g(x)dx=h/3( y0 +4 y1 +2 y2 +4 y3 +2 y4 ++2 yn-2 +4 yn-1 + yn )

where yi is the value of g(x) at the partition point xi =a+i×h

for the approximation to work:

n is even, and h=(b-a)/n


By Marcos Charalambides on Saturday, November 16, 2002 - 03:05 pm:

Thanks a lot...
Yeah, it seems to be a lot more accurate than the trapezium rule (in the cases I've tried)


By Kerwin Hui on Saturday, November 16, 2002 - 11:16 pm:
In case you are wondering, Marcos, there is also a variant of this known as the Simpson's 3/8-rule, which is based on cubics rather than quadratics. It basically says

0 3h f(x)dx=h[f(0)+3f(h)+3f(2h)+f(3h)]/8 is exact on cubics f.

Both of the (Newton-)Simpson's rule and the Simpson's 3/8-rule are accurate up to cubics, and there is something called Gregory's formula that is a generalisation of these results. The fact that the (Newton-)Simpson's rule is exact for cubic is perhaps slightly surprising, but it is a consequence of -h h x3 dx=0.


Kerwin