Jim Lambers MAT 460/560 Fall Semester 2009-10 Lecture 27 Notes These notes correspond to Section 4.4 in the text. Numerical Quadrature, contβd The error in any interpolatory quadrature rule deο¬ned on an interval [π, π], such as a Newton-Cotes rule or a Clenshaw-Curtis rule can be obtained by computing the integral from π to π of the error in the polynomial interpolant on which the rule is based. For the Trapezoidal Rule, which is obtained by integrating a linear polynomial that interpolates the integrand π (π₯) at π₯ = π and π₯ = π, this approach to error analysis yields β« π π πβπ π (π₯) ππ₯ β [π (π) + π (π)] = 2 β« π π π β²β² (π(π₯)) (π₯ β π)(π₯ β π) ππ₯, 2 where π(π₯) lies in [π, π] for π β€ π₯ β€ π. The function (π₯ β π)(π₯ β π) does not change sign on [π, π], which allows us to apply the Weighted Mean Value Theorem for Integrals and obtain a more useful expression for the error, β« π β« πβπ π β²β² (π) π π β²β² (π) π (π₯) ππ₯ β [π (π) + π (π)] = (π₯ β π)(π₯ β π) ππ₯ = β (π β π)3 , 2 2 12 π π where π β€ π β€ π. Because the error depends on the second derivative, it follows that the Trapezoidal Rule is exact for any linear function. A similar approach can be used to obtain expressions for the error in the Midpoint Rule and Simpsonβs Rule, although the process is somewhat more complicated due to the fact that the functions (π₯ β π), for the Midpoint Rule, and (π₯ β π)(π₯ β π)(π₯ β π), for Simpsonβs Rule, where in both cases π = (π + π)/2, change sign on [π, π], thus making the Weighted Mean Value Theorem for Integrals more diο¬cult to apply. The result of the analysis is that for the Midpoint RUle, ( ) β« π π+π π β²β² (π) π (π₯) ππ₯ β (π β π)π = (π β π)3 , 2 24 π and for Simpsonβs Rule, β« π π [ ( ) ] ( ) πβπ π+π π (4) (π) π β π 5 π (π₯) ππ₯ β π (π) + 4π + π (π) = β , 6 2 90 2 where, in both cases, π is some point in [π, π]. 1 It follows that the Midpoint Rule is exact for any linear function, just like the Trapezoidal Rule, even though it uses one less interpolation point, because of the cancellation that results from choosing the midpoint of [π, π] as the interpolation point. Similar cancellation causes Simpsonβs Rule to be exact for polynomials of degree three or less, even though it is obtained by integrating a quadratic interpolant over [π, π]. Composite Quadrature When using a quadrature rule to approximate πΌ(π ) on some interval [π, π], the error is proportional to βπ , where β = π β π and π is some positive integer. Therefore, if the interval [π, π] is large, it is advisable to divide [π, π] into smaller intervals, use a quadrature rule to compute the integral of π on each subinterval, and add the results to approximate πΌ(π ). Such a scheme is called a composite quadrature rule. It can be shown that the approximate integral obtained using a composite rule that divides [π, π] into π subintervals will converge to πΌ(π ) as π β β, provided that the maximum width of the π subintervals approaches zero, and the quadrature rule used on each subinterval has a degree of at least zero. It should be noted that using closed quadrature rules on each subinterval improves eο¬ciency, because the nodes on the endpoints of each subinterval, except for π and π, are shared by two quadrature rules. As a result, fewer function evaluations are necessary, compared to a composite rule that uses open rules with the same number of nodes. We will now state some of the most well-known composite quadrature rules. In the following discussion, we assume that the interval [π, π] is divided into π subintervals of equal width β = (π β π)/π, and that these subintervals have endpoints [π₯πβ1 , π₯π ], where π₯π = π + πβ, for π = 0, 1, 2, . . . , π. Given such a partition of [π, π], we can compute πΌ(π ) using the Composite Midpoint Rule β« π π (π₯) ππ₯ β 2β[π (π₯1 ) + π (π₯3 ) + β β β + π (π₯πβ1 )], π is even, π the Composite Trapezoidal Rule β« π π (π₯) ππ₯ β π β [π (π₯0 ) + 2π (π₯1 ) + 2π (π₯2 ) + β β β + 2π (π₯πβ1 ) + π (π₯π )], 2 or the Composite Simpsonβs Rule β« π π (π₯) ππ₯ β π β [π (π₯0 ) + 4π (π₯1 ) + 2π (π₯2 ) + 4π (π₯3 ) + β β β + 2π (π₯πβ2 ) + 4π (π₯πβ1 ) + π (π₯π )], 3 for which π is required to be even, as in the Composite Midpoint Rule. 2 To obtain the error in each of these composite rules, we can sum the errors in the corresponding basic rules over the π subintervals. For the Composite Trapezoidal Rule, this yields [ ] β« π πβ1 β β π (π₯) ππ₯ β π (π₯0 ) + 2 πΈπ‘πππ = π (π₯π ) + π (π₯π ) 2 π π=1 = β = β π β π β²β² (ππ ) 12 π=1 π β3 β 12 (π₯π β π₯πβ1 )3 π β²β² (ππ ) π=1 β3 = β ππ β²β² (π) 12 π β²β² (π) (π β π)β2 , = β 12 β where, for π = 1, . . . , π, ππ belongs to [π₯πβ1 , π₯π ], and π β€ π β€ π. The replacement of βπ=1 π β²β² (ππ ) by ππ β²β² (π) is justiο¬ed by the Intermediate Value Theorem, provided that π β²β² (π₯) is continuous on [π, π]. We see that the Composite Trapezoidal Rule is second-order accurate. Furthermore, its degree of accuracy, which is the highest degree of polynomial that is guaranteed to be integrated exactly, is the same as for the basic Trapezoidal Rule, which is one. Similarly, for the Composite Midpoint Rule, we have β« π π (π₯) ππ₯ β 2β πΈπππ = π π/2 β π (π₯2πβ1 ) = π=1 π/2 β²β² β π (ππ ) π=1 24 (2β)3 = π β²β² (π) (π β π)β2 . 6 Although it appears that the Composite Midpoint Rule is less accurate than the Composite Trapezoidal Rule, it should be noted that it uses about half as many function evaluations. In other words, the Basic Midpoint Rule is applied π/2 times, each on a subinterval of width 2β. Rewriting the Composite Midpoint Rule in such a way that it uses π function evaluations, each on a subinterval of width β, we obtain β« π π (π₯) ππ₯ = β π ( ) π β β π β²β² (π) π π₯πβ1 + + (π β π)β2 , 2 24 π=1 which reveals that the Composite Midpoint Rule is generally more accurate. Finally, for the Composite Simpsonβs Rule, we have πΈπ πππ = β π/2 (4) β π (ππ ) π=1 90 β5 = β 3 π (4) (π) (π β π)β4 , 180 because the Basic Simpson Rule is applied π/2 times, each on a subinterval of width 2β. We conclude that the Simpsonβs Rule is fourth-order accurate. Example We wish to approximate β« 1 ππ₯ ππ₯ 0 using composite quadrature, to 3 decimal places. That is, the error must be less than 10β3 . This requires choosing the number of subintervals, π, suο¬ciently large so that an upper bound on the error is less than 10β3 . For the Composite Trapezoidal Rule, the error is πΈπ‘πππ = β π β²β² (π) ππ (π β π)β2 = β , 12 12π2 since π (π₯) = ππ₯ , π = 0 and π = 1, which yields β = (π β π)/π = 1/π. Since 0 β€ π β€ 1, and ππ₯ is increasing, the factor ππ is bounded above by π1 = π. It follows that β£πΈπ‘πππ β£ < 10β3 if π < 10β3 12π2 1000π < π2 12 β β π > 15.0507. Therefore, the error will be suο¬ciently small provided that we choose π β₯ 16. On the other hand, if we use the Composite Simpsonβs Rule, the error is πΈπ πππ = β π (4) (π) ππ (π β π)β4 = β 180 180π4 for some π in [0, 1], which is less than 10β3 in absolute value if ( π> 1000π 180 )1/4 β 1.9713, so π = 2 is suο¬cient. That is, we can approximate the integral to 3 decimal places by setting β = (π β π)/π = (1 β 0)/2 = 1/2 and computing β« 0 1 ππ₯ ππ₯ β β π₯0 1/2 0 [π + 4ππ₯1 + ππ₯2 ] = [π + 4π1/2 + π1 ] β 1.71886, 3 3 whereas the exact value is approximately 1.71828. β‘ 4
© Copyright 2025 Paperzz