INTRODUCTION Applied Numerical Methods with MATLAB fo

The second method is called Gauss quadrature. Recall that, in Chap. 19, values of f x for the Newton-Cotes formulas were determined at specified values of x. For exam- ple, if we used the trapezoidal rule to determine an integral, we were constrained to take the weighted average of f x at the ends of the interval. Gauss-quadrature formulas employ x values that are positioned between the integration limits in such a manner that a much more accurate integral estimate results. The third approach is called adaptive quadrature. This techniques applies composite Simpson’s 13 rule to subintervals of the integration range in a way that allows error esti- mates to be computed. These error estimates are then used to determine whether more refined estimates are required for a subinterval. In this way, more refined segmentation is only used where it is necessary. Two built-in MATLAB functions that use adaptive quad- rature are illustrated.

20.2 ROMBERG INTEGRATION

Romberg integration is one technique that is designed to attain efficient numerical integrals of functions. It is quite similar to the techniques discussed in Chap. 19 in the sense that it is based on successive application of the trapezoidal rule. However, through mathematical manipulations, superior results are attained for less effort.

20.2.1 Richardson Extrapolation

Techniques are available to improve the results of numerical integration on the basis of the integral estimates themselves. Generally called Richardson extrapolation, these methods use two estimates of an integral to compute a third, more accurate approximation. The estimate and the error associated with the composite trapezoidal rule can be rep- resented generally as I = I h + Eh where I = the exact value of the integral, I h = the approximation from an n-segment application of the trapezoidal rule with step size h = b − an, and Eh = the truncation error. If we make two separate estimates using step sizes of h 1 and h 2 and have exact val- ues for the error: I h 1 + Eh 1 = I h 2 + Eh 2 20.1 Now recall that the error of the composite trapezoidal rule can be represented approxi- mately by Eq. 19.21 [with n = b − ah]: E ∼ = − b − a 12 h 2 ¯ f ′′ 20.2 If it is assumed that ¯ f ′′ is constant regardless of step size, Eq. 20.2 can be used to deter- mine that the ratio of the two errors will be Eh 1 Eh 2 ∼ = h 2 1 h 2 2 20.3 This calculation has the important effect of removing the term ¯ f ′′ from the computation. In so doing, we have made it possible to utilize the information embodied by Eq. 20.2 without prior knowledge of the function’s second derivative. To do this, we rearrange Eq. 20.3 to give Eh 1 ∼ = Eh 2 h 1 h 2 2 which can be substituted into Eq. 20.1: I h 1 + Eh 2 h 1 h 2 2 = I h 2 + Eh 2 which can be solved for Eh 2 = I h 1 − I h 2 1 − h 1 h 2 2 Thus, we have developed an estimate of the truncation error in terms of the integral esti- mates and their step sizes. This estimate can then be substituted into I = I h 2 + Eh 2 to yield an improved estimate of the integral: I = I h 2 + 1 h 1 h 2 2 − 1 [I h 2 − I h 1 ] 20.4 It can be shown Ralston and Rabinowitz, 1978 that the error of this estimate is Oh 4 . Thus, we have combined two trapezoidal rule estimates of Oh 2 to yield a new es- timate of Oh 4 . For the special case where the interval is halved h 2 = h 1 2, this equa- tion becomes I = 4 3 I h 2 − 1 3 I h 1 20.5 EXAMPLE 20.1 Richardson Extrapolation Problem Statement. Use Richardson extrapolation to evaluate the integral of f x = 0.2 + 25x − 200x 2 + 675x 3 − 900x 4 + 400x 5 from a = 0 to b = 0.8. Solution. Single and composite applications of the trapezoidal rule can be used to evalu- ate the integral: Segments h Integral ε t 1 0.8 0.1728 89.5 2 0.4 1.0688 34.9 4 0.2 1.4848 9.5 Richardson extrapolation can be used to combine these results to obtain improved estimates of the integral. For example, the estimates for one and two segments can be combined 20.2 ROMBERG INTEGRATION 499