The Fundamental Theorem of Calculus gives a concrete technique for finding the exact value of a definite integral. That technique is based on computing antiderivatives. Despite the power of this theorem, there are still situations where we must approximate the value of the definite integral instead of finding its exact value. The first situation we explore is where we cannot compute an antiderivative of the integrand. The second case is when we actually do not know the integrand, but only its value when evaluated at certain points.
An elementary function is any function that is a combination of polynomials, roots, rational, exponential, logarithmic and trigonometric functions and their inverses. We can compute the derivative of any elementary function, but there are many elementary functions of which we cannot compute an antiderivative. For example, the following functions do not have antiderivatives that we can express with elementary functions:
The simplest way to refer to the antiderivatives of is to simply write .
This section outlines three common methods of approximating the value of definite integrals. We describe each as a systematic method of approximating area under a curve. By approximating this area accurately, we find an accurate approximation of the corresponding definite integral.
We will apply the methods we learn in this section to the following definite integrals:
as pictured in Figure 8.7.1.
In Section 5.3 we addressed the problem of evaluating definite integrals by approximating the area under the curve using rectangles. We revisit those ideas here before introducing other methods of approximating definite integrals.
We start with a review of notation. Let be a continuous function on the interval . We wish to approximate . We partition into equally spaced subintervals, each of length . The endpoints of these subintervals are labeled as
Section 5.3 showed that to use the Left Hand Rule we use the summation and to use the Right Hand Rule we use . We review the use of these rules in the context of examples.
Approximate using the Left and Right Hand Rules with 5 equally spaced subintervals.
SolutionWe begin by partitioning the interval into 5 equally spaced intervals. We have , so
Using the Left Hand Rule, we have:
Using the Right Hand Rule, we have:
Figure 8.7.2 shows the rectangles used in each method to approximate the definite integral. These graphs show that in this particular case, the Left Hand Rule is an over approximation and the Right Hand Rule is an under approximation. To get a better approximation, we could use more rectangles, as we did in Section 5.3. We could also average the Left and Right Hand Rule results together, giving
The actual answer, accurate to 4 places after the decimal, is 0.7468, showing our average is a good approximation.
Approximate using the Left and Right Hand Rules with 10 equally spaced subintervals.
SolutionWe begin by finding :
It is useful to write out the endpoints of the subintervals in a table; in Figure 8.7.3, we give the exact values of the endpoints, their decimal approximations, and decimal approximations of evaluated at these points.
Once this table is created, it is straightforward to approximate the definite integral using the Left and Right Hand Rules. (Note: the table itself is easy to create, especially with a standard spreadsheet program on a computer. The last two columns are all that are needed.) The Left Hand Rule sums the first 10 values of and multiplies the sum by ; the Right Hand Rule sums the last 10 values of and multiplies by . Therefore we have:
The average of the Left and Right Hand Rules is 0.4275. The actual answer, accurate to 3 places after the decimal, is 0.460. Our approximations were once again fairly good. The rectangles used in each approximation are shown in Figure 8.7.4. It is clear from the graphs that using more rectangles (and hence, narrower rectangles) should result in a more accurate approximation.
In Example 8.7.1 we approximated the value of with 5 rectangles of equal width. Figure 8.7.2 showed the rectangles used in the Left and Right Hand Rules. These graphs clearly show that rectangles do not match the shape of the graph all that well, and that accurate approximations will only come by using lots of rectangles.
Instead of using rectangles to approximate the area, we can instead use trapezoids. In Figure 8.7.5, we show the region under on approximated with 5 trapezoids of equal width; the top “corners” of each trapezoid lie on the graph of . It is clear from this figure that these trapezoids more accurately approximate the area under and hence should give a better approximation of . (In fact, these trapezoids seem to give a great approximation of the area.)
The formula for the area of a trapezoid is given in Figure 8.7.6. We approximate with these trapezoids in the following example.
Use 5 trapezoids of equal width to approximate .
SolutionTo compute the areas of the 5 trapezoids in Figure 8.7.5, it will again be useful to create a table of values as shown in Figure 8.7.7.
The leftmost trapezoid has legs of length 1 and 0.961 and a height of 0.2. Thus, by our formula, the area of the leftmost trapezoid is:
Moving right, the next trapezoid has legs of length 0.961 and 0.852 and a height of 0.2. Thus its area is:
The sum of the areas of all 5 trapezoids is:
We approximate
There are many things to observe in this example. Note how each term in the final summation was multiplied by both 1/2 and by . We can factor these coefficients out, leaving a more concise summation as:
Now notice that all numbers except for the first and the last are added twice. Therefore we can write the summation even more concisely as
This is the heart of the Trapezoidal Rule, wherein a definite integral is approximated by using trapezoids of equal widths to approximate the corresponding area under . Using equally spaced subintervals with endpoints , , …, , we again have . Thus:
Revisit Example 8.7.2 and approximate using the Trapezoidal Rule and 10 equally spaced subintervals.
SolutionWe refer back to Figure 8.7.3 for the table of values of . Recall that . Thus we have:
Notice how “quickly” the Trapezoidal Rule can be implemented once the table of values is created. This is true for all the methods explored in this section; the real work is creating a table of and values. Once this is completed, approximating the definite integral is not difficult. Again, using technology is wise. Spreadsheets can make quick work of these computations and make using lots of subintervals easy.
Also notice the approximations the Trapezoidal Rule gives. It is the average of the approximations given by the Left and Right Hand Rules! This effectively renders the Left and Right Hand Rules obsolete. They are useful when first learning about definite integrals, but if a real approximation is needed, one is generally better off using the Trapezoidal Rule instead of either the Left or Right Hand Rule.
We will also show that the Trapezoidal Rule makes using the Midpoint Rule obsolete as well. With much more work, it will turn out that the Midpoint Rule has only a marginal gain in accuracy. But we will include it in our results for the sake of completeness.
How can we improve on the Trapezoidal Rule, apart from using more and more trapezoids? The answer is clear once we look back and consider what we have really done so far. The Left Hand Rule is not really about using rectangles to approximate area. Instead, it approximates a function with constant functions on small subintervals and then computes the definite integral of these constant functions. The Trapezoidal Rule is really approximating a function with a linear function on a small subinterval, then computes the definite integral of this linear function. In both of these cases the definite integrals are easy to compute in geometric terms.
So we have a progression: we start by approximating with a constant function and then with a linear function. What is next? A quadratic function. By approximating the curve of a function with lots of parabolas, we generally get an even better approximation of the definite integral. We call this process Simpson’s Rule, named after Thomas Simpson (1710-1761), even though others had used this rule as much as 100 years prior.
Given one point, we can create a constant function that goes through that point. Given two points, we can create a linear function that goes through those points. Given three points, we can create a quadratic function that goes through those three points (given that no two have the same -value).
Consider three points , and whose -values are equally spaced and . Let be the quadratic function that goes through these three points. An exercise will ask you to show that
(8.7) |
Consider Figure 8.7.8. A function goes through the 3 points shown and the parabola that also goes through those points is graphed with a dashed line. Using our equation from above, we know exactly that
Since is a good approximation for on , we can state that
Notice how the interval was split into two subintervals as we needed 3 points. Because of this, whenever we use Simpson’s Rule, we need to break the interval into an even number of subintervals.
In general, to approximate using Simpson’s Rule, subdivide into subintervals, where is even and each subinterval has width . We approximate with parabolic curves, using Equation (8.7) to compute the area under these parabolas. Adding up these areas gives the formula:
Note how the coefficients of the terms in the summation have the pattern 1, 4, 2, 4, 2, 4, …, 2, 4, 1.
Let’s demonstrate Simpson’s Rule with a concrete example.
Approximate using Simpson’s Rule and 4 equally spaced subintervals.
SolutionWe begin by making a table of values as we have in the past, as shown in Figure 8.7.9(a). Simpson’s Rule states that ††margin: 0 1 0.25 0.939 0.5 0.779 0.75 0.570 1 0.368 (a) (b)
Recall in Example 8.7.1 we stated that the correct answer, accurate to 4 places after the decimal, was 0.7468. Our approximation with Simpson’s Rule, with 4 subintervals, is better than our approximation with the Trapezoidal Rule using 5.
Figure 8.7.9(b) shows along with its approximating parabolas, demonstrating how good our approximation is. The approximating curves are nearly indistinguishable from the actual function.
Approximate using Simpson’s Rule and 10 equally spaced intervals.
Solution††margin: (a) (b) Figure 8.7.10(a) shows the table of values that we used in the past for this problem, shown here again for convenience. Again, .
Simpson’s Rule states that
Recall that the actual value, accurate to 3 decimal places, is 0.460. Our approximation is within one 1/100 of the correct value. The graph in Figure 8.7.10(b) shows how closely the parabolas match the shape of the graph.
We summarize the key concepts of this section thus far in the following Key Idea.
Let be a continuous function on , let be a positive integer, and let .
Set , , …, , .
Consider .
Left Hand Rule:
.
Right Hand Rule:
.
Midpoint Rule:
.
Trapezoidal Rule:
.
Simpson’s Rule:
( even).
In our examples, we approximated the value of a definite integral using a given method then compared it to the “right” answer. This should have raised several questions in the reader’s mind, such as:
How was the “right” answer computed?
If the right answer can be found, what is the point of approximating?
If there is value to approximating, how are we supposed to know if the approximation is any good?
These are good questions, and their answers are educational. In the examples, the right answer was never computed. Rather, an approximation accurate to a certain number of places after the decimal was given. In Example 8.7.1, we do not know the exact answer, but we know it starts with 0.7468. These more accurate approximations were computed using numerical integration but with more precision (i.e., more subintervals and the help of a computer).
Since the exact answer cannot be found, approximation still has its place. How are we to tell if the approximation is any good?
“Trial and error” provides one way. Using technology, make an approximation with, say, 10, 100, and 200 subintervals. This likely will not take much time at all, and a trend should emerge. If a trend does not emerge, try using yet more subintervals. Keep in mind that trial and error is never foolproof; you might stumble upon a problem in which a trend will not emerge.
A second method is to use Error Analysis. While the details are beyond the scope of this text, there are some formulas that give bounds for how good your approximation will be. For instance, the formula might state that the approximation is within 0.1 of the correct answer. If the approximation is 1.58, then one knows that the correct answer is between 1.48 and 1.68. By using lots of subintervals, one can get an approximation as accurate as one likes. Theorem 8.7.1 states what these bounds are.
Suppose that is an upper bound on on . Then a bound for the error of the numerical method of integration is given by:
Method | Error Bound |
---|---|
Left/Right Hand Rule | |
Midpoint Rule | |
Trapezoidal Rule | |
Simpson’s Rule |
There are some key things to note about this theorem.
The larger the interval, the larger the error. This should make sense intuitively.
The error shrinks as more subintervals are used (i.e., as gets larger).
When doubles, the Left and Right Hand Rules double in accuracy, the Midpoint and Trapezoidal Rules quadruple in accuracy, and Simpson’s Rule is 16 times more accurate.
The error in Simpson’s Rule has a term relating to the 4 derivative of . Consider a cubic polynomial: its derivative is 0. Therefore, the error in approximating the definite integral of a cubic polynomial with Simpson’s Rule is 0 — Simpson’s Rule computes the exact answer!
We revisit Examples 8.7.3 and 8.7.5 and compute the error bounds using Theorem 8.7.1 in the following example.
Find the error bounds when approximating using the Trapezoidal Rule and 5 subintervals, and using Simpson’s Rule with 4 subintervals.
SolutionTrapezoidal Rule with :
We start by computing the derivative of : ††margin:
Figure 8.7.11 shows a graph of on . It is clear that the largest value of , in absolute value, is 2. Thus we let and apply the error formula from Theorem 8.7.1.
Our error estimation formula states that our approximation of 0.7445 found in Example 8.7.3 is within 0.0067 of the correct answer, hence we know that
We had earlier computed the exact answer, correct to 4 decimal places, to be 0.7468, affirming the validity of Theorem 8.7.1.
Simpson’s Rule with :
We start by computing the derivative of : ††margin:
Figure 8.7.12 shows a graph of on . It is clear that the largest value of , in absolute value, is 12. Thus we let and apply the error formula from Theorem 8.7.1.
Our error estimation formula states that our approximation of found in Example 8.7.5 is within 0.00026 of the correct answer, hence we know that
Once again we affirm the validity of Theorem 8.7.1.
At the beginning of this section we mentioned two main situations where numerical integration was desirable. We have considered the case where an antiderivative of the integrand cannot be computed. We now investigate the situation where the integrand is not known. This is, in fact, the most widely used application of Numerical Integration methods. “Most of the time” we observe behavior but do not know “the” function that describes it. We instead collect data about the behavior and make approximations based off of this data. We demonstrate this in an example.
One of the authors drove his daughter home from school while she recorded their speed every 30 seconds. The data is given in Figure 8.7.13. ††margin: Time Speed (min) (mph) 0 0 0.5 25 1 22 1.5 19 2 39 2.5 0 3 43 3.5 59 4 54 4.5 51 5 43 5.5 35 6 40 6.5 43 7 30 7.5 0 8 0 8.5 28 9 40 9.5 42 10 40 10.5 39 11 40 11.5 23 12 0 Approximate the distance they traveled.
SolutionRecall that by integrating a speed function we get distance traveled. We have information about ; we will use Simpson’s Rule to approximate
The most difficult aspect of this problem is converting the given data into the form we need it to be in. The speed is measured in miles per hour, whereas the time is measured in 30 second increments.
We need to compute . Clearly, . What are and ? Since we start at time , we have that . The final recorded time came after 24 periods of 30 seconds, which is 12 minutes or 1/5 of an hour. Thus we have
Thus the distance traveled is approximately:
We approximate the author drove 6.2 miles. (Because we are sure the reader wants to know, the author’s odometer recorded the distance as about 6.05 miles.)
T/F: Simpson’s Rule is a method of approximating antiderivatives.
What are the two basic situations where approximating the value of a definite integral is necessary?
Why are the Left and Right Hand Rules rarely used?
Why is the Midpoint Rule rarely used?
In Exercises 5–12, a definite integral is given.
Approximate the definite integral with the Trapezoidal Rule and .
Approximate the definite integral with Simpson’s Rule and .
Find the exact value of the integral.
In Exercises 13–20, approximate the definite integral with the Trapezoidal Rule and Simpson’s Rule, with .
In Exercises 21–24, find such that the error in approximating the given definite integral is less than when using:
the Trapezoidal Rule
Simpson’s Rule
In Exercises 25–26, a region is given. Find the area of the region using Simpson’s Rule:
where the measurements are in centimeters, taken in 1 cm increments, and
where the measurements are in hundreds of yards, taken in 100 yd increments.
Let be the quadratic function that goes through the points , and . Show that .