Elements of Numerical Integration (part I)
The Newton-Cotes formulas (open and closed) that are derived in this section allow us to approximate an integral by a weighted sum of discrete points on [a,b], the interval of interest:
In this section we focus on a single elemental ``unit'', using just two or three points; in the next section we'll paste the units together to get an accurate integral for an interval by pasting the elemental units together, hence using many points.
Our preliminary schemes are based on integrating interpolating polynomials.
We could start with interpolating constant functions (step-functions), and if we did we would begin by deriving the left- and right- rectangle rules. But we won't! We start with the linear interpolating polynomial, from which we derive the
Trapezoidal rule:
where . It is derived by integrating the linear Lagrange intepolating polynomial:
We can use the weighted mean-value theorem to write the second integral as
One interesting (but unsurprising) conclusion is that the Trapezoidal rule gets the integrals of linear functions right: hence its degree of accuracy (or precision) is given by 1.
Simpson's Rule:
can be derived similarly by integrating the Lagrange interpolating quadratic - but that means that we must use three points for the elemental unit of Simpson's rule. The formula works out to
This error term does not arise from the derivation using the Lagrange quadratic, however: that derivation gives an order error term, dependent on the third derivative. It can be obtained by integrating the Taylor polynomial of degree 4 expanded about (not even an interpolating polynomial!), and using the centered difference formula for the first derivative. This seems curious, but - whatever works!
Astonishingly, Simpson's rule gets cubics right! Now here's one of the interesting twists: we don't have to use the quadratic geometry to understand Simpson's rule: all cubic functions interpolating three points will have the same integral between and ! Is that obvious, in any way?
Example #18, p. 196 (linear algebra wins again!)