Skip to main content ?

Section 7.10 : Approximating Definite Integrals

3. Using \(n = 8\) approximate the value of \(\displaystyle \int_{0}^{4}{{\cos \left( {1 + \sqrt x } \right)\,dx}}\) using

  1. the Midpoint Rule,
  2. the Trapezoid Rule, and
  3. Simpson’s Rule.

Use at least 6 decimal places of accuracy for your work.

Show All Solutions Hide All Solutions

a Midpoint Rule Show Solution

While it’s not really needed to do the problem here is a sketch of the graph.

The graph of \(\cos \left( {1 + \sqrt x } \right)\) on the interval \(\left[ {0,4} \right]\).  The graph starts at about 0.54, drops steeply and crosses the x-axis just after \(x = 0\), then continues decreasing more and more slowly down to about -1 at the right end.  The nine points that divide the interval into 8 subintervals are marked along the x-axis.

We know that we need to divide the interval \(\left[ {0,4} \right]\) into 8 subintervals each with width,

\[\Delta x = \frac{{4 - 0}}{8} = \frac{1}{2}\]

The endpoints of each of these subintervals are represented by the dots on the \(x\) axis on the graph above.

The tick marks between each dot represents the midpoint of each of the subintervals. The \(x\)-values of the midpoints for each of the subintervals are then,

\[\frac{1}{4},\hspace{0.25in}\frac{3}{4},\hspace{0.25in}\frac{5}{4},\hspace{0.25in}\frac{7}{4},\hspace{0.25in}\frac{9}{4},\hspace{0.25in}\frac{{11}}{4},\hspace{0.25in}\frac{{13}}{4},\hspace{0.25in}\frac{{15}}{4}\]

So, to use the Midpoint Rule to approximate the value of the integral all we need to do is plug into the formula. Doing this gives,

\[\begin{align*}\int_{0}^{4}{{\cos \left( {1 + \sqrt x } \right)\,dx}} & \approx \left( {\frac{1}{2}} \right)\left[ {f\left( {\frac{1}{4}} \right) + f\left( {\frac{3}{4}} \right) + f\left( {\frac{5}{4}} \right) + f\left( {\frac{7}{4}} \right) + f\left( {\frac{9}{4}} \right) + } \right.f\left( {\frac{{11}}{4}} \right) + \\ & \hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\left. {f\left( {\frac{{13}}{4}} \right) + f\left( {\frac{{15}}{4}} \right)} \right]\\ & = \require{bbox} \bbox[2pt,border:1px solid black]{{ - 2.51625938}}\end{align*}\]

b Trapezoid Rule Show Solution

From the Midpoint Rule work we know that the width of each subinterval is \(\Delta x = \frac{1}{2}\) and for reference purposes the sketch of the graph along with the endpoints of each subinterval marked by the dots is shown below.

The graph of \(\cos \left( {1 + \sqrt x } \right)\) on the interval \(\left[ {0,4} \right]\).  The graph starts at about 0.54, drops steeply and crosses the x-axis just after \(x = 0\), then continues decreasing more and more slowly down to about -1 at the right end.  The nine points that divide the interval into 8 subintervals are marked along the x-axis.

So, to use the Trapezoid Rule to approximate the value of the integral all we need to do is plug into the formula. Doing this gives,

\[\begin{align*}\int_{0}^{4}{{\cos \left( {1 + \sqrt x } \right)\,dx}} & \approx \left( {\frac{{{\scriptstyle{}^{1}/{}_{2}}}}{2}} \right)\left[ {f\left( 0 \right) + 2f\left( {\frac{1}{2}} \right) + 2f\left( 1 \right) + 2f\left( {\frac{3}{2}} \right) + 2f\left( 2 \right) + 2} \right.f\left( {\frac{5}{2}} \right) + \\ & \hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\left. {2f\left( 3 \right) + 2f\left( {\frac{7}{2}} \right) + f\left( 4 \right)} \right]\\ & = \require{bbox} \bbox[2pt,border:1px solid black]{{ - 2.43000475}}\end{align*}\]

c Simpson's Rule Show Solution

From the Midpoint Rule work we know that the width of each subinterval is \(\Delta x = \frac{1}{2}\) and for reference purposes the sketch of the graph along with the endpoints of each subinterval marked by the dots is shown below.

The graph of \(\cos \left( {1 + \sqrt x } \right)\) on the interval \(\left[ {0,4} \right]\).  The graph starts at about 0.54, drops steeply and crosses the x-axis just after \(x = 0\), then continues decreasing more and more slowly down to about -1 at the right end.  The nine points that divide the interval into 8 subintervals are marked along the x-axis.

As with the first two parts all we need to do is plug into the formula to use Simpson’s Rule to approximate value of the integral. Doing this gives,

\[\begin{align*}\int_{0}^{4}{{\cos \left( {1 + \sqrt x } \right)\,dx}} & \approx \left( {\frac{{{\scriptstyle{}^{1}/{}_{2}}}}{3}} \right)\left[ {f\left( 0 \right) + 4f\left( {\frac{1}{2}} \right) + 2f\left( 1 \right) + 4f\left( {\frac{3}{2}} \right) + 2f\left( 2 \right) + 4} \right.f\left( {\frac{5}{2}} \right) + \\ & \hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\hspace{0.25in}\left. {2f\left( 3 \right) + 4f\left( {\frac{7}{2}} \right) + f\left( 4 \right)} \right]\\ & = \require{bbox} \bbox[2pt,border:1px solid black]{{ - 2.47160136}}\end{align*}\]