structural:expansion, information:highlighting
Quadrature rules based on interpolating functions

A large class of quadrature rules can be derived by constructing interpolating functions that are easy to integrate. Typically these interpolating functions are polynomials. In practice, since polynomials of very high degree tend to oscillate wildly, only polynomials of low degree are used, typically linear and quadratic.

The interpolating function may be a straight line (an affine function, i.e. a polynomial of degree 1)passing through the points (a, f (a)) {\displaystyle \left(a,f(a)\right)} and (b, f (b)) {\displaystyle \left(b,f(b)\right)}.This is called the trapezoidal rule

For either one of these rules, we can make a more accurate approximation by breaking up the interval {\displaystyle } into some number n {\displaystyle n} of subintervals, computing an approximation for each subinterval, then adding up all the results. This is called a composite rule, extended rule, or iterated rule. For example, the composite trapezoidal rule can be stated as

where the subintervals have the form ⊂, {\displaystyle \subset,} with h = b − a n {\textstyle h={\frac {b-a}{n}}} and k = 0, …, n − 1. {\displaystyle k=0,\ldots,n-1.} Here we used subintervals of the same length h {\displaystyle h} but one could also use intervals of varying length (h k) k {\displaystyle \left(h_{k}\right)_{k}}.

Interpolation with polynomials evaluated at equally spaced points in {\displaystyle } yields the Newton–Cotes formulas, of which the rectangle rule and the trapezoidal rule are examples. Simpson's rule, which is based on a polynomial of order 2, is also a Newton–Cotes formula.

Quadrature rules with equally spaced points have the very convenient property of nesting. The corresponding rule with each interval subdivided includes all the current points, so those integrand values can be re-used.

If we allow the intervals between interpolation points to vary, we find another group of quadrature formulas, such as the Gaussian quadrature formulas. A Gaussian quadrature rule is typically more accurate than a Newton–Cotes rule that uses the same number of function evaluations, if the integrand is smooth (i.e., if it is sufficiently differentiable). Other quadrature methods with varying intervals include Clenshaw–Curtis quadrature (also called Fejér quadrature) methods, which do nest.

Gaussian quadrature rules do not nest, but the related Gauss–Kronrod quadrature formulas do.