Module for Newton-Cotes Integration


Introduction to Quadrature

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  [Graphics:Images/NewtonCotesMod_gr_1.gif].   A formula of the form


with the property that


is called a numerical integration or quadrature formula.  The term  E[f]  is called the truncation error for integration.  The values [Graphics:Images/NewtonCotesMod_gr_5.gif] are called the quadrature nodes and [Graphics:Images/NewtonCotesMod_gr_6.gif] are called the weights.


    Depending on the application, the nodes  [Graphics:Images/NewtonCotesMod_gr_7.gif]  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  [Graphics:Images/NewtonCotesMod_gr_8.gif]  for all polynomials  [Graphics:Images/NewtonCotesMod_gr_9.gif] of degree  [Graphics:Images/NewtonCotesMod_gr_10.gif],  but for which  [Graphics:Images/NewtonCotesMod_gr_11.gif]  for some polynomial  [Graphics:Images/NewtonCotesMod_gr_12.gif]  of degree  n+1.  That is

[Graphics:Images/NewtonCotesMod_gr_13.gif]   when degree  [Graphics:Images/NewtonCotesMod_gr_14.gif],  
[Graphics:Images/NewtonCotesMod_gr_15.gif]   when degree  [Graphics:Images/NewtonCotesMod_gr_16.gif].  


    The form of  [Graphics:Images/NewtonCotesMod_gr_17.gif] can be anticipated by studying what happens when  f(x)  is a polynomial.  Consider the arbitrary polynomial

of degree
i.  If  [Graphics:Images/NewtonCotesMod_gr_19.gif],  then  [Graphics:Images/NewtonCotesMod_gr_20.gif]  for all  x,  and  [Graphics:Images/NewtonCotesMod_gr_21.gif]  for all  x.  Thus it is not surprising that the general form for the truncation error term is


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  [Graphics:Images/NewtonCotesMod_gr_23.gif]  of degree  [Graphics:Images/NewtonCotesMod_gr_24.gif],  passing through the  m+1  equally spaced points  [Graphics:Images/NewtonCotesMod_gr_25.gif].   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  [Graphics:Images/NewtonCotesMod_gr_26.gif],  the resulting formula is called a Newton-Cotes quadrature formula.  When the sample points  [Graphics:Images/NewtonCotesMod_gr_27.gif]  and  [Graphics:Images/NewtonCotesMod_gr_28.gif]  are used, it is called a closed Newton-Cotes formula.  The next result gives the formulas when approximating polynomials of degree  [Graphics:Images/NewtonCotesMod_gr_29.gif]  are used.


Theorem (Closed Newton-Cotes Quadrature Formula)  Assume that  [Graphics:Images/NewtonCotesMod_gr_30.gif]  are equally spaced nodes and  [Graphics:Images/NewtonCotesMod_gr_31.gif].  The first four closed Newton-Cotes quadrature formulas:

Trapezoidal Rule    [Graphics:Images/NewtonCotesMod_gr_32.gif]  

Simpson’s Rule    [Graphics:Images/NewtonCotesMod_gr_33.gif]  

Simpson 3/8 Rule    [Graphics:Images/NewtonCotesMod_gr_34.gif]  

Boole’s Rule    [Graphics:Images/NewtonCotesMod_gr_35.gif]  

Proof  Newton-Cotes Quadrature  Newton-CotesQuadrature  


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  [Graphics:Images/NewtonCotesMod_gr_36.gif], then


(9) Simpson’s rule has degree of precision  n=3.  If  [Graphics:Images/NewtonCotesMod_gr_38.gif], then


(10) Simpson’s [Graphics:Images/NewtonCotesMod_gr_40.gif]rule has degree of precision  n=3.  If  [Graphics:Images/NewtonCotesMod_gr_41.gif], then


(11) Boole’s rule has degree of precision  n=5.  If  [Graphics:Images/NewtonCotesMod_gr_43.gif], then


Proof  Trapezoidal Rule  Trapezoidal Rule  

Proof  Simpson's Rule  Simpson's Rule  

Proof  Simpson's 3/8 Rule  Simpson's 3/8 Rule

Proof  Boole's Rule  Boole's Rule  



Example 1.  Consider the function  [Graphics:Images/NewtonCotesMod_gr_45.gif],  the equally spaced quadrature nodes  [Graphics:Images/NewtonCotesMod_gr_46.gif], [Graphics:Images/NewtonCotesMod_gr_47.gif],  [Graphics:Images/NewtonCotesMod_gr_48.gif],  [Graphics:Images/NewtonCotesMod_gr_49.gif], and [Graphics:Images/NewtonCotesMod_gr_50.gif],  and the corresponding function values  [Graphics:Images/NewtonCotesMod_gr_51.gif],  [Graphics:Images/NewtonCotesMod_gr_52.gif],  [Graphics:Images/NewtonCotesMod_gr_53.gif],  [Graphics:Images/NewtonCotesMod_gr_54.gif],  and  [Graphics:Images/NewtonCotesMod_gr_55.gif].  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  [Graphics:Images/NewtonCotesMod_gr_80.gif]  are held fixed, the step size must be adjusted for each rule.  The step sizes are  [Graphics:Images/NewtonCotesMod_gr_81.gif],  [Graphics:Images/NewtonCotesMod_gr_82.gif],  [Graphics:Images/NewtonCotesMod_gr_83.gif],  and  [Graphics:Images/NewtonCotesMod_gr_84.gif]  for the trapezoidal rule, Simpson’s rule, Simpson’s [Graphics:Images/NewtonCotesMod_gr_85.gif]rule, and Boole’s rule, respectively.  The next example illustrates this point.



Example 2.  Consider the integration of the function  [Graphics:Images/NewtonCotesMod_gr_86.gif]  over the fixed interval  [Graphics:Images/NewtonCotesMod_gr_87.gif].  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  
[Graphics:Images/NewtonCotesMod_gr_126.gif]  using exactly five function evaluations  [Graphics:Images/NewtonCotesMod_gr_127.gif]  for  [Graphics:Images/NewtonCotesMod_gr_128.gif]  for each method.  

When the trapezoidal rule is applied on the four subintervals  [Graphics:Images/NewtonCotesMod_gr_129.gif], [Graphics:Images/NewtonCotesMod_gr_130.gif], [Graphics:Images/NewtonCotesMod_gr_131.gif], and [Graphics:Images/NewtonCotesMod_gr_132.gif]  it is called a composite trapezoidal rule:

(12)        [Graphics:Images/NewtonCotesMod_gr_134.gif]  

When Simpson’s rule is applied on the two subintervals  [Graphics:Images/NewtonCotesMod_gr_135.gif]and [Graphics:Images/NewtonCotesMod_gr_136.gif] it is called a composite Simpson's  rule:

(13)        [Graphics:Images/NewtonCotesMod_gr_138.gif]  

The next example compares the values obtained with these formulas.



Example 3.  Consider the integration of the function  [Graphics:Images/NewtonCotesMod_gr_139.gif]  over  [Graphics:Images/NewtonCotesMod_gr_140.gif].  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  [Graphics:Images/NewtonCotesMod_gr_141.gif].   

        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  [Graphics:Images/NewtonCotesMod_gr_182.gif]  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  [Graphics:Images/NewtonCotesMod_gr_185.gif],  and  [Graphics:Images/NewtonCotesMod_gr_186.gif] is will be easy to solve for K.  



Example 4.  Show that the degree of precision of the Trapezoidal Rule is  [Graphics:Images/NewtonCotesMod_gr_187.gif].  
Solution 4.


Example 5.  Show that the degree of precision of  Simpson’s Rule is  [Graphics:Images/NewtonCotesMod_gr_194.gif].  
Solution 5.


Example 6.  Show that the degree of precision of  Simpson’s [Graphics:Images/NewtonCotesMod_gr_202.gif] Rule is  [Graphics:Images/NewtonCotesMod_gr_203.gif].  
Solution 6.


Example 7.  Show that the degree of precision of  Boole's Rule is  [Graphics:Images/NewtonCotesMod_gr_213.gif].  
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.  


Research Experience for Undergraduates

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.  


Download this Mathematica Notebook Newton-Cotes Integration




















(c) John H. Mathews 2004