Analog Computers

Reference / Paper · 2000

Difference Equations to Differential Equations: Section 4.2 — Numerical Approximations of Definite Integrals

Read the PDF (15 pp) ↗

Section 4.2 of Dan Sloughter's open calculus text presents four numerical methods for approximating definite integrals: the left-hand and right-hand rules (error O(1/n)), the trapezoidal rule and midpoint rule (error O(1/n²)), and Simpson's rule (error O(1/n⁴)). The derivations use the Mean Value Theorem and Taylor-polynomial arguments to bound errors rigorously, and worked examples illustrate convergence rates with tabulated approximations for benchmark integrals.

Manufacturer
Open Calculus
Author
Dan Sloughter
Year
2000
Type
Reference / Paper
Language
English
Learning track
general theory
Pages
15
Credit
Copyright © 2000 by Dan Sloughter. Published as part of the open textbook "Difference Equations to Differential Equations".
  • Open Calculus
  • numerical integration
  • trapezoidal rule
  • Simpson's rule
  • midpoint rule

← Back to the Reference Library

Difference Equations to Differential Equations: Section 4.2 — Numerical Approximations of Definite Integrals

Section 4.2 Difference Equations to Differential Equations Numerical Approximations of Definite Integrals Computing a definite integral of a function f over an interval [a, b] using upper and lower sums, or even as the limit of Riemann sums, is, for all but the simplest cases, a difficult task. As a result, definite integrals are almost never computed in that manner. For the most part, definite integrals are evaluated either using the Fundamental Theorem of Calculus or using numerical approximation techniques. We will take up the Fundamental Theorem of Calculus approach in the next section; in this section we consider several methods for numerical approximation. The left-hand and right-hand rules Recall that for an integrable function f on an interval [a, b], the left-hand rule approximaRb tion for a f (x)dx, using n intervals, is given by AL = h n−1 X f (a + ih) (4.2.1) f (a + ih), (4.2.2) i=0 and the right-hand rule approximation by AR = h n X i=1 where h= b−a . n We now look at the accuracy of these approximations. Let xi = a+ih, i = 0, 1, 2, . . . , n, the endpoints for a partition of [a, b] using n intervals of equal length h. Assume f is continuous on [a, b] and differentiable on (a, b) and that x is a point in the ith interval, that is, xi−1 ≤ x ≤ xi . Then the Mean Value Theorem tells us that there exists a point ci in the interval (xi−1 , xi ) such that f 0 (ci ) = f (x) − f (xi−1 ) . x − xi−1 (4.2.3) Solving for f (x) in (4.2.3), we have f (x) = f (xi−1 ) + f 0 (ci )(x − xi−1 ). 1 (4.2.4) Copyright c by Dan Sloughter 2000 2 Numerical Approximations of Definite Integrals Section 4.2 Integrating both sides of (4.2.4) over the interval [xi−1 , xi ] gives us Z xi Z xi Z xi f (x)dx = f (xi−1 )dx + f 0 (ci )(x − xi−1 )dx xi−1 xi−1 xi−1 Z xi = f (xi−1 )(xi − xi−1 ) + f 0 (ci )(x − xi−1 )dx (4.2.5) xi−1 Z xi f 0 (ci )(x − xi−1 )dx, = f (xi−1 )h + xi−1 where we have used the fact that the integral of a constant equals the constant multiplied by the length of the interval. Hence Z b n Z xi X f (x)dx = f (x)dx a = i=1 n X xi−1 n Z xi X f (xi−1 )h + i=1 = AL + i=1 Thus we have Z b f (x)dx − AL = a ≤ (4.2.6) xi−1 i=1 n Z xi X f 0 (ci )(x − xi−1 )dx f 0 (ci )(x − xi−1 )dx. xi−1 n Z xi X f 0 (ci )(x − xi−1 )dx i=1 xi−1 n Z xi X i=1 (4.2.7) f 0 (ci )(x − xi−1 )dx . xi−1 Now Z xi Z xi 0 f (ci )(x − xi−1 )dx ≤ xi−1 |f 0 (ci )(x − xi−1 )|dx, (4.2.8) xi−1 (see Problem 11 in Section 4.1), so Z b n Z xi X f (x)dx − AL ≤ |f 0 (ci )(x − xi−1 )|dx a = i=1 xi−1 n Z xi X i=1 (4.2.9) 0 |f (ci )|(x − xi−1 )dx, xi−1 where the last equality follows from the fact that x − xi−1 ≥ 0 for all x in [xi−1 , xi ]. Now suppose f 0 is defined and continuous on [a, b] and let M be the maximum value of |f 0 (x)| for x in [a, b]. Then Z xi Z xi 0 |f (ci )|(x − xi−1 )|dx ≤ M (x − xi−1 )dx xi−1 xi−1 Z xi M h2 , (x − xi−1 )dx = =M 2 xi−1 (4.2.10) Section 4.2 Numerical Approximations of Definite Integrals xi - 1 3 xi Figure 4.2.1 Graph of y = x − xi−1 over the interval [xi−1 , xi ] since the region beneath the graph of y = x − xi−1 over the interval [xi−1 , xi ] is a triangle with base and height both of length h = xi − xi−1 (see Figure 4.2.1). Substituting (4.2.10) into (4.2.9), and recalling that h = b−a n , we have Z b f (x)dx − AL ≤ a n X M h2 i=1 2 = nM h2 nM (b − a)2 M (b − a)2 = = . 2 2n2 2n (4.2.11) In other words, the absolute value of the error of the left-hand rule approximation is bounded by a constant multiplied by n1 . This explains the behavior of the example in Section 4.1 where we saw that doubling the number of intervals would decrease the error by a factor of 21 . The same techniques yield a similar result for the right-hand rule. The trapezoidal rule For a decreasing function, the left-hand rule is an upper sum and the right-hand rule is a lower sum; for an increasing function, the left-hand rule is a lower sum and the right-hand rule is an upper sum. Hence, for such functions, it would seem that the average of the left-hand and right-hand rules, that is, AL + AR , 2 Rb should provide a better approximation to a f (x)dx than either AL or AR . We will now show that this is true in general. Suppose f , f 0 , and f 00 are all defined and continuous on [a, b]. From (4.2.4) we know that for any x in the interval [xi−1 , xi ] there exists a point ci in (xi−1 , xi ) such that f (x) = f (xi−1 ) + f 0 (ci )(x − xi−1 ). (4.2.12) Similarly, there exists a point di in (xi−1 , xi ) such that f (x) = f (xi ) + f 0 (di )(x − xi ). (4.2.13) 4 Numerical Approximations of Definite Integrals Section 4.2 Using f 0 in place of f in (4.2.4), there exists a point pi in (xi−1 , ci ) such that f 0 (ci ) = f 0 (xi−1 ) + f 00 (pi )(ci − xi−1 ) (4.2.14) f 0 (di ) = f 0 (xi−1 ) + f 00 (qi )(di − xi−1 ) (4.2.15) and a point qi such that Substituting (4.2.14) into (4.2.12) and (4.2.15) into (4.2.13), we have f (x) = f (xi−1 ) + (f 0 (xi−1 ) + f 00 (pi )(ci − xi−1 ))(x − xi−1 ) = f (xi−1 ) + f 0 (xi−1 )(x − xi−1 ) + f 00 (pi )(ci − xi−1 )(x − xi−1 ) (4.2.16) f (x) = f (xi ) + (f 0 (xi−1 ) + f 00 (qi )(di − xi−1 ))(x − xi ) = f (xi ) + f 0 (xi−1 )(x − xi ) + f 00 (qi )(di − xi−1 )(x − xi ). (4.2.17) and Taking the average of (4.2.16) and (4.2.17) gives us f (x) + f (x) 2 f (xi−1 ) + f (xi ) f 0 (xi−1 )((x − xi−1 ) + (x − xi )) + = 2 2 f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) . + 2 f (x) = (4.2.18) Now Z xi f (xi−1 ) + f (xi ) f (xi−1 ) + f (xi ) f (xi−1 ) + f (xi ) dx = (xi − xi−1 ) = h 2 2 2 xi−1 (4.2.19) and Z xi f 0 (xi−1 )((x − xi−1 ) + (x − xi )) dx = f 0 (xi−1 ) 2 xi−1 Z xi  xi−1 xi−1 + xi x− 2  dx = 0, where the final equality follows from the fact that region between the graph of y =x− xi−1 + xi 2 (4.2.20) Section 4.2 Numerical Approximations of Definite Integrals 5 xi - 1 xi Figure 4.2.2 Graph of y = x − xi−1 + xi over the interval [xi−1 , xi ] 2 and the interval [xi−1 , xi ] forms two triangles of equal area, one above the x-axis and one below (see Figure 4.2.2). Moreover, if K is the maximum value of |f 00 (x)| for x in [a, b], then f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) K ≤ (|ci − xi−1 ||x − xi−1 | 2 2 + |di − xi−1 ||x − xi |). Since the points ci , di , and x are all in [xi−1 , xi ], it follows that f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) ≤ Kh2 . 2 (4.2.21) Hence Z xi xi−1 f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) dx ≤ 2 Z xi Kh2 dx. xi−1 Now Z xi Kh2 dx = Kh2 (xi − xi−1 ) = Kh3 , (4.2.22) xi−1 so we have Z xi xi−1 f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) dx ≤ Kh3 . 2 (4.2.23) 6 Numerical Approximations of Definite Integrals Section 4.2 Putting this all together, we have Z b f (x)dx = a n Z xi X i=1 f (x)dx xi−1 n Z xi X f (xi−1 ) + f (xi ) = dx 2 x i−1 i=1 n Z xi X f 0 (xi−1 )((x − xi−1 ) + (x − xi )) + dx 2 i=1 xi−1 n Z xi X f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) + dx 2 i=1 xi−1 = n X f (xi−1 ) + f (xi ) i=1 2 h+0 n Z xi X f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) + dx 2 i=1 xi−1 Pn Pn h i=1 f (xi−1 ) + h i=1 f (xi ) = 2 Z n x i X f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) + dx 2 x i−1 i=1 = AL + AR 2 n Z xi X f 00 (pi )(ci − xi−1 )(x − xi−1 ) + f 00 (qi )(di − xi−1 )(x − xi ) dx, + 2 i=1 xi−1 from which it follows, using (4.2.23), that n Z b X AL + AR f (x)dx − ≤ Kh3 = nKh3 = nK 2 a i=1 That is, if we approximate Rb a  b−a n 3 = K(b − a)3 . n2 (4.2.24) f (x)dx by AL + AR , 2 then the absolute value of the error is bounded by a constant multiplied by n12 . In particular, if we double the number of intervals, we should expect the error to decrease by a factor of  2 1 1 = . 2 4 Section 4.2 Numerical Approximations of Definite Integrals We call AT = AL + AR 2 7 (4.2.25) Rb a trapezoidal rule approximation for a f (x)dx. The name comes from the fact that (4.2.25) may also be derived by replacing the areas of rectangles by the areas of trapezoids in the Riemann sum approximations (see Problem 6). Example R 2 2 In Section 4.1 we saw that the left-hand and right-hand rule approximations for −1 (x + 1)dx using n = 6 intervals are AL = 5.375 and AR = 6.875. Hence the corresponding trapezoidal rule approximation is AT = 5.375 + 6.875 = 6.125. 2 With n = 100, the left-hand and right-hand rules give usAL = 5.95545 and AR = 6.04545, yielding a trapezoidal rule approximation of AT = Example 5.95545 + 6.04545 = 6.00045. 2 In a Section 4.1 we approximated Z 10 A= 1 1 dt t using both left-hand and right-hand rules and, after noting that to 6 decimal places A = 2.302585, obtained the following table of values: n 10 20 40 80 160 320 AR 1.960214 2.116477 2.205491 2.253003 2.277534 2.289994 AL 2.770214 2.521477 2.407991 2.354253 2.328159 2.315307 |A − AR | 0.342371 0.186108 0.097094 0.049582 0.025052 0.012591 |A − AL | 0.467629 0.218892 0.105406 0.051668 0.025574 0.012722 Using these results, we may compute the following trapezoidal rule approximations: n 10 20 40 80 160 320 AT 2.365214 2.318977 2.306741 2.303628 2.302846 2.302650 |A − AT | 0.062629 0.016392 0.004156 0.001043 0.000265 0.000065 We see that the errors in the trapezoidal rule approximations are significantly smaller than the corresponding errors for the left-hand and right-hand rule approximations. Moreover, 8 Numerical Approximations of Definite Integrals Section 4.2 in agreement with our work above, the errors in the trapezoidal rule approximations decrease by a factor of, roughly, 14 when we double the number of intervals. Hence we see the trapezoidal rule approximations converging to the value of the definite integral at a significantly faster rate than do the left-hand and right-hand rule approximations. The midpoint rule As above, let f be an integrable function on an interval [a, b], n a positive integer, h = b−a n , and, for i = 0, 1, 2, . . . , n, xi = a + ih, (the endpoints of a partition of [a, b] with n intervals of equal length h). We may think of the trapezoidal rule as improving on the left-hand and right-hand rules by approximating the area of the region beneath the graph of f and above the interval [xi−1 , xi ] using a rectangle with height equal to the average of f (xi−1 ) and f (xi ). Another approach is to average xi−1 and xi before evaluating f . Since each interval is of length h, we may find the midpoint by adding h2 to the left-hand endpoint. Namely, if we let h , 2 h h 3 c2 = x1 + = a + h + = a + h, 2 2 2 h h 5 c3 = x2 + = a + 2h + = a + h, 2 2 2 .. . c1 = a + (4.2.26)   h 1 h = a + (i − 1)h + = a + i − h, 2 2 2 .. .   h h 1 cn = xn−1 + = a + (n − 1)h + = a + n − h, 2 2 2 ci = xi−1 + then ci is the midpoint of the ith interval [xi−1 , xi ]. We call n X     n X 1 AM = f (ci )h = h f a+ i− h , 2 i=1 i=1 (4.2.27) the Riemann sum formed by evaluating f at the points c1 , c2 , c3 , . . . , cn , a midpoint rule Rb approximation of the definite integral a f (x)dx. R2 Example To find the midpoint rule approximation for −1 (x2 + 1)dx using n = 6 intervals, we would have 2 − (−1) h= = 0.5. 6 Then the interval endpoints are x0 = −1, x1 = −0.5, x2 = 0, x3 = 0.5, x4 = 1, x5 = 1.5, and x6 = 2, from which we find the midpoints c1 = −0.75, c2 = −0.25, c3 = 0.25, c4 = 0.75, Section 4.2 Numerical Approximations of Definite Integrals 5 4 3 2 1 1 -1 2 Z 2 Figure 4.2.3 Midpoint rule approximation for (x2 + 1)dx −1 c5 = 1.25, and c6 = 1.75 (see Figure 4.2.3). Thus, letting f (x) = x2 + 1, we have AM = 0.5(f (−0.75) + f (−0.25) + f (0.25) + f (0.75) + f (0.125) + f (1.75)) = 0.5(1.5625 + 1.0625 + 1.0625 + 1.5625 + 2.5625 + 4.0625) = 5.9375. With n = 100 intervals, using (4.2.27) with a computer, we have AM = 5.999775. Example Applying the midpoint rule to the problem of approximating Z 10 A= 1 1 dt, t we obtain the following table (again rounded to 6 decimal places): 9 10 Numerical Approximations of Definite Integrals Section 4.2 1 0.8 0.6 0.4 0.2 2 4 6 8 10 Z 10 Figure 4.2.4 Midpoint rule approximation for 1 n AM |A − AM | 10 20 40 80 160 320 2.272740 2.294504 2.300515 2.302064 2.302455 2.302552 0.029845 0.008081 0.002070 0.000521 0.000130 0.000033 1 dt t Notice that, as with the trapezoidal rule, doubling the number of intervals decreases the error by a factor of about 41 . Moreover, note that the error in each approximation is approximately 21 of the corresponding error for the trapezoidal rule. An analysis of the error in the midpoint rule, similar to that which we did above for the left-hand, right-hand, and trapezoidal rules, would show that the absolute value of the error is bounded by a constant multiplied by n12 . Hence doubling the number of intervals will decrease the error by, roughly, a factor of 41 , as was evidenced in the previous example. Moreover, a more careful examination of the error (one requiring the use of Taylor polynomials, which we will discuss in Chapter 5) would show that there is a sense in which it is typically on the order of 12 the size of the error of the trapezoidal rule. Simpson’s rule We saw above that averaging the left-hand and right-hand rules, two approximation methods with errors bounded by a constant multiple of n1 , resulted in an approximation method, the trapezoidal rule, with an error bounded by a constant multiple of n12 . We might now think that we could improve on the trapezoidal and midpoint rules, two rules with errors bounded by a constant multiple of n12 , by computing their average. However, it turns out that the relationship between these two rules is not as simple as with the left-hand and right-hand rules; in fact, one really needs to use Taylor polynomials in order to understand the error terms fully. At the same time, there is a hint in our previous example. Given Section 4.2 Numerical Approximations of Definite Integrals 11 that the error from the midpoint rule was about 12 of the error of the trapezoidal rule, it would be reasonable to guess that perhaps an average of the two which gives twice as much weight to the midpoint rule would be appropriate. This in fact turns out to be the right mixture, and we define 1 2 AT + 2AM AT + AM = . (4.2.28) 3 3 3 Rb We call AS a Simpson’s rule approximation for a f (x)dx. This method of approximating definite integrals is named for Thomas Simpson (1710-1761). Simpson developed this rule in 1743 as a method for approximating the area under a curve after first approximating the curve with a number of parabolic arcs. AS = Example R 2 2 Using n = 6 intervals, we saw above that the trapezoidal rule approximation for −1 (x + 1)dx is AT = 6.1250 and the midpoint rule approximation is AM = 5.9375. Thus the corresponding Simpson’s rule approximation is AS = 6.1250 + (2)(5.9375) 18 = = 6. 3 3 With n = 100 intervals, we have AT = 6.000450 and AM = 5.999775, giving us AS = 18 6.000450 + (2)(5.999775) = = 6. 3 3 It may seem surprising in this example that we get the same result with 100 intervals as we do with 6, but in fact this is the exact answer. It may be shown, either by careful examination of the error or by deriving the rule from parabolic approximations, that Simpson’s rule will find the exact value for the definite integral of any quadratic polynomial. What is even more surprising, careful examination of the error using Taylor polynomials shows that Simpson’s rule is exact for cubic polynomials as well. Example Using the values for the trapezoidal and midpoint rule approximations obtained above, we have the following approximations for Z 10 A= 1 1 dt t using Simpson’s rule: n 10 20 40 80 AS 2.303565 2.302662 2.302590 2.302585 |A − AS | 0.000980 0.000077 0.000005 0.000000 We have stopped the table at 80 intervals because at that point the approximation is accurate to 6 decimal places. 12 Numerical Approximations of Definite Integrals Section 4.2 1 0.8 0.6 0.4 0.2 0.5 1 1.5 2 2.5 3 Figure 4.2.5 Region beneath y = sin(x) over the interval [0, π] It may be shown that the absolute value of the error using Simpson’s rule is bounded by a constant multiple of n14 , resulting in a dramatic improvement over both the trapezoidal and midpoint rules. For Simpson’s rule, doubling the number of intervals typically decreases the error by a factor of  4 1 1 = , 2 16 a general fact for which we can see some evidence in the preceding example. To be fair, since Simpson’s rule makes use of both the trapezoidal rule and the midpoint rule approximations, the function being integrated must be evaluated both at the endpoints and at the midpoint of each interval. This requires evaluating the function at 2n + 1 points, whereas the trapezoidal rule evaluates the function at n + 1 points and the midpoint rule evaluates the function at n points. Thus, for direct comparison of errors, one should compare, for example, Simpson’s rule with 10 subdivisions to the other rules using 20 subdivisions. Nevertheless, Simpson’s rule converges to the value of the integral much faster than the other methods and, hence, is the method of preference among the ones we have discussed. Even faster methods exist, but we will leave them for a more advanced course. When approximating the value of an integral, there is in general no practical way to know how many intervals are necessary in order to obtain an approximation to a desired level of accuracy. Analogous to the way in which we applied Newton’s method, we normally compute a sequence of approximations, perhaps starting with only two intervals and then doubling the number of intervals from one approximation to the next, stopping when we obtain two successive approximations whose difference, in absolute value, is less than the desired level of accuracy. The next example illustrates this procedure. Example Suppose we wish to approximate, with an error less than 0.0001, the area A of the region between one arch of the curve y = sin(x) and the x-axis, as shown in Figure 4.2.5. That is, we want to find Z π A= sin(x)dx. 0 Section 4.2 Numerical Approximations of Definite Integrals 13 Starting with n = 2 intervals and using Simpson’s rule, we generate the following table of approximations, rounding to 6 decimal places: n AS 2 4 8 16 2.004560 2.000269 2.000017 2.000001 Since the absolute value of the difference between the last two approximations is less than 0.0001, we stop at this point and use 2.0000 as our approximation for A. Problems 1. Approximate each of the following integrals using the trapezoidal and midpoint rules with n = 4 intervals. Z 1 Z π 2 (a) x dx (b) sin(x)dx 0 0 Z 5 Z 1 1 dt t (c) 1 Z 4 (e) (t2 + t)dt (d) z 3 dz −1 (f) 0 Z 2p 4 − x2 dx 0 2. Use your results from Problem 1 to compute the corresponding Simpson’s rule approximation for each integral. 3. Approximate each of the following integrals using the trapezoidal and midpoint rules with n = 50 intervals. Z 1 Z π 2 (a) x dx (b) sin(x)dx 0 0 Z 5 Z 2 (c) (4x2 + 3x − 6)dx −2 Z π (e) (g) x2 cos(x)dx sin(x) dx x 1 Z 2π q (f) 1 − sin2 (t) dt (d) 0 0 Z 5 Z π 1 dx 2 −5 x + 1 (h) sin(3x)cos(x)dx −π 4. Use your results from Problem 3 to compute the corresponding Simpson’s rule approximation for each integral. 5. Approximate the following definite integrals using Simpson’s rule. Starting with n = 2 intervals, compute a sequence of approximations by doubling the number of intervals from one approximation to the next. Stop when the absolute value of the difference between two successive approximations is less than 0.00001. 14 Numerical Approximations of Definite Integrals Z 4 (a) Z 6 2 x dx (b) (3x2 + 4x − 3)dx 1 0 Z π Z 2π (c) sin2 (x)dx (d) 0 Section 4.2 sin2 (x) cos2 (x)dx 0 Z π p (e) 1 + cos2 (θ) dθ Z 2 (f) −π sin(x) dx x 0.1 6. Suppose f is integrable on the interval [a, b]. Divide [a, b] into n equal intervals of length h = b−a be the endpoints of these intervals. Let AT n and let x0 , x1 , x2 , . . . , xn R b be the trapezoidal rule approximation for a f (x)dx. (a) Show that AT = h (f (x0 ) + 2f (x1 ) + 2f (x2 ) + · · · + 2f (xn−1 ) + f (xn )). 2 (b) Assume f (x) ≥ 0 for all x in [a, b]. For i = 1, 2, 3, . . . , n, let Ai be the area of the trapezoid with vertices at (xi−1 , 0), (xi−1 , f (xi−1 )), (xi , f (xi )), and (xi , 0) (that is, Ai is the area of a trapezoid with one side being the interval [xi−1 , xi ] and parallel sides extending from the x-axis up to the graph of f ). Then we could approximate Rb f (x)dx by A1 + A2 + A3 + · · · + An . Show that a AT = A1 + A2 + A3 + · · · + An . 7. Suppose f is integrable on the interval [a, b]. Divide [a, b] into 2n equal intervals of length h = b−a Let 2n and let x0 ,, x1 , x2 , . . . , x2n be the endpoints of these intervals. Rb AT and AM be the trapezoidal rule and midpoint rule approximations for a f (x)dx using the n intervals with endpoints x0 , x2 , x4 , . . . , x2n . Let AS be the corresponding Simpson’s rule approximation. Show that AS = h (f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + · · · + 2f (x2n−2 ) + 4f (x2n−1 ) + f (x2n )). 3 8. Let T (t) be the temperature at t hours after midnight at the Kalispell airport and suppose the following values for T were recorded on March 15, 1955: Time (t) 0.0 Temperature (T ) 40 0.5 38 1.0 37 1.5 36 2.0 33 2.5 30 3.0 28 3.5 28 4.0 27 4.5 26 Time (t) 5.0 Temperature (T ) 24 5.5 26 6.0 30 6.5 30 7.0 32 7.5 35 8.0 37 8.5 38 9.0 40 9.5 45 Time (t) 10.0 10.5 11.0 11.5 12.0 Temperature (T ) 47 47 48 49 50 R 12 (a) Approximate 0 T (t)dt using Simpson’s rule. You may wish to use the formula in Problem 7. Section 4.2 Numerical Approximations of Definite Integrals 15 (b) What does 1 A= 12 Z 12 T (t)dt 0 represent? 24 1 X (c) How does A compare with T 25 t=0   t ? 2 9. Find the area beneath one arch of the curve y = sin2 (x). 10. Let R be the region in the plane bounded by the curves y = x2 and y = (x − 2)2 and the x-axis. Find the area of R.