How do we accurately evaluate a definite integral such as when we cannot use the First Fundamental Theorem of Calculus because the integrand lacks an elementary algebraic antiderivative? Are there ways to generate accurate estimates without using extremely large values of in Riemann sums?
What is the Trapezoid Rule, and how is it related to left, right, and middle Riemann sums?
How are the errors in the Trapezoid Rule and Midpoint Rule related, and how can they be used to develop an even more accurate rule?
When we first explored finding the net signed area bounded by a curve, we developed the concept of a Riemann sum as a helpful estimation tool and a key step in the definition of the definite integral. Recall that the left, right, and middle Riemann sums of a function on an interval are given by
A Riemann sum is a sum of (possibly signed) areas of rectangles. The value of determines the number of rectangles, and our choice of left endpoints, right endpoints, or midpoints determines the heights of the rectangles. We can see the similarities and differences among these three options in Figure 5.6.1, where we consider the function on the interval , and use 5 rectangles for each of the Riemann sums.
While it is a good exercise to compute a few Riemann sums by hand, just to ensure that we understand how they work and how varying the function, the number of subintervals, and the choice of endpoints or midpoints affects the result, using computing technology is the best way to determine ,, and . Any computer algebra system will offer this capability; as we saw in Preview Activity 4.3.1, a straightforward option that is freely available online is this applet 1
gvsu.edu/s/a9
. Note that we can adjust the formula for , the window of - and -values of interest, the number of subintervals, and the method. (See Preview Activity 4.3.1 for any needed reminders on how the applet works.)
In this section we explore several different alternatives for estimating definite integrals. Our main goal is to develop formulas to estimate definite integrals accurately without using a large numbers of rectangles.
As we begin to investigate ways to approximate definite integrals, it will be insightful to compare results to integrals whose exact values we know. To that end, the following sequence of questions centers on .
(d) We define the error in an approximation of a definite integral to be the difference between the integral’s exact value ( and the approximation’s value. What is the error that results from using ? From ? From ?
(e) In what follows in this section, we will learn a new approach to estimating the value of a definite integral known as the Trapezoid Rule. The basic idea is to use trapezoids, rather than rectangles, to estimate the area under a curve. What is the formula for the area of a trapezoid with bases of length and and height ? (Type b1 and b2 for the bases).
So far, we have used the simplest possible quadrilaterals (that is, rectangles) to estimate areas. It is natural, however, to wonder if other familiar shapes might serve us even better.
An alternative to ,, and is called the Trapezoid Rule. Rather than using a rectangle to estimate the (signed) area bounded by on a small interval, we use a trapezoid. For example, in Figure 5.6.2, we estimate the area under the curve using three subintervals and the trapezoids that result from connecting the corresponding points on the curve with straight lines.
The biggest difference between the Trapezoid Rule and a Riemann sum is that on each subinterval, the Trapezoid Rule uses two function values, rather than one, to estimate the (signed) area bounded by the curve. For instance, to compute , the area of the trapezoid on , we observe that the left base has length , while the right base has length . The height of the trapezoid is . The area of a trapezoid is the average of the bases times the height, so we have
Because both left and right endpoints are being used, we recognize within the trapezoidal approximation the use of both left and right Riemann sums. Rearranging the expression for by removing factors of and , grouping the left endpoint and right endpoint evaluations of , we see that
We now observe that two familiar sums have arisen. The left Riemann sum is , and the right Riemann sum is . Substituting and for the corresponding expressions in Equation (5.6.4), it follows that . We have thus seen a very important result: using trapezoids to estimate the (signed) area bounded by a curve is the same as averaging the estimates generated by using left and right endpoints.
In this activity, we explore the relationships among the errors generated by left, right, midpoint, and trapezoid approximations to the definite integral .
Use appropriate computing technology to compute the following approximations for :,,, and .
Let the error that results from an approximation be the approximation’s value minus the exact value of the definite integral. For instance, if we let represent the error that results from using the trapezoid rule with 4 subintervals to estimate the integral, we have
.
Similarly, we compute the error of the midpoint rule approximation with 8 subintervals by the formula
.
Based on your work in (a) and (b) above, compute ,,,.
Which rule consistently over-estimates the exact value of the definite integral? Which rule consistently under-estimates the definite integral?
What behavior(s) of the function lead to your observations in (d)?
Subsection5.6.2Comparing the Midpoint and Trapezoid Rules
We know from the definition of the definite integral that if we let be large enough, we can make any of the approximations ,, and as close as we’d like (in theory) to the exact value of . Thus, it may be natural to wonder why we ever use any rule other than or (with a sufficiently large value) to estimate a definite integral. One of the primary reasons is that as ,, and thus in a Riemann sum calculation with a large value, we end up multiplying by a number that is very close to zero. Doing so often generates roundoff error, because representing numbers close to zero accurately is a persistent challenge for computers.
Hence, we explore ways to estimate definite integrals to high levels of precision, but without using extremely large values of . Paying close attention to patterns in errors, such as those observed in Activity 5.6.2, is one way to begin to see some alternate approaches.
To begin, we compare the errors in the Midpoint and Trapezoid rules. First, consider a function that is concave up on a given interval, and picture approximating the area bounded on that interval by both the Midpoint and Trapezoid rules using a single subinterval.
Figure5.6.3.Estimating using a single subinterval: at left, the trapezoid rule; in the middle, the midpoint rule; at right, a modified way to think about the midpoint rule.
As seen in Figure 5.6.3, it is evident that whenever the function is concave up on an interval, the Trapezoid Rule with one subinterval, , will overestimate the exact value of the definite integral on that interval. From a careful analysis of the line that bounds the top of the rectangle for the Midpoint Rule (shown in magenta), we see that if we rotate this line segment until it is tangent to the curve at the midpoint of the interval (as shown at right in Figure 5.6.3), the resulting trapezoid has the same area as , and this value is less than the exact value of the definite integral. Thus, when the function is concave up on the interval, underestimates the integral’s true value.
Figure5.6.4.Comparing the error in estimating using a single subinterval: in red, the error from the Trapezoid rule; in light red, the error from the Midpoint rule.
These observations extend easily to the situation where the function’s concavity remains consistent but we use larger values of in the Midpoint and Trapezoid Rules. Hence, whenever is concave up on , will overestimate the value of , while will underestimate . The reverse observations are true in the situation where is concave down.
Next, we compare the size of the errors between and . Again, we focus on and on an interval where the concavity of is consistent. In Figure 5.6.4, where the error of the Trapezoid Rule is shaded in red, while the error of the Midpoint Rule is shaded lighter red, it is visually apparent that the error in the Trapezoid Rule is more significant. To see how much more significant, let’s consider two examples and some particular computations.
Using appropriate technology to compute ,,, and , as well as the corresponding errors ,,, and , as we did in Activity 5.6.2, we find the results summarized in Table 5.6.5. We also include the approximations and their errors for the example from Activity 5.6.2.
For a given function and interval , calculates the difference between the approximation generated by the Trapezoid Rule with and the exact value of the definite integral. If we look at not only , but also the other errors generated by using and with and in the two examples noted in Table 5.6.5, we see an evident pattern. Not only is the sign of the error (which measures whether the rule generates an over- or under-estimate) tied to the rule used and the function’s concavity, but the magnitude of the errors generated by and seems closely connected. In particular, the errors generated by the Midpoint Rule seem to be about half the size (in absolute value) of those generated by the Trapezoid Rule.
That is, we can observe in both examples that and . This property of the Midpoint and Trapezoid Rules turns out to hold in general: for a function of consistent concavity, the error in the Midpoint Rule has the opposite sign and approximately half the magnitude of the error of the Trapezoid Rule. Written symbolically,
This important relationship suggests a way to combine the Midpoint and Trapezoid Rules to create an even more accurate approximation to a definite integral.
If a function is always increasing or always decreasing on the interval , one of and will over-estimate the true value of , while the other will under-estimate the integral. Thus, the errors that result from and will have opposite signs; so averaging and eliminates a considerable amount of the error present in the respective approximations. In a similar way, it makes sense to think about averaging and in order to generate a still more accurate approximation.
The rule for giving by Equation (5.6.5) is usually known as Simpson’s Rule. 3
Thomas Simpson was an 18th century mathematician; his idea was to extend the Trapezoid rule, but rather than using straight lines to build trapezoids, to use quadratic functions to build regions whose area was bounded by parabolas (whose areas he could find exactly). Simpson’s Rule is often developed from the more sophisticated perspective of using interpolation by quadratic functions.
Note that we use “” rather that “” since the points the Midpoint Rule uses are different from the points the Trapezoid Rule uses, and thus Simpson’s Rule is using points at which to evaluate the function. We build upon the results in Table 5.6.5 to see the approximations generated by Simpson’s Rule. In particular, in Table 5.6.6, we include all of the results in Table 5.6.5, but include additional results for and .
The results seen in Table 5.6.6 are striking. If we consider the approximation of , the error is only . By contrast, , so the error of that estimate is . Moreover, we observe that generating the approximations for Simpson’s Rule is almost no additional work: once we have ,, and for a given value of , it is a simple exercise to generate , and from there to calculate . Finally, note that the error in the Simpson’s Rule approximations of is zero! 4
Similar to how the Midpoint and Trapezoid approximations are exact for linear functions, Simpson’s Rule approximations are exact for quadratic and cubic functions. See additional discussion on this issue later in the section and in the exercises.
These rules are not only useful for approximating definite integrals such as , for which we cannot find an elementary antiderivative of , but also for approximating definite integrals when we are given a function through a table of data.
A car traveling along a straight road is braking and its velocity is measured at several different points in time, as given in the following table. Assume that is continuous, always decreasing, and always decreasing at a decreasing rate, as is suggested by the data.
Subsection5.6.4Overall observations regarding ,,,, and .
As we conclude our discussion of numerical approximation of definite integrals, it is important to summarize general trends in how the various rules over- or under-estimate the true value of a definite integral, and by how much. To revisit some past observations and see some new ones, we consider the following activity.
Consider the functions ,, and , all on the interval . For each of the questions that require a numerical answer in what follows, write your answer exactly in fraction form.
On the three sets of axes provided in Figure 5.6.9, sketch a graph of each function on the interval , and compute and for each. What do you observe?
Compute for each function to approximate ,, and , respectively.
Compute for each of the three functions, and hence compute for each of the three functions.
Evaluate each of the integrals ,, and exactly using the First FTC.
For each of the three functions ,, and , compare the results of ,,,, and to the true value of the corresponding definite integral. What patterns do you observe?
The results seen in Activity 5.6.4 generalize nicely. For instance, if is decreasing on , will over-estimate the exact value of , and if is concave down on , will over-estimate the exact value of the integral. An excellent exercise is to write a collection of scenarios of possible function behavior, and then categorize whether each of ,,, and is an over- or under-estimate.
Finally, we make two important notes about Simpson’s Rule. When T. Simpson first developed this rule, his idea was to replace the function on a given interval with a quadratic function that shared three values with the function . In so doing, he guaranteed that this new approximation rule would be exact for the definite integral of any quadratic polynomial. In one of the pleasant surprises of numerical analysis, it turns out that even though it was designed to be exact for quadratic polynomials, Simpson’s Rule is exact for any cubic polynomial: that is, if we are interested in an integral such as , will always be exact, regardless of the value of . This is just one more piece of evidence that shows how effective Simpson’s Rule is as an approximation tool for estimating definite integrals. 5
One reason that Simpson’s Rule is so effective is that benefits from using points of data. Because it combines , which uses midpoints, and , which uses the endpoints of the chosen subintervals, takes advantage of the maximum amount of information we have when we know function values at the endpoints and midpoints of subintervals.
For a definite integral such as when we cannot use the First Fundamental Theorem of Calculus because the integrand lacks an elementary algebraic antiderivative, we can estimate the integral’s value by using a sequence of Riemann sum approximations. Typically, we start by computing ,, and for one or more chosen values of .
The Trapezoid Rule, which estimates by using trapezoids, rather than rectangles, can also be viewed as the average of Left and Right Riemann sums. That is, .
The Midpoint Rule is typically twice as accurate as the Trapezoid Rule, and the signs of the respective errors of these rules are opposites. Hence, by taking the weighted average , we can build a much more accurate approximation to by using approximations we have already computed. The rule for is known as Simpson’s Rule, which can also be developed by approximating a given continuous function with pieces of quadratic polynomials.
Note: for this problem, because later answers depend on earlier ones, you must enter answers for all answer blanks for the problem to be correctly graded. If you would like to get feedback before you completed all computations, enter a "1" for each answer you did not yet compute and then submit the problem. (But note that this will, obviously, result in a problem submission.)
The rate at which water flows through Table Rock Dam on the White River in Branson, MO, is measured in cubic feet per second (CFS). As engineers open the floodgates, flow rates are recorded according to the following chart.
What definite integral measures the total volume of water to flow through the dam in the 60 second time period provided by the table above?
Use the given data to calculate for the largest possible value of to approximate the integral you stated in (a). Do you think over- or under-estimates the exact value of the integral? Why?
Approximate the integral stated in (a) by calculating for the largest possible value of , based on the given data.
Compute and . What quantity do both of these values estimate? Which is a more accurate approximation?