Module

for

Module for Newton-Cotes Integration

We now approach the subject of numerical integration. The goal is to approximate the definite integral of  f(x)  over the interval  [a,b]  by evaluating  f(x)  at a finite number
of sample points.

Definition (Quadrature Formula)  Suppose that  .   A formula of the form

(1)

with the property that

(2)

is called a numerical integration or quadrature formula.  The term  E[f]  is called the truncation error for integration.  The values are called the quadrature nodes and are called the weights.

Depending on the application, the nodes    are chosen in various ways.  For the Trapezoidal Rule, Simpson’s Rule, and Boole’s Rule, the nodes are chosen to be equally spaced.  For Gauss-Legendre quadrature, the nodes are chosen to be zeros of certain Legendre polynomials.  When the integration formula is used to develop a predictor formula for differential equations, all the nodes are chosen less than b.  For all applications, it is necessary to know something about the accuracy of the numerical solution.  This leads us to the next definition.

Definition (Degree of Precision)  The degree of precision of a quadrature formula is the positive integer  n  such that    for all polynomials   of degree  ,  but for which    for some polynomial    of degree  n+1.  That is

when degree  ,
and

when degree  .

The form of   can be anticipated by studying what happens when  f(x)  is a polynomial.  Consider the arbitrary polynomial

of degree
i.  If  ,  then    for all  x,  and    for all  x.  Thus it is not surprising that the general form for the truncation error term is

(3)
,

where  K  is a suitably chosen constant and  n  is the degree of precision.  The proof of this general result can be found in advanced books on numerical integration.  The derivation of quadrature formulas is sometimes based on polynomial interpolation.  Recall that there exists a unique polynomial    of degree  ,  passing through the  m+1  equally spaced points  .   When this polynomial is used to approximate  f(x)  over  [a,b],  and then the integral of  f(x) is approximated by the integral of  ,  the resulting formula is called a Newton-Cotes quadrature formula.  When the sample points    and    are used, it is called a closed Newton-Cotes formula.  The next result gives the formulas when approximating polynomials of degree    are used.

Theorem (Closed Newton-Cotes Quadrature Formula)  Assume that    are equally spaced nodes and  .  The first four closed Newton-Cotes quadrature formulas:

(4)
Trapezoidal Rule

(5)
Simpson’s Rule

(6)
Simpson 3/8 Rule

(7)
Boole’s Rule

Corollary (Newton-Cotes Precision)  Assume that  f(x)  is sufficiently differentiable; then  E[f]  for Newton-Cotes quadrature involves an appropriate higher derivative.

(8) The trapezoidal rule has degree of precision  n=1.  If  , then

.

(9) Simpson’s rule has degree of precision  n=3.  If  , then

.

(10) Simpson’s rule has degree of precision  n=3.  If  , then

.

(11) Boole’s rule has degree of precision  n=5.  If  , then

.

Example 1.  Consider the function  ,  the equally spaced quadrature nodes  , ,  ,  , and ,  and the corresponding function values  ,  ,  ,  ,  and  .  Apply the various quadrature formulas (4) through (7).

Trapezoidal Rule                                                Simpson’s Rule

Simpson’s 3/8 Rule                                                Boole’s Rule
Solution 1.

In Example 1 we applied the quadrature rules with  h = 0.5.  If the endpoints of the interval    are held fixed, the step size must be adjusted for each rule.  The step sizes are  ,  ,  ,  and    for the trapezoidal rule, Simpson’s rule, Simpson’s rule, and Boole’s rule, respectively.  The next example illustrates this point.

Example 2.  Consider the integration of the function    over the fixed interval  .  Apply the various formulas (4) through (7).

Trapezoidal Rule                                                Simpson’s Rule

Simpson’s 3/8 Rule                                                Boole’s Rule
Solution 2.

To make a fair comparison of quadrature methods, we must use the same number of function evaluations in each method.  Our final example is concerned with comparing
integration over a fixed interval
using exactly five function evaluations    for    for each method.

When the trapezoidal rule is applied on the four subintervals  , , , and   it is called a composite trapezoidal rule:

(12)

When Simpson’s rule is applied on the two subintervals  and it is called a composite Simpson's  rule:

(13)

The next example compares the values obtained with these formulas.

Example 3.  Consider the integration of the function    over  .  Use exactly five function evaluations and compare the results from the composite trapezoidal rule, composite Simpson rule, and Boole’s rule.  Use the uniform step size  .

Composite Trapezoidal Rule                                            Composite Simpson’s Rule

Boole’s Rule
Solution 3.

Degree of Precision of the Quadrature Rules

We can use formula (3) to determine the degree of precision the trapezoidal rule, composite Simpson rule, and Boole’s rule.  Assume that

,

where  K  is a suitably chosen constant and  n  is the degree of precision.  It will suffice to use    and find the largest power  n  for which the quadrature formula is exact, i. e.

.

The constant
K  is determined by solving

.

Since this involves  ,  and   is will be easy to solve for K.

Example 4.  Show that the degree of precision of the Trapezoidal Rule is  .
Solution 4.

Example 5.  Show that the degree of precision of  Simpson’s Rule is  .
Solution 5.

Example 6.  Show that the degree of precision of  Simpson’s Rule is  .
Solution 6.

Example 7.  Show that the degree of precision of  Boole's Rule is  .
Solution 7.

Various Scenarios and Animations

Animations (Trapezoidal Rule  Trapezoidal Rule).

Animations (Simpson's Rule  Simpson's Rule).

Animations (Simpson's 3/8 Rule  Simpson's 3/8 Rule).  Internet hyperlinks to animations.

Animations (Boole's Rule  Boole's Rule).  Internet hyperlinks to animations.

Old Lab Project (Simpson's Rule  Simpson's Rule).  Internet hyperlinks to an old lab project.

Newton-Cotes Numerical Integration  Newton-Cotes Numerical Integration  Internet hyperlinks to web sites and a bibliography of articles.

Trapezoidal Rule for Numerical Integration  Trapezoidal Rule for Numerical Integration  Internet hyperlinks to web sites and a bibliography of articles.

Simpson's Rule for Numerical Integration  Simpson's Rule for Numerical Integration  Internet hyperlinks to web sites and a bibliography of articles.

(c) John H. Mathews 2004