Skip to Content
OpenStax Logo
Calculus Volume 2

3.6 Numerical Integration

Calculus Volume 23.6 Numerical Integration
Buy book
  1. Preface
  2. 1 Integration
    1. Introduction
    2. 1.1 Approximating Areas
    3. 1.2 The Definite Integral
    4. 1.3 The Fundamental Theorem of Calculus
    5. 1.4 Integration Formulas and the Net Change Theorem
    6. 1.5 Substitution
    7. 1.6 Integrals Involving Exponential and Logarithmic Functions
    8. 1.7 Integrals Resulting in Inverse Trigonometric Functions
    9. Key Terms
    10. Key Equations
    11. Key Concepts
    12. Chapter Review Exercises
  3. 2 Applications of Integration
    1. Introduction
    2. 2.1 Areas between Curves
    3. 2.2 Determining Volumes by Slicing
    4. 2.3 Volumes of Revolution: Cylindrical Shells
    5. 2.4 Arc Length of a Curve and Surface Area
    6. 2.5 Physical Applications
    7. 2.6 Moments and Centers of Mass
    8. 2.7 Integrals, Exponential Functions, and Logarithms
    9. 2.8 Exponential Growth and Decay
    10. 2.9 Calculus of the Hyperbolic Functions
    11. Key Terms
    12. Key Equations
    13. Key Concepts
    14. Chapter Review Exercises
  4. 3 Techniques of Integration
    1. Introduction
    2. 3.1 Integration by Parts
    3. 3.2 Trigonometric Integrals
    4. 3.3 Trigonometric Substitution
    5. 3.4 Partial Fractions
    6. 3.5 Other Strategies for Integration
    7. 3.6 Numerical Integration
    8. 3.7 Improper Integrals
    9. Key Terms
    10. Key Equations
    11. Key Concepts
    12. Chapter Review Exercises
  5. 4 Introduction to Differential Equations
    1. Introduction
    2. 4.1 Basics of Differential Equations
    3. 4.2 Direction Fields and Numerical Methods
    4. 4.3 Separable Equations
    5. 4.4 The Logistic Equation
    6. 4.5 First-order Linear Equations
    7. Key Terms
    8. Key Equations
    9. Key Concepts
    10. Chapter Review Exercises
  6. 5 Sequences and Series
    1. Introduction
    2. 5.1 Sequences
    3. 5.2 Infinite Series
    4. 5.3 The Divergence and Integral Tests
    5. 5.4 Comparison Tests
    6. 5.5 Alternating Series
    7. 5.6 Ratio and Root Tests
    8. Key Terms
    9. Key Equations
    10. Key Concepts
    11. Chapter Review Exercises
  7. 6 Power Series
    1. Introduction
    2. 6.1 Power Series and Functions
    3. 6.2 Properties of Power Series
    4. 6.3 Taylor and Maclaurin Series
    5. 6.4 Working with Taylor Series
    6. Key Terms
    7. Key Equations
    8. Key Concepts
    9. Chapter Review Exercises
  8. 7 Parametric Equations and Polar Coordinates
    1. Introduction
    2. 7.1 Parametric Equations
    3. 7.2 Calculus of Parametric Curves
    4. 7.3 Polar Coordinates
    5. 7.4 Area and Arc Length in Polar Coordinates
    6. 7.5 Conic Sections
    7. Key Terms
    8. Key Equations
    9. Key Concepts
    10. Chapter Review Exercises
  9. A | Table of Integrals
  10. B | Table of Derivatives
  11. C | Review of Pre-Calculus
  12. Answer Key
    1. Chapter 1
    2. Chapter 2
    3. Chapter 3
    4. Chapter 4
    5. Chapter 5
    6. Chapter 6
    7. Chapter 7
  13. Index

Learning Objectives

  • 3.6.1. Approximate the value of a definite integral by using the midpoint and trapezoidal rules.
  • 3.6.2. Determine the absolute and relative error in using a numerical integration technique.
  • 3.6.3. Estimate the absolute and relative error using an error-bound formula.
  • 3.6.4. Recognize when the midpoint and trapezoidal rules over- or underestimate the true value of an integral.
  • 3.6.5. Use Simpson’s rule to approximate the value of a definite integral to a given accuracy.

The antiderivatives of many functions either cannot be expressed or cannot be expressed easily in closed form (that is, in terms of known functions). Consequently, rather than evaluate definite integrals of these functions directly, we resort to various techniques of numerical integration to approximate their values. In this section we explore several of these techniques. In addition, we examine the process of estimating the error in using these techniques.

The Midpoint Rule

Earlier in this text we defined the definite integral of a function over an interval as the limit of Riemann sums. In general, any Riemann sum of a function f(x)f(x) over an interval [a,b][a,b] may be viewed as an estimate of abf(x)dx.abf(x)dx. Recall that a Riemann sum of a function f(x)f(x) over an interval [a,b][a,b] is obtained by selecting a partition

P={x0,x1,x2,…,xn},wherea=x0<x1<x2<<xn=bP={x0,x1,x2,…,xn},wherea=x0<x1<x2<<xn=b

and a set

S={x1*,x2*,…,xn*},wherexi1xi*xifor alli.S={x1*,x2*,…,xn*},wherexi1xi*xifor alli.

The Riemann sum corresponding to the partition PP and the set SS is given by i=1nf(xi*)Δxi,i=1nf(xi*)Δxi, where Δxi=xixi1,Δxi=xixi1, the length of the ith subinterval.

The midpoint rule for estimating a definite integral uses a Riemann sum with subintervals of equal width and the midpoints, mi,mi, of each subinterval in place of xi*.xi*. Formally, we state a theorem regarding the convergence of the midpoint rule as follows.

Theorem 3.3

The Midpoint Rule

Assume that f(x)f(x) is continuous on [a,b].[a,b]. Let n be a positive integer and Δx=ban.Δx=ban. If [a,b][a,b] is divided into nn subintervals, each of length Δx,Δx, and mimi is the midpoint of the ith subinterval, set

Mn=i=1nf(mi)Δx.Mn=i=1nf(mi)Δx.
3.10

Then limnMn=abf(x)dx.limnMn=abf(x)dx.

As we can see in Figure 3.13, if f(x)0f(x)0 over [a,b],[a,b], then i=1nf(mi)Δxi=1nf(mi)Δx corresponds to the sum of the areas of rectangles approximating the area between the graph of f(x)f(x) and the x-axis over [a,b].[a,b]. The graph shows the rectangles corresponding to M4M4 for a nonnegative function over a closed interval [a,b].[a,b].

This figure is a graph of a non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. Beginning on the x-axis at the point labeled a = x sub 0, there are rectangles shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of msub1, x sub 1, m sub 2, x sub 2, m sub 3, x sub 3, m sub 4 and b = x sub 4.
Figure 3.13 The midpoint rule approximates the area between the graph of f(x)f(x) and the x-axis by summing the areas of rectangles with midpoints that are points on f(x).f(x).

Example 3.39

Using the Midpoint Rule with M4M4

Use the midpoint rule to estimate 01x2dx01x2dx using four subintervals. Compare the result with the actual value of this integral.

Solution

Each subinterval has length Δx=104=14.Δx=104=14. Therefore, the subintervals consist of

[0,14],[14,12],[12,34],and[34,1].[0,14],[14,12],[12,34],and[34,1].

The midpoints of these subintervals are {18,38,58,78}.{18,38,58,78}. Thus,

M4=14f(18)+14f(38)+14f(58)+14f(78)=14·164+14·964+14·2564+14·2164=2164.M4=14f(18)+14f(38)+14f(58)+14f(78)=14·164+14·964+14·2564+14·2164=2164.

Since

01x2dx=13and|132164|=11920.0052,01x2dx=13and|132164|=11920.0052,

we see that the midpoint rule produces an estimate that is somewhat close to the actual value of the definite integral.

Example 3.40

Using the Midpoint Rule with M6M6

Use M6M6 to estimate the length of the curve y=12x2y=12x2 on [1,4].[1,4].

Solution

The length of y=12x2y=12x2 on [1,4][1,4] is

141+(dydx)2dx.141+(dydx)2dx.

Since dydx=x,dydx=x, this integral becomes 141+x2dx.141+x2dx.

If [1,4][1,4] is divided into six subintervals, then each subinterval has length Δx=416=12Δx=416=12 and the midpoints of the subintervals are {54,74,94,114,134,154}.{54,74,94,114,134,154}. If we set f(x)=1+x2,f(x)=1+x2,

M6=12f(54)+12f(74)+12f(94)+12f(114)+12f(134)+12f(154)12(1.6008+2.0156+2.4622+2.9262+3.4004+3.8810)=8.1431.M6=12f(54)+12f(74)+12f(94)+12f(114)+12f(134)+12f(154)12(1.6008+2.0156+2.4622+2.9262+3.4004+3.8810)=8.1431.
Checkpoint 3.22

Use the midpoint rule with n=2n=2 to estimate 121xdx.121xdx.

The Trapezoidal Rule

We can also approximate the value of a definite integral by using trapezoids rather than rectangles. In Figure 3.14, the area beneath the curve is approximated by trapezoids rather than by rectangles.

This figure is a graph of a non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. Beginning on the x-axis at the point labeled a = x sub 0, there are trapezoids shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of a = x sub 0, x sub 1, x sub 2, x sub 3, and b = x sub 4.
Figure 3.14 Trapezoids may be used to approximate the area under a curve, hence approximating the definite integral.

The trapezoidal rule for estimating definite integrals uses trapezoids rather than rectangles to approximate the area under a curve. To gain insight into the final form of the rule, consider the trapezoids shown in Figure 3.14. We assume that the length of each subinterval is given by Δx.Δx. First, recall that the area of a trapezoid with a height of h and bases of length b1b1 and b2b2 is given by Area=12h(b1+b2).Area=12h(b1+b2). We see that the first trapezoid has a height ΔxΔx and parallel bases of length f(x0)f(x0) and f(x1).f(x1). Thus, the area of the first trapezoid in Figure 3.14 is

12Δx(f(x0)+f(x1)).12Δx(f(x0)+f(x1)).

The areas of the remaining three trapezoids are

12Δx(f(x1)+f(x2)),12Δx(f(x2)+f(x3)),and12Δx(f(x3)+f(x4)).12Δx(f(x1)+f(x2)),12Δx(f(x2)+f(x3)),and12Δx(f(x3)+f(x4)).

Consequently,

abf(x)dx12Δx(f(x0)+f(x1))+12Δx(f(x1)+f(x2))+12Δx(f(x2)+f(x3))+12Δx(f(x3)+f(x4)).abf(x)dx12Δx(f(x0)+f(x1))+12Δx(f(x1)+f(x2))+12Δx(f(x2)+f(x3))+12Δx(f(x3)+f(x4)).

After taking out a common factor of 12Δx12Δx and combining like terms, we have

abf(x)dx12Δx(f(x0)+2f(x1)+2f(x2)+2f(x3)+f(x4)).abf(x)dx12Δx(f(x0)+2f(x1)+2f(x2)+2f(x3)+f(x4)).

Generalizing, we formally state the following rule.

Theorem 3.4

The Trapezoidal Rule

Assume that f(x)f(x) is continuous over [a,b].[a,b]. Let n be a positive integer and Δx=ban.Δx=ban. Let [a,b][a,b] be divided into nn subintervals, each of length Δx,Δx, with endpoints at P={x0,x1,x2,xn}.P={x0,x1,x2,xn}. Set

Tn=12Δx(f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)).Tn=12Δx(f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)).
3.11

Then, limn+Tn=abf(x)dx.limn+Tn=abf(x)dx.

Before continuing, let’s make a few observations about the trapezoidal rule. First of all, it is useful to note that

Tn=12(Ln+Rn)whereLn=i=1nf(xi1)ΔxandRn=i=1nf(xi)Δx.Tn=12(Ln+Rn)whereLn=i=1nf(xi1)ΔxandRn=i=1nf(xi)Δx.

That is, LnLn and RnRn approximate the integral using the left-hand and right-hand endpoints of each subinterval, respectively. In addition, a careful examination of Figure 3.15 leads us to make the following observations about using the trapezoidal rules and midpoint rules to estimate the definite integral of a nonnegative function. The trapezoidal rule tends to overestimate the value of a definite integral systematically over intervals where the function is concave up and to underestimate the value of a definite integral systematically over intervals where the function is concave down. On the other hand, the midpoint rule tends to average out these errors somewhat by partially overestimating and partially underestimating the value of the definite integral over these same types of intervals. This leads us to hypothesize that, in general, the midpoint rule tends to be more accurate than the trapezoidal rule.

This figure has two graphs, both of the same non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. The first graph, beginning on the x-axis at the point labeled a = x sub 0, there are trapezoids shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of a = x sub 0, xsub1, x sub 2, x sub 3, and b = x sub 4. The second graph has on the x-axis at the point labeled a = x sub 0. There are rectangles shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of m sub 1, x sub 1, m sub 2, x sub 2, m sub 3, x sub 3, m sub 4 and b = x sub 4.
Figure 3.15 The trapezoidal rule tends to be less accurate than the midpoint rule.

Example 3.41

Using the Trapezoidal Rule

Use the trapezoidal rule to estimate 01x2dx01x2dx using four subintervals.

Solution

The endpoints of the subintervals consist of elements of the set P={0,14,12,34,1}P={0,14,12,34,1} and Δx=104=14.Δx=104=14. Thus,

01x2dx12·14(f(0)+2f(14)+2f(12)+2f(34)+f(1))=18(0+2·116+2·14+2·916+1)=1132.01x2dx12·14(f(0)+2f(14)+2f(12)+2f(34)+f(1))=18(0+2·116+2·14+2·916+1)=1132.
Checkpoint 3.23

Use the trapezoidal rule with n=2n=2 to estimate 121xdx.121xdx.

Absolute and Relative Error

An important aspect of using these numerical approximation rules consists of calculating the error in using them for estimating the value of a definite integral. We first need to define absolute error and relative error.

Definition

If BB is our estimate of some quantity having an actual value of A,A, then the absolute error is given by |AB|.|AB|. The relative error is the error as a percentage of the absolute value and is given by |ABA|=|ABA|·100%.|ABA|=|ABA|·100%.

Example 3.42

Calculating Error in the Midpoint Rule

Calculate the absolute and relative error in the estimate of 01x2dx01x2dx using the midpoint rule, found in Example 3.39.

Solution

The calculated value is 01x2dx=1301x2dx=13 and our estimate from the example is M4=2164.M4=2164. Thus, the absolute error is given by |(13)(2164)|=11920.0052.|(13)(2164)|=11920.0052. The relative error is

1/1921/3=1640.0156251.6%.1/1921/3=1640.0156251.6%.

Example 3.43

Calculating Error in the Trapezoidal Rule

Calculate the absolute and relative error in the estimate of 01x2dx01x2dx using the trapezoidal rule, found in Example 3.41.

Solution

The calculated value is 01x2dx=1301x2dx=13 and our estimate from the example is T4=1132.T4=1132. Thus, the absolute error is given by |131132|=1960.0104.|131132|=1960.0104. The relative error is given by

1/961/3=0.031253.1%.1/961/3=0.031253.1%.
Checkpoint 3.24

In an earlier checkpoint, we estimated 121xdx121xdx to be 24352435 using T2.T2. The actual value of this integral is ln2.ln2. Using 24350.685724350.6857 and ln20.6931,ln20.6931, calculate the absolute error and the relative error.

In the two previous examples, we were able to compare our estimate of an integral with the actual value of the integral; however, we do not typically have this luxury. In general, if we are approximating an integral, we are doing so because we cannot compute the exact value of the integral itself easily. Therefore, it is often helpful to be able to determine an upper bound for the error in an approximation of an integral. The following theorem provides error bounds for the midpoint and trapezoidal rules. The theorem is stated without proof.

Theorem 3.5

Error Bounds for the Midpoint and Trapezoidal Rules

Let f(x)f(x) be a continuous function over [a,b],[a,b], having a second derivative f(x)f(x) over this interval. If MM is the maximum value of |f(x)||f(x)| over [a,b],[a,b], then the upper bounds for the error in using MnMn and TnTn to estimate abf(x)dxabf(x)dx are

Error inMnM(ba)324n2Error inMnM(ba)324n2
3.12

and

Error inTnM(ba)312n2.Error inTnM(ba)312n2.
3.13

We can use these bounds to determine the value of nn necessary to guarantee that the error in an estimate is less than a specified value.

Example 3.44

Determining the Number of Intervals to Use

What value of nn should be used to guarantee that an estimate of 01ex2dx01ex2dx is accurate to within 0.01 if we use the midpoint rule?

Solution

We begin by determining the value of M,M, the maximum value of |f(x)||f(x)| over [0,1][0,1] for f(x)=ex2.f(x)=ex2. Since f(x)=2xex2,f(x)=2xex2, we have

f(x)=2ex2+4x2ex2.f(x)=2ex2+4x2ex2.

Thus,

|f(x)|=2ex2(1+2x2)2·e·3=6e.|f(x)|=2ex2(1+2x2)2·e·3=6e.

From the error-bound Equation 3.12, we have

Error inMnM(ba)324n26e(10)324n2=6e24n2.Error inMnM(ba)324n26e(10)324n2=6e24n2.

Now we solve the following inequality for n:n:

6e24n20.01.6e24n20.01.

Thus, n600e248.24.n600e248.24. Since nn must be an integer satisfying this inequality, a choice of n=9n=9 would guarantee that |01ex2dxMn|<0.01.|01ex2dxMn|<0.01.

Analysis

We might have been tempted to round 8.248.24 down and choose n=8,n=8, but this would be incorrect because we must have an integer greater than or equal to 8.24.8.24. We need to keep in mind that the error estimates provide an upper bound only for the error. The actual estimate may, in fact, be a much better approximation than is indicated by the error bound.

Checkpoint 3.25

Use Equation 3.13 to find an upper bound for the error in using M4M4 to estimate 01x2dx.01x2dx.

Simpson’s Rule

With the midpoint rule, we estimated areas of regions under curves by using rectangles. In a sense, we approximated the curve with piecewise constant functions. With the trapezoidal rule, we approximated the curve by using piecewise linear functions. What if we were, instead, to approximate a curve using piecewise quadratic functions? With Simpson’s rule, we do just this. We partition the interval into an even number of subintervals, each of equal width. Over the first pair of subintervals we approximate x0x2f(x)dxx0x2f(x)dx with x0x2p(x)dx,x0x2p(x)dx, where p(x)=Ax2+Bx+Cp(x)=Ax2+Bx+C is the quadratic function passing through (x0,f(x0)),(x0,f(x0)), (x1,f(x1)),(x1,f(x1)), and (x2,f(x2))(x2,f(x2)) (Figure 3.16). Over the next pair of subintervals we approximate x2x4f(x)dxx2x4f(x)dx with the integral of another quadratic function passing through (x2,f(x2)),(x2,f(x2)), (x3,f(x3)),(x3,f(x3)), and (x4,f(x4)).(x4,f(x4)). This process is continued with each successive pair of subintervals.

This figure has two graphs, both of the same non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. The first graph, beginning on the x-axis at the point labeled x sub 0, there are trapezoids shaded whose heights are represented by the function p(x), which is a curve following an approximate path of the original graph. The x-axis is scaled by increments of x sub 0, x sub 1, x sub 2. The second graph has on the x-axis at the point labeled x sub 0. There are shaded regions under the curve, divided by x sub 0, x sub 1, x sub 2, x sub 3, and x sub 4. The curve is sectioned into two different parts above the shaded areas. These two parts are labeled p sub 1(x) and p sub 2(x).
Figure 3.16 With Simpson’s rule, we approximate a definite integral by integrating a piecewise quadratic function.

To understand the formula that we obtain for Simpson’s rule, we begin by deriving a formula for this approximation over the first two subintervals. As we go through the derivation, we need to keep in mind the following relationships:

f(x0)=p(x0)=Ax02+Bx0+Cf(x1)=p(x1)=Ax12+Bx1+Cf(x2)=p(x2)=Ax22+Bx2+Cf(x0)=p(x0)=Ax02+Bx0+Cf(x1)=p(x1)=Ax12+Bx1+Cf(x2)=p(x2)=Ax22+Bx2+C

x2x0=2Δx,x2x0=2Δx, where ΔxΔx is the length of a subinterval.

x2+x0=2x1,sincex1=(x2+x0)2.x2+x0=2x1,sincex1=(x2+x0)2.

Thus,

x0x2f(x)dxx0x2p(x)dx=x0x2(Ax2+Bx+C)dx=A3x3+B2x2+Cx|x2x0Find the antiderivative.=A3(x23x03)+B2(x22x02)+C(x2x0)Evaluate the antiderivative.=A3(x2x0)(x22+x2x0+x02)+B2(x2x0)(x2+x0)+C(x2x0)=x2x06(2A(x22+x2x0+x02)+3B(x2+x0)+6C)Factor outx2x06.=Δx3((Ax22+Bx2+C)+(Ax02+Bx0+C)+A(x22+2x2x0+x02)+2B(x2+x0)+4C)=Δx3(f(x2)+f(x0)+A(x2+x0)2+2B(x2+x0)+4C)Rearrange the terms.Factor and substitute.f(x2)=Ax22+Bx2+Candf(x0)=Ax02+Bx0+C.=Δx3(f(x2)+f(x0)+A(2x1)2+2B(2x1)+4C)Substitutex2+x0=2x1.=Δx3(f(x2)+4f(x1)+f(x0)).Expand and substitutef(x1)=Ax12+Bx1+.x0x2f(x)dxx0x2p(x)dx=x0x2(Ax2+Bx+C)dx=A3x3+B2x2+Cx|x2x0Find the antiderivative.=A3(x23x03)+B2(x22x02)+C(x2x0)Evaluate the antiderivative.=A3(x2x0)(x22+x2x0+x02)+B2(x2x0)(x2+x0)+C(x2x0)=x2x06(2A(x22+x2x0+x02)+3B(x2+x0)+6C)Factor outx2x06.=Δx3((Ax22+Bx2+C)+(Ax02+Bx0+C)+A(x22+2x2x0+x02)+2B(x2+x0)+4C)=Δx3(f(x2)+f(x0)+A(x2+x0)2+2B(x2+x0)+4C)Rearrange the terms.Factor and substitute.f(x2)=Ax22+Bx2+Candf(x0)=Ax02+Bx0+C.=Δx3(f(x2)+f(x0)+A(2x1)2+2B(2x1)+4C)Substitutex2+x0=2x1.=Δx3(f(x2)+4f(x1)+f(x0)).Expand and substitutef(x1)=Ax12+Bx1+.

If we approximate x2x4f(x)dxx2x4f(x)dx using the same method, we see that we have

x0x4f(x)dxΔx3(f(x4)+4f(x3)+f(x2)).x0x4f(x)dxΔx3(f(x4)+4f(x3)+f(x2)).

Combining these two approximations, we get

x0x4f(x)dx=Δx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+f(x4)).x0x4f(x)dx=Δx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+f(x4)).

The pattern continues as we add pairs of subintervals to our approximation. The general rule may be stated as follows.

Theorem 3.6

Simpson’s Rule

Assume that f(x)f(x) is continuous over [a,b].[a,b]. Let n be a positive even integer and Δx=ban.Δx=ban. Let [a,b][a,b] be divided into nn subintervals, each of length Δx,Δx, with endpoints at P={x0,x1,x2,…,xn}.P={x0,x1,x2,…,xn}. Set

Sn=Δx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)++2f(xn2)+4f(xn1)+f(xn)).Sn=Δx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)++2f(xn2)+4f(xn1)+f(xn)).
3.14

Then,

limn+Sn=abf(x)dx.limn+Sn=abf(x)dx.

Just as the trapezoidal rule is the average of the left-hand and right-hand rules for estimating definite integrals, Simpson’s rule may be obtained from the midpoint and trapezoidal rules by using a weighted average. It can be shown that S2n=(23)Mn+(13)Tn.S2n=(23)Mn+(13)Tn.

It is also possible to put a bound on the error when using Simpson’s rule to approximate a definite integral. The bound in the error is given by the following rule:

Rule: Error Bound for Simpson’s Rule

Let f(x)f(x) be a continuous function over [a,b][a,b] having a fourth derivative, f(4)(x),f(4)(x), over this interval. If MM is the maximum value of |f(4)(x)||f(4)(x)| over [a,b],[a,b], then the upper bound for the error in using SnSn to estimate abf(x)dxabf(x)dx is given by

Error inSnM(ba)5180n4.Error inSnM(ba)5180n4.
3.15

Example 3.45

Applying Simpson’s Rule 1

Use S2S2 to approximate 01x3dx.01x3dx. Estimate a bound for the error in S2.S2.

Solution

Since [0,1][0,1] is divided into two intervals, each subinterval has length Δx=102=12.Δx=102=12. The endpoints of these subintervals are {0,12,1}.{0,12,1}. If we set f(x)=x3,f(x)=x3, then

S4=13·12(f(0)+4f(12)+f(1))=16(0+4·18+1)=14.S4=13·12(f(0)+4f(12)+f(1))=16(0+4·18+1)=14. Since f(4)(x)=0f(4)(x)=0 and consequently M=0,M=0, we see that

Error inS20(1)518024=0.Error inS20(1)518024=0.

This bound indicates that the value obtained through Simpson’s rule is exact. A quick check will verify that, in fact, 01x3dx=14.01x3dx=14.

Example 3.46

Applying Simpson’s Rule 2

Use S6S6 to estimate the length of the curve y=12x2y=12x2 over [1,4].[1,4].

Solution

The length of y=12x2y=12x2 over [1,4][1,4] is 141+x2dx.141+x2dx. If we divide [1,4][1,4] into six subintervals, then each subinterval has length Δx=416=12,Δx=416=12, and the endpoints of the subintervals are {1,32,2,52,3,72,4}.{1,32,2,52,3,72,4}. Setting f(x)=1+x2,f(x)=1+x2,

S6=13·12(f(1)+4f(32)+2f(2)+4f(52)+2f(3)+4f(72)+f(4)).S6=13·12(f(1)+4f(32)+2f(2)+4f(52)+2f(3)+4f(72)+f(4)).

After substituting, we have

S6=16(1.4142+4·1.80278+2·2.23607+4·2.69258+2·3.16228+4·3.64005+4.12311)8.14594.S6=16(1.4142+4·1.80278+2·2.23607+4·2.69258+2·3.16228+4·3.64005+4.12311)8.14594.
Checkpoint 3.26

Use S2S2 to estimate 121xdx.121xdx.

Section 3.6 Exercises

Approximate the following integrals using either the midpoint rule, trapezoidal rule, or Simpson’s rule as indicated. (Round answers to three decimal places.)

299.

12dxx;12dxx; trapezoidal rule; n=5n=5

300.

034+x3dx;034+x3dx; trapezoidal rule; n=6n=6

301.

034+x3dx;034+x3dx; Simpson’s rule; n=3n=3

302.

012x2dx;012x2dx; midpoint rule; n=6n=6

303.

01sin2(πx)dx;01sin2(πx)dx; midpoint rule; n=3n=3

304.

Use the midpoint rule with eight subdivisions to estimate 24x2dx.24x2dx.

305.

Use the trapezoidal rule with four subdivisions to estimate 24x2dx.24x2dx.

306.

Find the exact value of 24x2dx.24x2dx. Find the error of approximation between the exact value and the value calculated using the trapezoidal rule with four subdivisions. Draw a graph to illustrate.

Approximate the integral to three decimal places using the indicated rule.

307.

01sin2(πx)dx;01sin2(πx)dx; trapezoidal rule; n=6n=6

308.

0311+x3dx;0311+x3dx; trapezoidal rule; n=6n=6

309.

0311+x3dx;0311+x3dx; Simpson’s rule; n=3n=3

310.

00.8ex2dx;00.8ex2dx; trapezoidal rule; n=4n=4

311.

00.8ex2dx;00.8ex2dx; Simpson’s rule; n=4n=4

312.

00.4sin(x2)dx;00.4sin(x2)dx; trapezoidal rule; n=4n=4

313.

00.4sin(x2)dx;00.4sin(x2)dx; Simpson’s rule; n=4n=4

314.

0.10.5cosxxdx;0.10.5cosxxdx; trapezoidal rule; n=4n=4

315.

0.10.5cosxxdx;0.10.5cosxxdx; Simpson’s rule; n=4n=4

316.

Evaluate 01dx1+x201dx1+x2 exactly and show that the result is π/4.π/4. Then, find the approximate value of the integral using the trapezoidal rule with n=4n=4 subdivisions. Use the result to approximate the value of π.π.

317.

Approximate 241lnxdx241lnxdx using the midpoint rule with four subdivisions to four decimal places.

318.

Approximate 241lnxdx241lnxdx using the trapezoidal rule with eight subdivisions to four decimal places.

319.

Use the trapezoidal rule with four subdivisions to estimate 00.8x3dx00.8x3dx to four decimal places.

320.

Use the trapezoidal rule with four subdivisions to estimate 00.8x3dx.00.8x3dx. Compare this value with the exact value and find the error estimate.

321.

Using Simpson’s rule with four subdivisions, find 0π/2cos(x)dx.0π/2cos(x)dx.

322.

Show that the exact value of 01xexdx=12e.01xexdx=12e. Find the absolute error if you approximate the integral using the midpoint rule with 16 subdivisions.

323.

Given 01xexdx=12e,01xexdx=12e, use the trapezoidal rule with 16 subdivisions to approximate the integral and find the absolute error.

324.

Find an upper bound for the error in estimating 03(5x+4)dx03(5x+4)dx using the trapezoidal rule with six steps.

325.

Find an upper bound for the error in estimating 451(x1)2dx451(x1)2dx using the trapezoidal rule with seven subdivisions.

326.

Find an upper bound for the error in estimating 03(6x21)dx03(6x21)dx using Simpson’s rule with n=10n=10 steps.

327.

Find an upper bound for the error in estimating 251x1dx251x1dx using Simpson’s rule with n=10n=10 steps.

328.

Find an upper bound for the error in estimating 0π2xcos(x)dx0π2xcos(x)dx using Simpson’s rule with four steps.

329.

Estimate the minimum number of subintervals needed to approximate the integral 14(5x2+8)dx14(5x2+8)dx with an error magnitude of less than 0.0001 using the trapezoidal rule.

330.

Determine a value of n such that the trapezoidal rule will approximate 011+x2dx011+x2dx with an error of no more than 0.01.

331.

Estimate the minimum number of subintervals needed to approximate the integral 23(2x3+4x)dx23(2x3+4x)dx with an error of magnitude less than 0.0001 using the trapezoidal rule.

332.

Estimate the minimum number of subintervals needed to approximate the integral 341(x1)2dx341(x1)2dx with an error magnitude of less than 0.0001 using the trapezoidal rule.

333.

Use Simpson’s rule with four subdivisions to approximate the area under the probability density function y=12πex2/2y=12πex2/2 from x=0x=0 to x=0.4.x=0.4.

334.

Use Simpson’s rule with n=14n=14 to approximate (to three decimal places) the area of the region bounded by the graphs of y=0,y=0, x=0,x=0, and x=π/2.x=π/2.

335.

The length of one arch of the curve y=3sin(2x)y=3sin(2x) is given by L=0π/21+36cos2(2x)dx.L=0π/21+36cos2(2x)dx. Estimate L using the trapezoidal rule with n=6.n=6.

336.

The length of the ellipse x=acos(t),y=bsin(t),0t2πx=acos(t),y=bsin(t),0t2π is given by L=4a0π/21e2cos2(t)dt,L=4a0π/21e2cos2(t)dt, where e is the eccentricity of the ellipse. Use Simpson’s rule with n=6n=6 subdivisions to estimate the length of the ellipse when a=2a=2 and e=1/3.e=1/3.

337.

Estimate the area of the surface generated by revolving the curve y=cos(2x),0xπ4y=cos(2x),0xπ4 about the x-axis. Use the trapezoidal rule with six subdivisions.

338.

Estimate the area of the surface generated by revolving the curve y=2x2,y=2x2, 0x30x3 about the x-axis. Use Simpson’s rule with n=6.n=6.

339.

The growth rate of a certain tree (in feet) is given by y=2t+1+et2/2,y=2t+1+et2/2, where t is time in years. Estimate the growth of the tree through the end of the second year by using Simpson’s rule, using two subintervals. (Round the answer to the nearest hundredth.)

340.

[T] Use a calculator to approximate 01sin(πx)dx01sin(πx)dx using the midpoint rule with 25 subdivisions. Compute the relative error of approximation.

341.

[T] Given 15(3x22x)dx=100,15(3x22x)dx=100, approximate the value of this integral using the midpoint rule with 16 subdivisions and determine the absolute error.

342.

Given that we know the Fundamental Theorem of Calculus, why would we want to develop numerical methods for definite integrals?

343.

The table represents the coordinates (x,y)(x,y) that give the boundary of a lot. The units of measurement are meters. Use the trapezoidal rule to estimate the number of square meters of land that is in this lot.

x y x y
0 125 600 95
100 125 700 88
200 120 800 75
300 112 900 35
400 90 1000 0
500 90
344.

Choose the correct answer. When Simpson’s rule is used to approximate the definite integral, it is necessary that the number of partitions be____

  1. an even number
  2. odd number
  3. either an even or an odd number
  4. a multiple of 4
345.

The “Simpson” sum is based on the area under a ____.

346.

The error formula for Simpson’s rule depends on___.

  1. f(x)f(x)
  2. f(x)f(x)
  3. f(4)(x)f(4)(x)
  4. the number of steps
Citation/Attribution

Want to cite, share, or modify this book? This book is Creative Commons Attribution-NonCommercial-ShareAlike License 4.0 and you must attribute OpenStax.

Attribution information
  • If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:
    Access for free at https://openstax.org/books/calculus-volume-2/pages/1-introduction
  • If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:
    Access for free at https://openstax.org/books/calculus-volume-2/pages/1-introduction
Citation information

© Mar 30, 2016 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License 4.0 license. The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.