Topic 13.4: Newton-Cotes Rules (2024)

Topic 13.4: Newton-Cotes Rules

IntroductionNotesTheoryHOWTOExamples EngineeringErrorQuestionsMatlabMaple

The trapezoidal rule approximated an integral by integrating an interpolating linear polynomial. Given three points, why not find and integrate the interpolating quadratic polynomial? The Newton-Cotes rules discussed in this topic take this and higher order interpolating polynomials to approximate an integral.

For the trapezoidal rule, we approximated the integral on the given interval [a, b] by finding the polynomial interpolating the two end points and integrating that result. This is demonstrated in Figure 1.

Topic 13.4: Newton-Cotes Rules (7)

Figure 1. The trapezoidal rule.

The generalization to this is obvious: find an interpolating polynomial of higher degree and integrate the resulting polynomial. The processes of interpolating equally-spaced pointed are collectively known as Newton-Cotes rules, however, the lower degree polynomials have specific names:

Table 1. Interpolating polynomial degree and named integration rules.

PointsName
2Trapezoidal rule
3Simpson's rule
4Simpson's 3/8th rule
5Boole's rule

Given the interval [a, b], let h = (b - a)/2 and find the quadratic polynomial interpolating the three points (a, f(a)), (a + h, f(a + h)), and (b, f(b)) and integrate it. Figure 2 shows a function and the interpolating quadratic polynomial.

Topic 13.4: Newton-Cotes Rules (8)

Figure 2. Simpson's rule.

Given the interval [a, b], let h = (b - a)/3 and find the cubic polynomial interpolating the four points (a, f(a)), (a + h, f(a + h)), (a + 2h, f(a + 2h)), and (b, f(b)) and integrate it. Figure 3 shows a function and the interpolating cubic polynomial.

Topic 13.4: Newton-Cotes Rules (9)

Figure 3. Simpson's 3/8th rule.

Given the interval [a, b], let h = (b - a)/4 and find the quartic polynomial interpolating the five points (a, f(a)), (a + h, f(a + h)), (a + 2h, f(a + 2h)), (a + 3h, f(a + 3h)), and (b, f(b)) and integrate it. Figure 4 shows a function and the interpolating quartic polynomial.

Topic 13.4: Newton-Cotes Rules (10)

Figure 4. Boole's rule.

You will note that this is the area of a trapezoid of height b - a with sides of width f(a) and f(b).

You will note that we do not actually carry out the integrations. This is because the entire process is extremely tedious and simply an exercise in book keeping. To see the derivations of these formulae, you can view this (rather large) Maple Worksheet. As well as showing Simpson's, Simpson's 3/8th, and Boole's rules, it also shows an 11-point Newton-Cotes Rule which has negative coefficients in the numerator. Negative coefficients can result in subtractive cancellation, and therefore higher point Newton-Cotes polynomials are not often used in general.

Just like the trapezoidal rule can be repeated on a given interval, the Newton-Cotes rules can be repeated. This generalization is left to the reader.

Given a function of one variable, f(x), find the integral of the curve on the interval [a, b].

None.

We will use sampling and polynomial interpolation.

Simpson's Rule

Given f(x), a, and b, let h = (ba)/2 and calculate

Simpson's 3/8th Rule

Given f(x), a, and b, let h = (ba)/3 and calculate

Bools's Rule

Given f(x), a, and b, let h = (ba)/4 and calculate

Due to a typo in a common reference, Boole's rule is mistakenly referred to as Bode's rule.

Use Simpson's Rule to approximate the integral of f(x) = x3 on the interval [1, 2].

1/6 (f(1) + 4 f(1.5) + f(2))(2 - 1) = 3.75

The actual value of the integral is 3.75. This is exact because the error forSimpson's rule is O(h4) and we are integrating a cubic function.

Use Simpson's Rule to approximate the integral off(x)=e-0.1xon the interval [2,5].

1/6 (f(2) + 4 f(3.5) + f(5))(5 - 2) = 2.122006886

The actual value of the integral is 2.122000934 .

Suppose we can only evaluate a function at the integers (for example, when weare periodically sampling a signal).Use three applications of Simpson's Rule and two applications of Simpson's 3/8 Ruleto approximate the integral of response with a decaying transientf(x)=cos(x)+x ex on theinterval [0, 6].

Thus, we calculate:

1/6 (f(0) + 4 f(1) + 2 f(2) + 4 f(3) + 2 f(4) + 4 f(5) + f(6)) 2 = 0.6876458772

and

1/8 (f(0) + 3 f(1) + 3 f(2) + 2 f(3) + 3 f(4) + 3 f(5) + f(6)) 3 = 0.6723034556

The actual integral is -7 exp(-6) + sin(6) + 1 = 0.7032332366, and therefore,three applications of Simpson's rule with intervals of width 2 appears to bemore accurate than two applications of Simpson's 3/8th rule with intervals of width 3.

Given data which is being read sequentially for which there is no possibility of sub-sampling, it is best to approximate the integral of the data by taking each triplet of points and applying Simpson's rule.

By using sets of four points and Simpson's 3/8 rule, the error is, in fact, larger.

Consider sampling the damped oscillator f(x) = e-0.2x sin(x) at each of the integers from 0 to 6. Figure 1 shows the composite trapezoidal rule is used to approximate the integral using trapezoids on each of the 6 intervals. Figure 2 shows Simpson's rule applied using three quadratic polynomials on the intervals [0, 2], [2, 4], and [4, 6] which are integrated to approximate the integral. Figure 3 shows the two cubic polynomials used by Simpson's 3/8th rule on the intervals [0, 3] and [3, 6]. The actual area is approximately 0.699648, and thus we see that Simpson's rule does have the smallest error (the error being approximately 2.39 times smaller for Simpson's rule as compared to Simpson's 3/8th rule).

Topic 13.4: Newton-Cotes Rules (11)

Figure 1. Approximation using repeated applications of the trapezoidal rule.

Topic 13.4: Newton-Cotes Rules (12)

Figure 2. Approximation using repeated applications of Simpson's rule.

Topic 13.4: Newton-Cotes Rules (13)

Figure 3. Approximation using repeated applications of Simpson's 3/8th rule.

It is beyond the scope of this course, but the errors associated with each of the methods are given in terms of the width between the points (h) and the width of the intervals being integrated over (b - a).

The symbol ξ is in the interval [a, b].

Approximate the integral of f(x) = e-x on [0, 10] usingSimpson's Rule and Simpson's 3/8 Rule.

Answer: 1.711661979876841 and 1.388606601719423.

Approximate the integral of f(x) = x2 on the interval [0, 2]using Simpson's Rule and Simpson's 3/8 Rule.

Answer: 8/3 (or 2.666666666666667) in both cases.

Approximate the integral of f(x) = x4 on the interval [0, 2]using Simpson's Rule and Simpson's 3/8 Rule.

Answer: 20/3 = 6.666666666666667 and 176/27 = 6.518518518518516.

What is the estimated error for the approximation in Question 3what is the actual error? Is this exact, and why?

Answer: Because the 4th derivative is a constant, the errorsmay be found exactly: -4/15 and -16/135.

Finding an approximation of an integral using Simpson's rule andSimpson's 3/8th ruleof a function f(x) = cos(x) on the interval [0, 1.5]:

>> (cos(0) + 4*cos(0.75) + cos(1.5))/6 * 1.5ans = 0.999373169290747>> (cos(0) + 3*cos(0.5) + 3*cos(1.0) + cos(1.5))/8 * 1.5ans = 0.998323463426858

The correct answer is sin(1.5) ≈ 0.997494986604054 .

The following commands in Maple:

with( Student[Calculus1] ):ApproximateInt( cos(x), x = 0.0..1.5, method = trapezoid, output = plot, partition = 1 );

produces the plot shown in Figure 1.

Topic 13.4: Newton-Cotes Rules (14)

Figure 1. The trapezoidal rule applied to integrating cos(x) on [0, 1.5].

For more help on approximating integrals or on the Student[Calculus1] package, enter:

?ApproximateInt?Student,Calculus1

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.

Topic 13.4: Newton-Cotes Rules (2024)
Top Articles
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 6261

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.