Skip to main content
Logo image

Coordinated Calculus

Section 5.9 Numerical Integration

When we first explored finding the net signed area bounded by a curve, we developed the concept of a Riemann sum 4.2 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 f on an interval [a,b] are given by
(5.15)LEFT(n)=f(x0)Δx+f(x1)Δx++f(xn1)Δx=i=0n1f(xi)Δx,(5.16)RIGHT(n)=f(x1)Δx+f(x2)Δx++f(xn)Δx=i=1nf(xi)Δx,(5.17)MID(n)=f(x1)Δx+f(x2)Δx++f(xn)Δx=i=1nf(xi)Δx,
where x0=a, xi=a+iΔx, xn=b, and Δx=ban. For the middle sum, we defined xi=(xi1+xi)/2.
A Riemann sum is a sum of (possibly signed) areas of rectangles. The value of n 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.74, where we consider the function f(x)=120(x4)3+7 on the interval [1,8], and use 5 rectangles for each of the Riemann sums.
Figure 5.74. Left, right, and middle Riemann sums for y=f(x) on [1,8] with 5 subintervals.
Part (d) of Example 4.35 explored how to determine if LEFT(n) and RIGHT(n) are underestimates or overestimates of abf(x)dx when f(x) is increasing. Similar statements can be made when f(x) is decreasing. These are summarized next.

Error types when approximating area using left and right Riemann sums.

  • If f(x) is increasing on [a,b], then LEFT(n) underestimates abf(x)dx and RIGHT(n) overestimates abf(x)dx.
  • If f(x) is decreasing on [a,b], then LEFT(n) overestimates abf(x)dx and RIGHT(n) underestimates abf(x)dx.
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 a quick way to determine LEFT(n), RIGHT(n), and MID(n). Any computer algebra system will offer this capability.
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.

Example 5.75.

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 03x3dx.
  1. Use the applet at http://gvsu.edu/s/a9
     36 
    gvsu.edu/s/a9
    with the function f(x)=x3 on the window of x values from 0 to 3 to compute LEFT(3), the left Riemann sum with three subintervals.
  2. Likewise, use the applet to compute RIGHT(3) and MID(3), the right and middle Riemann sums with three subintervals, respectively.
  3. Use the Fundamental Theorem of Calculus to compute the exact value of I=03x3dx.
  4. 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 LEFT(3)? From RIGHT(3)? From MID(3)?
  5. 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 b1 and b2 and height h?
  6. Working by hand, estimate the area under f(x)=x3 on [0,3] using three subintervals and three corresponding trapezoids. What is the error in this approximation? How does it compare to the errors you calculated in (d)?
    Figure 5.76. Using 3 trapezoids to approximate 03x3dx
Answer.
  1. LEFT(3)=9
  2. MID(3)=19.125 ,RIGHT(3)=36
  3. I=03x3dx=14x4|03=344044=20.25
  4. EL,3=11.25
    ER,3=15.75
    EM,3=1.125
  5. The area of a trapezoid with bases of length b1 and b2 and height h is
    A=h(b1+b2)2.
  6. TRAP(3)=452=22.5
    ET,3=2.25
Solution.
  1. In addition to changing f(x) to f(x)=x3 and the number of subintervals to 3, make sure to change the Sample Point Placement so that "Relative" is checked and the slide bar is all the way to the left. You’ll see that now it is sampling f(x) values from the left side of each sub-interval.
    LEFT(3)=9
  2. First change f(x) and the number of subintervals to f(x)=x3 and n=3. For RIGHT(3), make sure to change the Sample Point Placement so that "Relative" is checked and the slide bar is all the way to the right. You’ll see that now it is sampling f(x) values from the right side of each subinterval. For MID(3), make sure to change the Sample Point Placement so that "Relative" is checked and the slide bar is in the middle and the "midpoint" label shows. You’ll see that now it is sampling f(x) values from the middle of each interval.
    MID(3)=19.125 ,RIGHT(3)=36
  3. I=03x3dx=14x4|03=344044=20.25
  4. Denote the error from each approximation EL,3,ER,3, and EM,3. Then
    EL,3=ILEFT(3)=20.259=11.25
    ER,3=IRIGHT(3)=20.2536=15.75
    EM,3=IMID(3)=20.2519.125=1.125
  5. The area of a trapezoid with bases of length b1 and b2 and height h is
    A=h(b1+b2)2.
  6. The left-most trapezoid has base lengths 0 and 1 and height 1, so the area of the first trapezoid is 12(0+1)1=12. The middle trapezoid has base lengths 1 and 8 and height 1, so the area of the second trapezoid is 12(1+8)1=92. The right-most trapezoid has base lengths 8 and 27 and height 1, so the area of the third trapezoid is 12(8+27)1=352. Therefore, the approximate area under the graph of f(x)=x3 from 0 to 3 using the trapezoid rule with 3 subintervals is TRAP(3)=12+92+352=452=22.5.
    The error is ET,3=20.2522.5=2.25. Using trapezoids creates a smaller error compared to LEFT(3) and RIGHT(3). The magnitude of the error from approximating using MID(3) is half the magnitude of the error from approximating using TRAP(3), but they have opposite signs.

Subsection 5.9.1 The Trapezoid Rule

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 LEFT(n), RIGHT(n), and MID(n) is called the Trapezoid Rule. Rather than using a rectangle to estimate the (signed) area bounded by y=f(x) on a small interval, we use a trapezoid. For example, in Figure 5.77, 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.
Figure 5.77. Estimating abf(x) dx using three subintervals and trapezoids, rather than rectangles, where a=x0 and b=x3.
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 D1, the area of the trapezoid on [x0,x1], we observe that the left base has length f(x0), while the right base has length f(x1). The height of the trapezoid is x1x0=Δx=ba3. The area of a trapezoid is the average of the bases times the height, so we have
D1=12(f(x0)+f(x1))Δx.
Using similar computations for D2 and D3, we find that TRAP(3), the trapezoidal approximation to abf(x)dx is given by
TRAP(3)=D1+D2+D3=12(f(x0)+f(x1))Δx+12(f(x1)+f(x2))Δx+12(f(x2)+f(x3))Δx.
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 TRAP(3) by removing factors of 12 and Δx, grouping the left endpoint and right endpoint evaluations of f, we see that
(5.18)TRAP(3)=12[f(x0)+f(x1)+f(x2)]Δx+12[f(x1)+f(x2)+f(x3)]Δx.
We now observe that two familiar sums have arisen. The left Riemann sum LEFT(3) is LEFT(3)=f(x0)Δx+f(x1)Δx+f(x2)Δx, and the right Riemann sum is RIGHT(3)=f(x1)Δx+f(x2)Δx+f(x3)Δx. Substituting LEFT(3) and RIGHT(3) for the corresponding expressions in Equation (5.18), it follows that TRAP(3)=LEFT(3)+RIGHT(3)2. 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.

The Trapezoid Rule.

The trapezoidal approximation, TRAP(n), of the definite integral abf(x)dx using n subintervals is given by the rule
TRAP(n)=([f(x0)+f(x1)2+f(x1)+f(x2)2++f(xn1)+f(xn)2]Δx.=(i=0n1f(xi)+f(xi+1)2Δx.
Moreover, TRAP(n)=LEFT(n)+RIGHT(n)2.

Example 5.78.

In this example, we explore the relationships among the errors generated by left, right, midpoint, and trapezoid approximations to the definite integral 121x2dx
  1. Use the First FTC to evaluate 121x2dx exactly.
  2. Use appropriate computing technology to compute the following approximations for 121x2dx: TRAP(4), MID(4), TRAP(8), and MID(8).
  3. Recall that the error of an approximation is the difference between the exact value of the definite integral and the resulting approximation. For instance, if we let ERROR(T,4) represent the error that results from using the trapezoid rule with 4 subintervals to estimate the integral, we have
    ERROR(T,4)=121x2dxTRAP(4).
    Similarly, we compute the error of the midpoint rule approximation with 8 subintervals by the formula
    ERROR(M,8)=121x2dxMID(8).
    Based on your work in (a) and (b) above, compute ERROR(T,4), ERROR(T,8), ERROR(M,4), ERROR(M,8).
  4. Which rule consistently over-estimates the exact value of the definite integral? Which rule consistently under-estimates the definite integral?
  5. What behavior(s) of the function f(x)=1x2 lead to your observations in (d)?
Hint.
  1. 1x2=x2.
  2. Use a computational device.
  3. Use a computational device.
  4. Which estimate is larger than the true value of the definite integral?
  5. Note that how the curve bends makes a big difference in whether the trapezoid rule over- or under-estimates the value of the definite integral.
Answer.
  1. 121x2dx=12.
  2. The table below gives values of the trapezoid rule and corresponding errors for different n-values.
    n TRAP(n) ERROR(T,n)
    4 0.50899 0.50899
    8 0.50227 0.50227
    16 0.50057 0.50057
  3. The table below gives values of the midpoint rule and corresponding errors for different n-values.
    n MID(n) ERROR(M,n)
    4 0.49555 0.00445
    8 0.49887 0.00113
    16 0.49972 0.00028
  4. The trapezoid rule overestimates; the midpoint rule underestimates.
  5. f(x)=1x2 is concave up on [1,2].
Solution.
  1. 121x2dx=x1|12=12+1=12.
  2. The table below gives values of the trapezoid rule and corresponding errors for different n-values.
    n TRAP(n) ERROR(T,n)
    4 0.50899 0.50899
    8 0.50227 0.50227
    16 0.50057 0.50057
  3. The table below gives values of the midpoint rule and corresponding errors for different n-values.
    n MID(n) ERROR(M,n)
    4 0.49555 0.00445
    8 0.49887 0.00113
    16 0.49972 0.00028
  4. From the errors in comparison to the known exact value, we see that the trapezoid rule overestimates this definite integral and the midpoint rule underestimates this definite integral.
  5. The graph of the function given by f(x)=1x2 is concave up on the interval [1,2]. Because of this fact, we can see graphically that the line forming the top of each trapezoid lies fully above the curve, and thus the trapezoid rule overestimates the true value of the definite integral. Later in this section we’ll see graphically why this concavity makes the midpoint rule an underestimate.

Subsection 5.9.2 Comparing the Midpoint and Trapezoid Rules

We know from the definition of the definite integral that if we let n be large enough, we can make any of the approximations LEFT(n), RIGHT(n), and MID(n) as close as we’d like (in theory) to the exact value of abf(x)dx. Thus, it may be natural to wonder why we ever use any rule other than LEFT(n) or RIGHT(n) (with a sufficiently large n value) to estimate a definite integral. One of the primary reasons is that as n, Δx=ban0, and thus in a Riemann sum calculation with a large n 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 n. Paying close attention to patterns in errors, such as those observed in Example 5.78, 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.
Figure 5.79. Estimating abf(x) dx 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.79, it is evident that whenever the function is concave up on an interval, the Trapezoid Rule with one subinterval, TRAP(1), 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.79), the resulting trapezoid has the same area as MID(1), and this value is less than the exact value of the definite integral. Thus, when the function is concave up on the interval, MID(1) underestimates the integral’s true value.
Figure 5.80. Comparing the error in estimating abf(x) dx using a single subinterval: in red, the error from the Trapezoid rule; in light red, the error from the Midpoint rule.
The preceding discussion explores how to determine if MID(n) and TRAP(n) are underestimates or overestimates of abf(x)dx if f(x) is concave up. Similar statements can be made when f(x) is concave down. These are summarized next.

Error types when approximating using Midpoint and Trapezoid Rules.

  • If f(x) is concave up on [a,b], then MID(n) underestimates abf(x)dx and TRAP(n) overestimates abf(x)dx.
  • If f(x) is concave down on [a,b], then MID(n) overestimates abf(x)dx and TRAP(n) underestimates abf(x)dx.
Next, we compare the size of the errors between MID(n) and TRAP(n). Again, we focus on MID(1) and TRAP(1) on an interval where the concavity of f is consistent. In Figure 5.80, 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.
If we let f(x)=1x2 and consider 01f(x)dx, we know by the First FTC that the exact value of the integral is
01(1x2)dx=xx33|01=23.
Using appropriate technology to compute MID(4), MID(8), TRAP(4), and TRAP(8), as well as the corresponding errors ERROR(M,4), ERROR(M,8), ERROR(T,4), and ERROR(T,8), as we did in Example 5.78, we find the results summarized in Table 5.81. We also include the approximations and their errors for the example 121x2dx from Example 5.78.
Table 5.81. Calculations of TRAP(4), MID(4), TRAP(8), and MID(8), along with corresponding errors, for the definite integrals 01(1x2) dx and 121x2 dx.
Rule 01(1x2)dx=0.6 error 121x2dx=0.5 error
TRAP(4) 0.65625 0.0104166667 0.5089937642 0.0089937642
MID(4) 0.671875 0.0052083333 0.4955479365 0.0044520635
TRAP(8) 0.6640625 0.0026041667 0.5022708502 0.0022708502
MID(8) 0.66796875 0.0013020833 0.4988674899 0.0011325101
For a given function f and interval [a,b], ERROR(T,4)=abf(x)dxTRAP(4) calculates the difference between the exact value of the definite integral and the approximation generated by the Trapezoid Rule with n=4. If we look at not only ERROR(T,4), but also the other errors generated by using TRAP(n) and MID(n) with n=4 and n=8 in the two examples noted in Table 5.81, 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 TRAP(n) and MID(n) seems closely connected. In particular, the errors generated by the Midpoint Rule seem to be about half the size of those generated by the Trapezoid Rule.
That is, we can observe in both examples that ERROR(M,4)12ERROR(T,4) and ERROR(M,8)12ERROR(T,8). 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,
ERROR(M,n)12ERROR(T,n).
This important relationship suggests a way to combine the Midpoint and Trapezoid Rules to create an even more accurate approximation to a definite integral.

Subsection 5.9.3 Simpson’s Rule

When we first developed the Trapezoid Rule, we observed that it is an average of the Left and Right Riemann sums:
TRAP(n)=12(LEFT(n)+RIGHT(n)).
If a function is always increasing or always decreasing on the interval [a,b], one of LEFT(n) and RIGHT(n) will over-estimate the true value of abf(x)dx, while the other will under-estimate the integral. Thus, the errors found in LEFT(n) and RIGHT(n) will have opposite signs; so averaging LEFT(n) and RIGHT(n) eliminates a considerable amount of the error present in the respective approximations. In a similar way, it makes sense to think about averaging MID(n) and TRAP(n) in order to generate a still more accurate approximation.
We’ve just observed that MID(n) is typically about twice as accurate as TRAP(n). This leads to an approximation method known as Simpson’s Rule
 37 
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.
which is a weighted average of the Midpoint and Trapezoid approximations.

Simpson’s Rule.

The Simpson’s Rule approximation SIMP(2n) of the area abf(x) dx is the weighted average
(5.19)SIMP(2n)=2MID(n)+TRAP(n)3.
where MID(n) and TRAP(n) are the Midpoint and Trapezoid rule approximations using n subintervals.
Note that we use “SIMP(2n)” rather that “SIMP(n)” since the n points the Midpoint Rule uses are different from the n points the Trapezoid Rule uses, and thus Simpson’s Rule is using 2n points at which to evaluate the function. We build upon the results in Table 5.81 to see the approximations generated by Simpson’s Rule. In particular, in Table 5.82, we include all of the results in Table 5.81, but include additional results for SIMP(8)=2MID(4)+TRAP(4)3 and SIMP(16)=2MID(8)+TRAP(8)3.
Table 5.82. Table 5.81 updated to include SIMP(8), SIMP(16), and the corresponding errors.
Rule 01(1x2)dx=0.6 error 121x2dx=0.5 error
TRAP(4) 0.65625 0.0104166667 0.5089937642 0.0089937642
MID(4) 0.671875 0.0052083333 0.4955479365 0.0044520635
SIMP(8) 0.6666666667 0 0.5000298792 0.0000298792
TRAP(8) 0.6640625 0.0026041667 0.5022708502 0.0022708502
MID(8) 0.66796875 0.0013020833 0.4988674899 0.0011325101
SIMP(16) 0.6666666667 0 0.5000019434 0.0000019434
The results seen in Table 5.82 are striking. If we consider the SIMP(16) approximation of 121x2dx, the error is only ERROR(S,16)=0.0000019434. By contrast, LEFT(8)=0.5491458502, so the error of that estimate is ERROR(L,8)=0.0491458502. Moreover, we observe that generating the approximations for Simpson’s Rule is almost no additional work: once we have LEFT(n), RIGHT(n), and MID(n) for a given value of n, it is a simple exercise to generate TRAP(n), and from there to calculate SIMP(2n). Finally, note that the error in the Simpson’s Rule approximations of 01(1x2)dx is zero!
 38 
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 01ex2dx, for which we cannot find an elementary antiderivative of ex2, but also for approximating definite integrals when we are given a function through a table of data.

Example 5.83.

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 v is continuous, always decreasing, and always decreasing at a decreasing rate, as is suggested by the data.
seconds, t Velocity in ft/sec, v(t)
0 100
0.3 99
0.6 96
0.9 90
1.2 80
1.5 50
1.8 0
Table 5.84. Data for the braking car.
Figure 5.85. Axes for plotting the data in Example 5.83.
  1. Plot the given data on the set of axes provided in Figure 5.85 with time on the horizontal axis and the velocity on the vertical axis.
  2. What definite integral will give you the exact distance the car traveled on [0,1.8]?
  3. Estimate the total distance traveled on [0,1.8] by computing LEFT(3), RIGHT(3), and TRAP(3). Which of these under-estimates the true distance traveled?
  4. Estimate the total distance traveled on [0,1.8] by computing MID(3). Is this an over- or under-estimate? Why?
  5. Using your results from (c) and (d), improve your estimate further by using Simpson’s Rule.
  6. What is your best estimate of the average velocity of the car on [0,1.8]? Why? What are the units on this quantity?
Hint.
  1. Plot the data.
  2. What are the units of v(t)Δt?
  3. Recall the standard rules for sums that produce LEFT(3), RIGHT(3), TRAP(3).
  4. Think about concavity to decide if MID(3) is an over- or under-estimate.
  5. Recall how SIMP(3) is a weighted average of TRAP(3) and MID(3).
  6. Simpson’s Rule gives the best estimate for a function of consistent concavity.
Answer.
  1. Plot the data.
  2. 01.8v(t)dt.
  3. LEFT(3)=165.6 ft RIGHT(3)=105.6 ft TRAP(3)=135.6 ft .
    RIGHT(3) and TRAP(3) are underestimates.
  4. MID(3)=143.4 ft  ; overestimate.
  5. SIMP(6)=140.8 ft .
  6. Simpson’s rule gives the best approximation of the distance traveled, 01.8v(t)dt140.8 ft .
Solution.
  1. Plot the data.
  2. Since the velocity is always positive, the definite integral that will give the exact distance traveled by the car on the interval [0,1.8] is
    01.8v(t)dt.
  3. The estimates of 01.8v(t)dt are
    LEFT(3)=165.6 ft RIGHT(3)=105.6 ft TRAP(3)=135.6 ft .
    RIGHT(3) is an underestimate of the distance traveled since v(t) is decreasing. TRAP(3) is an underestimate of the distance traveled since v(t) is concave down.
  4. Another estimate of the distance traveled is
    MID(3)=143.4 ft .
    This is an overestimate since v(t) is concave down.
  5. For Simpson’s Rule, we see that
    SIMP(6)=23MID(3)+13TRAP(3)=140.8 ft .
  6. Simpson’s rule gives the best approximation of the distance traveled since it is a weighted average of the midpoint and trapezoid rules and uses more information about the velocity than the other methods. The units on each of the estimates, including Simpson’s Rule, are "feet", since ft/sec sec = ft. Thus, the best approximation we have generated is that 01.8v(t)dt140.8 ft .

Subsection 5.9.4 Comparing LEFT(n), RIGHT(n), TRAP(n), MID(n), and SIMP(2n).

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 example.

Example 5.86.

Consider the functions f(x)=2x2, g(x)=2x3, and h(x)=2x4, all on the interval [0,1]. For each of the questions that require a numerical answer in what follows, write your answer exactly in fraction form.
  1. On the three sets of axes provided in Figure 5.87, sketch a graph of each function on the interval [0,1], and compute LEFT(1) and RIGHT(1) for each. What do you observe?
  2. Compute MID(1) for each function to approximate 01f(x)dx, 01g(x)dx, and 01h(x)dx, respectively.
  3. Compute TRAP(1) for each of the three functions, and hence compute SIMP(2) for each of the three functions.
  4. Evaluate each of the integrals 01f(x)dx, 01g(x)dx, and 01h(x)dx exactly using the First FTC.
  5. For each of the three functions f, g, and h, compare the results of LEFT(1), RIGHT(1), MID(1), TRAP(1), and SIMP(2) to the true value of the corresponding definite integral. What patterns do you observe?
Figure 5.87. Axes for plotting the functions in Example 5.86.
Hint.
  1. For each estimate, just one function evaluation is needed.
  2. Use the midpoint rule with n=1.
  3. Remember that both the trapezoid and Simpson’s rule can be executed using (weighted) averages of known values.
  4. Find antiderivatives to evaluate the integrals exactly.
  5. Think about trends in over- and under-estimates.
Answer.
  1. For LEFT(1) and TRAP(1):
    Table 5.88. Left and Trapezoid rules.
    f g h
    LEFT(1)=2 LEFT(1)=2 LEFT(1)=2
    RIGHT(1)=1 RIGHT(1)=1 RIGHT(1)=1
    The values of LEFT(1) and RIGHT(1) are the same for all three.
  2. For the MID(1),
    Table 5.89. Midpoint Rule.
    f g h
    MID(1)=74 MID(1)=158 MID(1)=3116
  3. For TRAP(1) and SIMP(2),
    Table 5.90. Trapezoid and Simpson’s Rule.
    f g h
    TRAP(1)=32 TRAP(1)=32 TRAP(1)=32
    SIMP(2)=531.6667 SIMP(2)=74 SIMP(2)=43241.79167
  4. 01f(x)dx=5301g(x)dx=7401h(x)dx=95
  5. Left endpoint rule results are overestimates; right endpoint rules are underestimates; midpoint rules are overestimates; trapezoid rules are underestimates. Simpson’s rule is exact for both f and g, while a slight overestimate of 01h(x)dx.
Solution.
  1. For the left and right endpoint rules, we see that
    Table 5.91. Left and Trapezoid rules.
    f g h
    LEFT(1)=2 LEFT(1)=2 LEFT(1)=2
    RIGHT(1)=1 RIGHT(1)=1 RIGHT(1)=1
    Thus, we observe that despite the fact the functions are all different, the values of LEFT(1) and RIGHT(1) are the same for all three.
  2. For the midpoint rule, we find that
    Table 5.92. Midpoint Rule.
    f g h
    MID(1)=74 MID(1)=158 MID(1)=3116
  3. For the trapezoid rule and Simpson’s rule,
    Table 5.93. Trapezoid and Simpson’s Rule.
    f g h
    TRAP(1)=32 TRAP(1)=32 TRAP(1)=32
    SIMP(2)=531.6667 SIMP(2)=74 SIMP(2)=43241.79167
  4. The exact values of the three definite integrals are
    01f(x)dx=5301g(x)dx=7401h(x)dx=951.6667=1.75=1.8
  5. We observe that each of the left endpoint rule results are overestimates, each of the right endpoint rules are underestimates, each of the midpoint rules are overestimates, and each of the trapezoid rules are underestimates. These results hold because each of the three functions are both decreasing and concave down. For Simpson’s rule, we see that the result is exact for both f and g, while Simpson’s rule is a slight overestimate of 01h(x)dx.
The results seen in Example 5.86 generalize nicely. For instance, if f is decreasing on [a,b], LEFT(n) will overestimate the exact value of abf(x)dx, and if f is concave down on [a,b], MID(n) will overestimate 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 LEFT(n), RIGHT(n), TRAP(n), and MID(n) 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 f on a given interval with a quadratic function that shared three values with the function f. 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 25(5x32x2+7x4)dx, the approximation SIMP(2n) will always be exact, regardless of the value of n. This is just one more piece of evidence that shows how effective Simpson’s Rule is as an approximation tool for estimating definite integrals.
 39 
One reason that Simpson’s Rule is so effective is that SIMP(2n) benefits from using 2n+1 points of data. Because it combines MID(n), which uses n midpoints, and TRAP(n), which uses the n+1 endpoints of the chosen subintervals, SIMP(2n) takes advantage of the maximum amount of information we have when we know function values at the endpoints and midpoints of n subintervals.

Subsection 5.9.5 Summary

  • For a definite integral such as 01ex2dx 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 LEFT(n), RIGHT(n), and MID(n) for one or more chosen values of n.
  • The Trapezoid Rule, which estimates abf(x)dx by using trapezoids, rather than rectangles, can also be viewed as the average of Left and Right Riemann sums. That is, TRAP(n)=LEFT(n)+RIGHT(n)2.
  • 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 SIMP(2n)=2MID(n)+TRAP(n)3, we can build a much more accurate approximation to abf(x)dx by using approximations we have already computed. The rule for SIMP(2n) is known as Simpson’s Rule, which can also be developed by approximating a given continuous function with pieces of quadratic polynomials.
  • By understanding the approximation rule chosen, and the properties of the function (i.e. whether it is increasing or decreasing, or concave up or down on the interval in question), we can say whether the approximation is an over or under-estimate of the actual value.

Exercises 5.9.6 Exercises

1. Various methods for ex numerically.

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.)
(a) What is the exact value of 05exdx?
05exdx=
(b)
Find LEFT(2), RIGHT(2), TRAP(2), MID(2), and SIMP(2); compute the error for each.
LEFT(2) RIGHT(2) TRAP(2) MID(2) SIMP(2)
value
error
(c)
Repeat part (b) with n=4 (instead of n=2).
LEFT(4) RIGHT(4) TRAP(4) MID(4) SIMP(4)
value
error
(d)
For each rule in part (b), as n goes from n=2 to n=4, does the error go down approximately as you would expect? Explain by calculating the ratios of the errors:
Error LEFT(2)/Error LEFT(4) =
Error RIGHT(2)/Error RIGHT(4) =
Error TRAP(2)/Error TRAP(4) =
Error MID(2)/Error MID(4) =
Error SIMP(2)/Error SIMP(4) =
(Be sure that you can explain in words why these do (or don’t) make sense.)

2. Comparison of methods for increasing concave down function.

Using the figure showing f(x) below, order the following approximations to the integral 03f(x)dx and its exact value from smallest to largest.
(Click on the graph for a larger version.)
Enter each of "LEFT(n)", "RIGHT(n)", "TRAP(n)", "MID(n)" and "Exact" in one of the following answer blanks to indicate the correct ordering:
< < < <

3. Comparing accuracy for two similar functions.

Using a fixed number of subdivisions, we approximate the integrals of f and g on the interval shown in the figure below.
(The function f(x) is shown in blue, and g(x) in black; click on the graph to get a larger version.)
For which function, f or g is LEFT more accurate?
  • f
  • g
For which function, f or g is RIGHT more accurate?
  • f
  • g
For which function, f or g is MID more accurate?
  • f
  • g
For which function, f or g is TRAP more accurate?
  • f
  • g

4. Identifying and comparing methods.

Consider the four functions shown below. On the first two, an approximation for abf(x)dx is shown.
1.
2.
3.
4.
(Click on any graph to get a larger version.)
1. For graph number 1, Which integration method is shown?
  • left rule
  • right rule
  • midpoint rule
  • trapezoid rule
Is this method an over- or underestimate?
  • under
  • over
2. For graph number 2, Which integration method is shown?
  • midpoint rule
  • trapezoid rule
  • right rule
  • left rule
Is this method an over- or underestimate?
  • over
  • under
3. On a copy of graph number 3, sketch an estimate with n=2 subdivisions using the midpoint rule.
Is this method an over- or underestimate?
  • over
  • under
4. On a copy of graph number 4, sketch an estimate with n=2 subdivisions using the trapezoid rule.
Is this method an over- or underestimate?
  • under
  • over

5. Identifying types of Riemann sums.

a) The rectangles in the graph below illustrate a
  • left endpoint
  • right endpoint
  • midpoint
Riemann sum for f(x)=x28 on the interval [2,6].
The value of this Riemann sum is , and this Riemann sum is an
  • overestimate of
  • equal to
  • underestimate of
  • there is ambiguity
the area of the region enclosed by y=f(x), the x-axis, and the vertical lines x = 2 and x = 6.
Left endpoint Riemann sum for y=x28 on [2,6]
b) The rectangles in the graph below illustrate a
  • left endpoint
  • right endpoint
  • midpoint
Riemann sum for f(x)=x28 on the interval [2,6].
The value of this Riemann sum is , and this Riemann sum is an
  • overestimate of
  • equal to
  • underestimate of
  • there is ambiguity
the area of the region enclosed by y=f(x), the x-axis, and the vertical lines x = 2 and x = 6.
Right endpoint Riemann sum for y=x28 on [2,6]

6. Identifying types of Riemann sums.

The five rectangles in the graph below illustrate a
  • ???
  • left endpoint
  • right endpoint
  • midpoint
(select a description)
Riemann sum for f(x)=2x on the interval [0,3].
The value of this Riemann sum is .
Riemann sum for y=2x on [0,3]

7. Computing left and right Riemann sums.

On a sketch of y=ex, represent the left Riemann sum with n=2 approximating 12exdx. Write out the terms of the sum, but do not evaluate it:
Sum = +
On another sketch, represent the right Riemann sum with n=2 approximating 12exdx. Write out the terms of the sum, but do not evaluate it:
Sum = +
Which sum is an overestimate?
  • the left Riemann sum
  • the right Riemann sum
  • neither sum
Which sum is an underestimate?
  • the right Riemann sum
  • the left Riemann sum
  • neither sum

8. Trapezoid rule using data from a table.

PTX:ERROR: WeBWorK problem UNL-Problems/Library/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/5_The_Integral/5.5_Net_Change_as_the_Integral_of_a_Rate/5.5.18.pg with seed 265 does not return valid XML It may not be PTX compatible Use -a to halt with returned content

9. Comparing methods and identifying whether each is an overestimate or underestimate.

Consider the definite integral 01xtan(x)dx.
  1. Explain why this integral cannot be evaluated exactly by using either u-substitution or by integrating by parts.
  2. Using appropriate subintervals, compute LEFT(4), RIGHT(4), MID(4), TRAP(4), and SIMP(8).
  3. Which of the approximations in (b) is an over-estimate to the true value of 01xtan(x)dx? Which is an under-estimate? How do you know?

10. Relation of function properties to approximation methods.

For an unknown function f(x), the following information is known.
  • f is continuous on [3,6];
  • f is either always increasing or always decreasing on [3,6];
  • f has the same concavity throughout the interval [3,6];
  • As approximations to TRAP(3)6f(x)dx, LEFT(4)=7.23, RIGHT(4)=6.75, and MID(4)=7.05.
  1. Is f increasing or decreasing on [3,6]? What data tells you?
  2. Is f concave up or concave down on [3,6]? Why?
  3. Determine the best possible estimate you can for TRAP(3)6f(x)dx, based on the given information.

11. Modeling flow rate using an integral and approximating solution.

The rate at which water flows through Table Rock Dam on the White River in Branson, MO, is measured in thousands of cubic feet per second (TCFS). As engineers open the floodgates, flow rates are recorded according to the following chart.
Table 5.94. Water flow data.
seconds, t 0 10 20 30 40 50 60
flow in TCFS, r(t) 2000 2100 2400 3000 3900 5100 6500
  1. 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?
  2. Use the given data to calculate MID(n) for the largest possible value of n to approximate the integral you stated in (a). Do you think MID(n) over- or under-estimates the exact value of the integral? Why?
  3. Approximate the integral stated in (a) by calculating SIMP(n) for the largest possible value of n, based on the given data.
  4. Compute 160SIMP(n) and 2000+2100+2400+3000+3900+5100+65007. What quantity do both of these values estimate? Which is a more accurate approximation?