### Simpson's Rule

Approximate evaluation of a definite integral :
Simpson's Rule .

In many cases , a definite integral can not be obtained either because the quantity to be integrated can not be expressed as a mathematical function , or because the indefinite integral of the unction itself can not be determined directly . In such cases formula of approximation are used . One such important formula is Simpson's Rule . By this rule the definite integral of any function is expressed in terms of the individual values of any number of ordinates within the interval , by assuming that the function within each of the small ranges into which the whole interval may be divided can be represented to a sufficient degree of approximation by a parabolic function .

In numerical analysis, Simpson's rule is a method for numerical integration, the numerical approximation of definite integrals. Specifically, it is the following approximation:
$\int_{a}^{b} f(x) \, dx \approx \frac{b-a}{6}\left[f(a) + 4f\left(\frac{a+b}{2}\right)+f(b)\right].$
Simpson's rule also corresponds to the three-point Newton-Cotes quadrature rule.

Suppose that the interval $[a, b]$ is split up in $n$ subintervals, with $n$ an even number. Then, the composite Simpson's rule is given by
$\int_a^b f(x) \, dx\approx \frac{h}{3}\bigg[f(x_0)+2\sum_{j=1}^{n/2-1}f(x_{2j})+ 4\sum_{j=1}^{n/2}f(x_{2j-1})+f(x_n) \bigg],$
where $x_j=a+jh$ for $j=0, 1, ..., n-1, n$ with $h=(b-a)/n$; in particular, $x_0=a$ and $x_n=b$. The above formula can also be written as
$\int_a^b f(x) \, dx\approx\frac{h}{3}\bigg[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots+4f(x_{n-1})].$

The error committed by the composite Simpson's rule is bounded (in absolute value) by
$\frac{h^4}{180}(b-a) \max_{\xi\in[a,b]} |f^{(4)}(\xi)|,$
where $h$ is the "step length", given by $h=(b-a)/n.$

In other words this Simpson's Rule can be written as  :

h/3 [sum of the extreme ordinates  +  2.sum of the remaining odd ordinates   +  4.sum of the even ordinates]