Proof
We split the interval into
subintervals and apply Simpson's Rule on each pair of consecutive intervals:
> int1:=(h/3)*(f(a)+4*f(a+h)+f(a+2*h))+err(xi[1]);
> int2:=(h/3)*(f(a+2*h)+4*f(a+3*h)+f(a+4*h))+err(xi[2]);
> int3:=(h/3)*(f(a+4*h)+4*f(a+5*h)+f(a+6*h))+err(xi[3]);
and so on until
> intm:=(h/3)*(f(a+(n-2)*h)+4*f(a+(n-1)*h)+f(b))+err(xi[m]);
where each of the error term is of the form
> err(xi[i])=-h^5*(D@@4)(f)(xi[i])/90;
Adding all the integrals together yields:
> inttot:=int1+int2+int3+intm;
which can be rewritten as
>
This yields the composite formula. The error term can be simplified by considering that for all values of
,
,
with
the minimal value of the fourth derivative over the interval
. Then
, or
.
Similarly, for the maximum over
:
,
, or
.
Using the Mean Value Theorem, we can then say that there must exist a value
in the interval
so that
The error term then becomes:
or
which, with
can finally be written as
>