# Error Expectations for Composite Simpson's Rule

I have written a program that implements the composite Simpson's rule for integrating functions over the interval $[0,1]$. In checking the program for correctness, I test the routine on the integral $\int_{0}^1 x^5dx$ and I obtain the following results:

$$\begin{array}{c|lcr} m & \text{Approximation} & \text{Error} \\ \hline 8 & 0.24169 & 0.04169 \\ 16 & 0.22083 & 0.02083 & \\ 32 & 0.21041 & 0.01041 & \\ 64 & 0.20520 & 0.00520 \end{array}$$

What is the factor by which the errors should decrease as the number of panels, M, is doubled?

On the basis of the computational results listed above, can I conclude that my program is working correctly?

I know that composite Simpson's rule has an order of accuracy of 4. Basically, I was wondering if this means that the error should decrease by a factor of $\frac{1}{4}$, whereas I can see that it is decreasing by a factor of $\frac{1}{2}$.

In other words, I was hoping somebody could clarify the relationship between the order of accuracy and the actual change in the error that you would expect to see from one iteration to the next.

Thank you very much for your help.

$$\int_0^1 x^5 dx = \frac{x^6}{6} \Bigg|_0^1 = \frac{1}{6},$$
When people say composite Simpon's has fourth order convergence, they mean that if you double the number of (evenly spaced) intervals, so that each interval is $(1/2)$ the size, then the resulting error should be around $(1/2)^4 = 1/16$ as bad.
In particular, the general bound for the error of the composite Simpson's rule for a function $f$ over an interval $[a,b]$ is $$\frac{b-a}{180} h^4\max_{[a,b]} \lvert f^{(4)}(x)\rvert,$$ where $h$ is the width of the subintervals you've split the interval into. For your application, the thing you're changing is $h$: using twice the intervals amounts to changing $h$ by a factor of $1/2$.
• @Hawleyluyah yes, you would expect each subsequent error to be around $1/16$ the size of the previous error. – davidlowryduda Mar 19 '18 at 0:25