Simpson's 3/8 rule formula

1.8k Views Asked by At

I am trying to work with Simpson's 3/8 rule, but I wanted to double check my formula:

$$I(f) = \int_a^bf(x) dx \ \approxeq \ \frac{3h}{8}\left(f(a) \ + \ 3f\left(\frac{a+b}{3}\right) \ + \ 3f\left(2\left(\frac{a+b}{3}\right)\right) \ + f(b)\right)$$

However, wikipedia has the formula as:

$$I(f) = \int_a^bf(x) dx \ \approxeq \ \frac{3h}{8}\left(f(a) \ + \ 3f\left(\frac{2a+b}{3}\right) \ + \ 3f\left(\frac{a+2b}{3}\right) \ + f(b)\right)$$

I arrived at my formula by thinking I was calculating $f(x)$ at evenly spaced values of x, but now I'm not so sure.

2

There are 2 best solutions below

1
On

Note that the wiki has evenly spaced values, for any consecutive pair in their formula the gap is $\frac{b-a}{3}$. Your steps do not obey that, the gaps I think are $\frac{b-2a}{3}$, $\frac{a+b}{3}$, and $\frac{2a+b}{3}$.

0
On

The Wikipedia formula is right. Note that with your formula, if $a,b$ are reasonably large, your interior points fall outside the range of interest. If $a=9,b=12$, your second point is $f(7)$ and your third is $f(14)$, while Wikipedia's are $f(10)$ and $f(11)$ as desired.