Processing math: 100%

EXAMPLE 1Approximating π0sinxdx Using the Trapezoidal Rule

  1. (a) Use the Trapezoidal Rule with n=4 and n=6 to approximate π0sinxdx, rounded to three decimal places.
  2. (b) Compare each approximation to the exact value of π0sinxdx.

Solution  (a) We partition the interval [0,π] into four subintervals, each of width Δx=π04=π4. [0,π4][π4,π2][π2,3π4][3π4,π]

510

The values of f(x)=sinx corresponding to each endpoint are f(0)=0f(π4)=22f(π2)=1f(3π4)=22f(π)=0

See Figure 14. Now we use the Trapezoidal Rule: π0sinxdxπ024[sin(0)+2sin(π4)+2sin(π2)+2sin(3π4)+sin(π)]=π8[0+2(22)+2(1)+2(22)+0]=π8(2+22)=π4(1+2)1.896

Figure 14 n=4.

To approximate π0sinxdx using six subintervals, we partition [0,π] into six subintervals, each of width Δx=π06=π6, namely, [0,π6][π6,π3][π3,π2][π2,2π3][2π3,5π6][5π6,π]

See Figure 15. Then we use the Trapezoidal Rule. π0sinxdxπ26[0+212+232+21+232+212+0]=π12(4+23)=π6(2+3)1.954

Figure 15 n=6.

(b) The exact value of the integral is π0sinxdx=[cosx]π0=cosπ+cos0=1+1=2

The approximation using the Trapezoidal Rule with four subintervals underestimates the integral by 0.104. The approximation using six subintervals underestimates the integral by 0.046. Notice that the approximation using six subintervals is more accurate than the approximation using four subintervals.