# Numerical integration: simpsons rule error analysis.

## Recommended Posts

I'm trying to numerically integrate the function $f(x) = |x| + |x|^3, x\in[-1,1]$ using Simpsons rule and analyse the error. I've been trying to analyse the rate of convergence of the error but can't seem to get anywhere. Experimentally I've got that it's about $O(J^-2)$ (I think) but I can't show it mathematically.

I tried using the approach of splitting up the function into subintervals, then using the formula $|E_2,J| = \frac{-1}{2880} (b-a)h^4 |f^{(4)} (x)|$ but this fails as $|f^{(4)}(x)|\equiv 0, \forall x\in \Re^+$

Any hints?

##### Share on other sites

The only subinterval that contributes to the error is the one where you pass x=0.

##### Share on other sites

but the derivative at $x=0$ is undefined?

##### Share on other sites

Sure. I am not exactly sure what you want to do and why? But for a start, explicitly calculating the correct integral in the interval containing x=0 and the value that the numerical integration would give is easy.

##### Share on other sites

Why not break up the integral into two parts? The integral from -1 to 0 of -x-x^3, and the integral from 0 to 1 of x+x^3, and the benefit is that both of those function do have a derivative at x=0.

## Create an account

Register a new account