from pylab import *
from scipy.integrate import newton_cotes
The Trapezoidal and Simpson rules were based on integrating a polynomial approximation. Such methods are called Newton-Cotes integration methods. If we choose distinct points in and approximate the function by interpolation
the integral can be approximated by
where the weights are given by
As an example for and using uniformly spaced points, we interpolate by a cubic polynomial and the integral is approximated as
which is known as Boole’s rule. For general , we can state the following error estimates.
The accuracy of a quadrature formula can be characterized by the largest set of polynomials which it can integrate exactly.
We now look at necessary and sufficient conditions for a numerical integration formula to converge.
Note that for an integration formula
- Atkinson, K. E. (2004). An Introduction to Numerical Analysis (2nd ed.). Wiley.