06.09.2021 Views

Calculus- Early Transcendentals, 2021a

Calculus- Early Transcendentals, 2021a

Calculus- Early Transcendentals, 2021a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.6. Numerical Integration 287<br />

a sequence of parabolas, each covering two of the subintervals. For this to be practical, we would like a<br />

simple formula for the area under one parabola, namely, the parabola through (x i , f (x i )), (x i+1 , f (x i+1 )),<br />

and (x i+2 , f (x i+2 )). That is, we should attempt to write down the parabola y = ax 2 + bx + c through these<br />

points and then integrate it, and hope that the result is fairly simple. Although the algebra involved is<br />

messy, this turns out to be possible. The algebra is well within the capability of a good computer algebra<br />

system like Sage, so we will present the result without all of the algebra.<br />

To find the parabola, we solve these three equations for a, b, andc:<br />

f (x i ) = a(x i+1 − Δx) 2 + b(x i+1 − Δx)+c<br />

f (x i+1 ) = a(x i+1 ) 2 + b(x i+1 )+c<br />

f (x i+2 ) = a(x i+1 + Δx) 2 + b(x i+1 + Δx)+c<br />

Not surprisingly, the solutions turn out to be quite messy. Nevertheless, Sage can easily compute and<br />

simplify the integral to get<br />

∫ xi+1 +Δx<br />

ax 2 + bx + cdx = Δx<br />

x i+1 −Δx<br />

3 ( f (x i)+4 f (x i+1 )+ f (x i+2 )).<br />

Now the sum of the areas under all parabolas is<br />

Δx<br />

3 ( f (x 0)+4 f (x 1 )+ f (x 2 )+ f (x 2 )+4 f (x 3 )+ f (x 4 )+···+ f (x n−2 )+4 f (x n−1 )+ f (x n )) =<br />

Δx<br />

3 ( f (x 0)+4 f (x 1 )+2 f (x 2 )+4 f (x 3 )+2 f (x 4 )+···+ 2 f (x n−2 )+4 f (x n−1 )+ f (x n )).<br />

This is just slightly more complicated than the formula for trapezoids; we need to remember the alternating<br />

2 and 4 coefficients, and that the interval must be divided into an even number of subintervals. This<br />

approximation technique is referred to as Simpson’s Rule.<br />

.<br />

(x i+2 , f (x i+2 ))<br />

(x i , f (x i ))<br />

. . . . . . . . . . . . . . . . . .............<br />

x i x i+1 x i+2<br />

Figure 7.3: A parabola (dashed) approximating a curve (solid).<br />

As with the trapezoid method, this is useful only with an error bound:<br />

Theorem 7.40: Error for Simpson’s Approximation<br />

Suppose f has a fourth derivative f (4) everywhere on the interval [a,b], and| f (4) (x)|≤M for all x<br />

in the interval. With Δx =(b − a)/n, an error bound for Simpson’s approximation is<br />

E(Δx)= b − a<br />

180 M(Δx)4 =<br />

(b − a)5<br />

180n 4 M.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!