Error of Analysis of Newton-Cotes formulas: Difference between revisions

From testwiki
Jump to navigation Jump to search
imported>MathXplore
 
(No difference)

Latest revision as of 11:28, 17 December 2022

Error Analysis of Newton-Cotes formulas

The Newton-Cotes formulas are a group of formulas for evaluating numeric integration at equally spaced points.

The Methods[1]

Let xi, i=0,,n, be n+1 equally spaced points, and fi be the corresponding values. Let h be the space h=xi+1xi, and let s be the interpolation variable s=xx0h. Thus to interpolate at x,

xx0=sh,xx1=x(x0+h)=(s1)h,xxn=(sn)h.

A polynomial Pn(x) of degree n can be derived to pass through these points and approximate the function f(x). Using divided differences and Newton polynomial, Pn(x) can be obtained as

Pn(x)=[f0]+[f0,f1](xx0)++[f0,,fn](xx0)(x1)(xxn1)=[f0]+[f0,f1]sh++[f0,,fn]s(s1)(sn+1)hn.

From the general form of polynomial interpolation error, the error of using Pn(x) to interpolate f(x) can be obtained as

Einterpolate(x)=f(x)Pn(x)=1(n+1)!(xx0)(xx1)(xxn)f(n+1)(ξ)=1(n+1)!s(s1)(s2)(sn)hn+1f(n+1)(ξ)

where x0ξxn.

Since dx=d(x0+sh)=hds, the error term of numerical integration is Template:NumBlk

Error terms for different rules

The Trapezoid Rule

Let's consider the trapezoid rule in a single interval. In each interval, the integration uses two end points. Thus n+1=2. Then n=1. Applying (Template:EquationNote), we get

Eintegrate=h01s(s1)2h2f(ξ)ds=112h3f(ξ)=O(h3)

where x0ξx1. Thus the local error is O(h3). Consider the composite trapezoid rule. Given that n=xnx0h, the global error is Template:NumBlk where xiξixi+1, x0ξ¯xn.

To justify (Template:EquationNote), we can need the theorem below[2] in page 345:

If g(x) is continuous and the ci0, then for some value θ in the interval of all the arguments 
g(θ)ci=i=1Ncig(θi).

The Simpson's 1/3 Rule

Consider Simpson's 1/3 rule. In this case, three equally spaced points are used for integration. Thus n+1=3. Applying (Template:EquationNote), we get

Eintegrate=h02s(s1)(s2)6h3f(ξ)ds=0

where x0ξx2.

This doesn't mean that the error is zero. It simply means that the cubic term is identically zero. The error term can be obtained from the next term in the Newton polynomial, obtaining

Eintegrate=h02s(s1)(s2)(s3)24h4f(4)(ξ)ds=190h5f(4)(ξ)=O(h5).

Thus the local error is O(h5) and the global error is O(h4).

The Simpson's 3/8 Rule

Consider Simpson's 3/8 rule. In this case, n+1=4 since four equally spaced points are used. Applying (Template:EquationNote), we get

Eintegrate=h03s(s1)(s2)(s3)24h4f(4)(ξ)ds=380h5f(4)(ξ)=O(h5)

where x0ξx3.

Both the Simpon's 1/3 rule and the 3/8 rule have error terms of order h5. With smaller coefficient, the 1/3 rule seems more accurate. Then why do we need the 3/8 rule? The 3/8 rule is useful when the total number of increments n is odd. Three increments can be used with the 3/8 rule, and then the rest even number of increments can be used with 1/3 rule.

A Numerical Example

Given the set of data points, solve the numerical integration I=3.13.9f(x)dx

x f(x)=1x
3.1 -0.32258065
3.5 -0.28571429
3.9 -0.25641026

Solution

Use the trapezoid rule. First try h=0.8. That is, use only the two end points. We can get

I(h=0.8)=0.82(0.322580650.25641026)=0.23159636

Compared with the exact solution I=0.22957444 we have

Eintegrate=0.00202192.

Using all three points with h=0.4 we can get

I(h=0.4)=0.42(0.322580652×0.285714290.25641026)=0.23008389

and so

Eintegrate=0.00050945.

Thus the error ratio is Eintegrate(h=0.8)Eintegrate(h=0.4)=3.97. This is close to what we can get by inspecting

Eintegrate(h)Eintegrate(h/2)=O(h2)O(h/2)2=22=4.

Exercises

Exercise 1[3]

Using the data given below, find the maximum error incurred in using Newton's forward interpolation formula to approximate x=0.14.

x ex
0.1 1.10517
0.2 1.22140
0.3 1.34986
0.4 1.49182
0.5 1.64872

Exercise 2

When using Simpson's 1/3, what is the error ratio supposed to be?

References

Template:Reflist