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, ${n}^{\text{th}}$ 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:
$${e}^{-{x}^{2}},\mathrm{sin}({x}^{3})\mathit{\hspace{1em}}\text{and}\mathit{\hspace{1em}}\frac{\mathrm{sin}x}{x}.$$ |
The simplest way to refer to the antiderivatives of ${e}^{-{x}^{2}}$ is to simply write $\int {e}^{-{x}^{2}}\mathrm{d}x$.
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:
$${\int}_{0}^{1}{e}^{-{x}^{2}}\mathrm{d}x,{\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}\mathrm{sin}({x}^{3})\mathrm{d}x,\text{and}\mathit{\hspace{1em}}{\int}_{0.5}^{4\pi}\frac{\mathrm{sin}(x)}{x}\mathrm{d}x,$$ |
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 $f$ be a continuous function on the interval $[a,b]$. We wish to approximate ${\int}_{a}^{b}}f(x)\mathrm{d}x$. We partition $[a,b]$ into $n$ equally spaced subintervals, each of length $\mathrm{\Delta}x={\displaystyle \frac{b-a}{n}}$. The endpoints of these subintervals are labeled as
$${x}_{0}=a,{x}_{1}=a+\mathrm{\Delta}x,{x}_{2}=a+2\mathrm{\Delta}x,\mathrm{\dots},{x}_{i}=a+i\mathrm{\Delta}x,\mathrm{\dots},{x}_{n}=b.$$ |
Section 5.3 showed that to use the Left Hand Rule we use the summation $\sum _{i=1}^{n}}f({x}_{i-1})\mathrm{\Delta}x$ and to use the Right Hand Rule we use $\sum _{i=1}^{n}}f({x}_{i})\mathrm{\Delta}x$. We review the use of these rules in the context of examples.
Approximate ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$ using the Left and Right Hand Rules with 5 equally spaced subintervals.
SolutionWe begin by partitioning the interval $[0,1]$ into 5 equally spaced intervals. We have $\mathrm{\Delta}x=\frac{1-0}{5}=1/5=0.2$, so
$${x}_{0}=0,{x}_{1}=0.2,{x}_{2}=0.4,{x}_{3}=0.6,{x}_{4}=0.8,\text{and}{x}_{5}=1.$$ |
Using the Left Hand Rule, we have:
$\sum _{i=1}^{n}}f({x}_{i-1})\mathrm{\Delta}x$ | $=\left(f({x}_{0})+f({x}_{1})+f({x}_{2})+f({x}_{3})+f({x}_{4})\right)\mathrm{\Delta}x$ | ||
$=\left(f(0)+f(0.2)+f(0.4)+f(0.6)+f(0.8)\right)\mathrm{\Delta}x$ | |||
$\approx \left(1+0.961+0.852+0.698+0.527\right)(0.2)$ | |||
$\approx 0.808.$ |
Using the Right Hand Rule, we have:
$\sum _{i=1}^{n}}f({x}_{i})\mathrm{\Delta}x$ | $=\left(f({x}_{1})+f({x}_{2})+f({x}_{3})+f({x}_{4})+f({x}_{5})\right)\mathrm{\Delta}x$ | ||
$=\left(f(0.2)+f(0.4)+f(0.6)+f(0.8)+f(1)\right)\mathrm{\Delta}x$ | |||
$\approx \left(0.961+0.852+0.698+0.527+0.368\right)(0.2)$ | |||
$\approx 0.681.$ |
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
$$\frac{0.808+0.681}{2}=0.7445.$$ |
The actual answer, accurate to 4 places after the decimal, is 0.7468, showing our average is a good approximation.
Approximate ${\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}}\mathrm{sin}({x}^{3})\mathrm{d}x$ using the Left and Right Hand Rules with 10 equally spaced subintervals.
SolutionWe begin by finding $\mathrm{\Delta}x$:
$$\frac{b-a}{n}=\frac{\pi /2-(-\pi /4)}{10}=\frac{3\pi}{40}\approx 0.236.$$ |
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 $\mathrm{sin}({x}^{3})$ 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 $\mathrm{sin}({x}_{i}^{3})$ and multiplies the sum by $\mathrm{\Delta}x$; the Right Hand Rule sums the last 10 values of $\mathrm{sin}({x}_{i}^{3})$ and multiplies by $\mathrm{\Delta}x$. Therefore we have:
$\text{Left Hand Rule:}{\displaystyle {\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}}\mathrm{sin}({x}^{3})\mathrm{d}x$ | $\approx (1.91)(0.236)=0.451.$ | ||
$\text{Right Hand Rule:}{\displaystyle {\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}}\mathrm{sin}({x}^{3})\mathrm{d}x$ | $\approx (1.71)(0.236)=0.404.$ |
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 ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$ 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 $f(x)={e}^{-{x}^{2}}$ on $[0,1]$ approximated with 5 trapezoids of equal width; the top “corners” of each trapezoid lie on the graph of $f(x)$. It is clear from this figure that these trapezoids more accurately approximate the area under $f$ and hence should give a better approximation of ${\int}_{0}^{1}{e}^{-{x}^{2}}\mathrm{d}x$. (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 ${\int}_{0}^{1}{e}^{-{x}^{2}}\mathrm{d}x$ with these trapezoids in the following example.
Use 5 trapezoids of equal width to approximate ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$.
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:
$$\frac{1+0.961}{2}(0.2)=0.1961.$$ |
Moving right, the next trapezoid has legs of length 0.961 and 0.852 and a height of 0.2. Thus its area is:
$$\frac{0.961+0.852}{2}(0.2)=0.1813.$$ |
The sum of the areas of all 5 trapezoids is:
$\frac{1+0.961}{2}}(0.2)+{\displaystyle \frac{0.961+0.852}{2}}(0.2)+{\displaystyle \frac{0.852+0.698}{2}}(0.2)$ | |||
$+{\displaystyle \frac{0.698+0.527}{2}}(0.2)+{\displaystyle \frac{0.527+0.368}{2}}(0.2)$ | $=0.7445.$ |
We approximate ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x\approx 0.7445$.
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 $\mathrm{\Delta}x=0.2$. We can factor these coefficients out, leaving a more concise summation as:
$$\begin{array}{c}\frac{1}{2}(0.2)[(1+0.961)+(0.961+0.852)+\hfill \\ \hfill (0.852+0.698)+(0.698+0.527)+(0.527+0.368)].\end{array}$$ |
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
$$\frac{0.2}{2}\left[1+2(0.961+0.852+0.698+0.527)+0.368\right].$$ |
This is the heart of the Trapezoidal Rule, where a definite integral ${\int}_{a}^{b}}f(x)\mathrm{d}x$ is approximated by using trapezoids of equal widths to approximate the corresponding area under $f$. Using $n$ equally spaced subintervals with endpoints ${x}_{0}$, ${x}_{1}$, …, ${x}_{n}$, we again have $\mathrm{\Delta}x={\displaystyle \frac{b-a}{n}}$. Thus:
${\int}_{a}^{b}}f(x)\mathrm{d}x$ | $\approx {\displaystyle \sum _{i=1}^{n}}{\displaystyle \frac{f({x}_{i-1})+f({x}_{i})}{2}}\mathrm{\Delta}x$ | ||
$={\displaystyle \frac{\mathrm{\Delta}x}{2}}{\displaystyle \sum _{i=1}^{n}}\left(f({x}_{i-1})+f({x}_{i})\right)$ | |||
$={\displaystyle \frac{\mathrm{\Delta}x}{2}}\left[f({x}_{0})+2{\displaystyle \sum _{i=1}^{n-1}}f({x}_{i})+f({x}_{n})\right].$ |
Revisit Example 8.7.2 and approximate ${\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}}\mathrm{sin}({x}^{3})\mathrm{d}x$ using the Trapezoidal Rule and 10 equally spaced subintervals.
SolutionWe refer back to Figure 8.7.3 for the table of values of $\mathrm{sin}({x}^{3})$. Recall that $\mathrm{\Delta}x=3\pi /40\approx 0.236$. Thus we have:
$\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}$ | $\mathrm{sin}\left({x}^{3}\right)\mathrm{d}x$ | ||
$\approx {\displaystyle \frac{0.236}{2}}\left[-0.466+2\left(-0.165+\left(-0.031\right)+\mathrm{\cdots}+0.69\right)+\left(-0.67\right)\right]$ | |||
$=0.4275.$ |
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 ${x}_{i}$ and $f({x}_{i})$ 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 $f$ with constant functions on small subintervals and then computes the definite integral of these constant functions. The Trapezoidal Rule is really approximating a function $f$ 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 $f$ 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 $x$-value).
Consider three points $({x}_{1},{y}_{1})$, $({x}_{2},{y}_{2})$ and $({x}_{3},{y}_{3})$ whose $x$-values are equally spaced and $$. Let $f$ be the quadratic function that goes through these three points. An exercise will ask you to show that
$${\int}_{{x}_{1}}^{{x}_{3}}f(x)\mathrm{d}x=\frac{{x}_{3}-{x}_{1}}{6}\left({y}_{1}+4{y}_{2}+{y}_{3}\right).$$ | (8.7.1) |
Consider Figure 8.7.8. A function $f$ goes through the 3 points shown and the parabola $g$ that also goes through those points is graphed with a dashed line. Using our equation from above, we know exactly that
$${\int}_{1}^{3}g(x)\mathrm{d}x=\frac{3-1}{6}\left(3+4(1)+2\right)=3.$$ |
Since $g$ is a good approximation for $f$ on $[1,3]$, we can state that
$${\int}_{1}^{3}f(x)\mathrm{d}x\approx 3.$$ |
Notice how the interval $[1,3]$ 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 ${\int}_{a}^{b}}f(x)\mathrm{d}x$ using Simpson’s Rule, subdivide $[a,b]$ into $n$ subintervals, where $n$ is even and each subinterval has width $\mathrm{\Delta}x=(b-a)/n$. We approximate $f$ with $n/2$ parabolic curves, using Equation (8.7.1) to compute the area under these parabolas. Adding up these areas gives the formula:
$$\begin{array}{c}{\int}_{a}^{b}f(x)\mathrm{d}x\approx \hfill \\ \hfill \frac{\mathrm{\Delta}x}{3}\left[f({x}_{0})+4f({x}_{1})+2f({x}_{2})+4f({x}_{3})+\mathrm{\cdots}+2f({x}_{n-2})+4f({x}_{n-1})+f({x}_{n})\right].\end{array}$$ |
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 ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$ 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
$${\int}_{0}^{1}{e}^{-{x}^{2}}\mathrm{d}x\approx \frac{0.25}{3}\left[1+4(0.939)+2(0.779)+4(0.570)+0.368\right]=0.7468\overline{3}.$$ |
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 $f(x)={e}^{-{x}^{2}}$ along with its approximating parabolas, demonstrating how good our approximation is. The approximating curves are nearly indistinguishable from the actual function.
Approximate ${\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}}\mathrm{sin}({x}^{3})\mathrm{d}x$ using Simpson’s Rule and 10 equally spaced intervals.
SolutionFigure 8.7.10(a) shows the table of values that we used in the past for this problem, shown here again for convenience. Again, $\mathrm{\Delta}x=(\pi /2+\pi /4)/10\approx 0.236$.
Simpson’s Rule states that
${\int}_{-\frac{\pi}{4}}^{\frac{\pi}{2}}}\mathrm{sin}\left({x}^{3}\right)\mathrm{d}x$ | $\approx {\displaystyle \frac{0.236}{3}}[(-0.466)+4(-0.165)+2(-0.031)+\mathrm{\cdots}$ | ||
$\mathrm{\cdots}+2\left(0.971\right)+4\left(0.69\right)+(-0.67)]$ | |||
$=0.4701$ |
Recall that the actual value, accurate to 3 decimal places, is 0.460. Our approximation is within $0.01$ 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 $f$ be a continuous function on $[a,b]$, let $n$ be a positive integer, and let $\mathrm{\Delta}x={\displaystyle \frac{b-a}{n}}$.
Set ${x}_{0}=a$, ${x}_{1}=a+\mathrm{\Delta}x$, …, ${x}_{i}=a+i\mathrm{\Delta}x$, ${x}_{n}=b$.
Then ${\int}_{a}^{b}}f(x)\mathrm{d}x$ can be approximated by:
Left Hand Rule:
$\mathrm{\Delta}x\left[f({x}_{0})+f({x}_{1})+\mathrm{\cdots}+f({x}_{n-1})\right]$.
Right Hand Rule:
$\mathrm{\Delta}x\left[f({x}_{1})+f({x}_{2})+\mathrm{\cdots}+f({x}_{n})\right]$.
Midpoint Rule:
$\mathrm{\Delta}x\left[f\left(\frac{{x}_{0}+{x}_{1}}{2}\right)+f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)+\mathrm{\cdots}+f\left(\frac{{x}_{n-1}+{x}_{n}}{2}\right)\right]$.
Trapezoidal Rule:
$\frac{\mathrm{\Delta}x}{2}\left[f({x}_{0})+2f({x}_{1})+2f({x}_{2})+\mathrm{\cdots}+2f({x}_{n-1})+f({x}_{n})\right]$.
Simpson’s Rule:
$\frac{\mathrm{\Delta}x}{3}\left[f({x}_{0})+4f({x}_{1})+2f({x}_{2})+\mathrm{\cdots}+4f({x}_{n-1})+f({x}_{n})\right]$ ($n$ 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 ${K}_{m}$ is an upper bound on $\left|{f}^{(m)}(x)\right|$ on $[a,b]$. Then a bound for the error of the numerical method of integration is given by:
Method | Error Bound |
Left/Right Hand Rule | $\frac{{K}_{1}{(b-a)}^{2}}{2n}$ |
Midpoint Rule | $\frac{{K}_{2}{(b-a)}^{3}}{24{n}^{2}}$ |
Trapezoidal Rule | $\frac{{K}_{2}{(b-a)}^{3}}{12{n}^{2}}$ |
Simpson’s Rule | $\frac{{K}_{4}{(b-a)}^{5}}{180{n}^{4}}$ |
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 $n$ gets larger).
When $n$ 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${}^{\text{th}}$ derivative of $f$. Consider a cubic polynomial: its ${4}^{\text{th}}$ 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 ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$ using the Trapezoidal Rule and 5 subintervals, and using Simpson’s Rule with 4 subintervals.
SolutionTrapezoidal Rule with $n\mathrm{=}\mathrm{5}$:
We start by computing the ${2}^{\text{nd}}$ derivative of $f(x)={e}^{-{x}^{2}}$: ^{†}^{†}margin: Λ
$${f}^{\prime \prime}(x)={e}^{-{x}^{2}}(4{x}^{2}-2).$$ |
Figure 8.7.11 shows a graph of ${f}^{\prime \prime}(x)$ on $[0,1]$. It is clear that the largest value of ${f}^{\prime \prime}$, in absolute value, is 2. Thus we let $M=2$ and apply the error formula from Theorem 8.7.1.
$${E}_{T}=\frac{{(1-0)}^{3}}{12\cdot {5}^{2}}\cdot 2=0.00\overline{6}.$$ |
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
$$0.7445-0.0067=.7378\le {\int}_{0}^{1}{e}^{-{x}^{2}}\mathrm{d}x\le 0.7512=0.7445+0.0067.$$ |
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 $n\mathrm{=}\mathrm{4}$:
We start by computing the ${4}^{\text{th}}$ derivative of $f(x)={e}^{-{x}^{2}}$: ^{†}^{†}margin: Λ
$${f}^{(4)}(x)={e}^{-{x}^{2}}(16{x}^{4}-48{x}^{2}+12).$$ |
Figure 8.7.12 shows a graph of ${f}^{(4)}(x)$ on $[0,1]$. It is clear that the largest value of ${f}^{(4)}$, in absolute value, is 12. Thus we let $M=12$ and apply the error formula from Theorem 8.7.1.
$${E}_{s}=\frac{{(1-0)}^{5}}{180\cdot {4}^{4}}\cdot 12=0.00026.$$ |
Our error estimation formula states that our approximation of $0.7468\overline{3}$ found in Example 8.7.5 is within 0.00026 of the correct answer, hence we know that
$$0.74683-0.00026=.74657\le {\int}_{0}^{1}{e}^{-{x}^{2}}\mathrm{d}x\le 0.74709=0.74683+0.00026.$$ |
Once again we affirm the validity of Theorem 8.7.1.
We have seen that, for ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$, Simpson’s Rule with 4 subintervals is far more accurate than the Trapezoidal Rule with 5 subintervals. We now find how many intervals we would need to match that accuracy.
Find the number of subintervals necessary to estimate ${\int}_{0}^{1}}{e}^{-{x}^{2}}\mathrm{d}x$ to within $0.00026$ using the Trapezoidal Rule.
SolutionWe can again use that ${f}^{\prime \prime}(x)$ is bounded by 2, so that
$${E}_{T}=\frac{{(1-0)}^{3}}{12\cdot {n}^{2}}\cdot 2=\frac{1}{6{n}^{2}}.$$ |
In order for this to be at most $0.00026$, we need to have
$$n\ge \frac{1}{\sqrt{6\cdot 0.00026}}\approx 25.3.$$ |
Therefore, we will need at least 26 subintervals in order to have as much accuracy as Simpson’s Rule with 4 subintervals.
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 $v(t)$; we will use Simpson’s Rule to approximate ${\int}_{a}^{b}}v(t)\mathrm{d}t.$
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 $\mathrm{\Delta}x=(b-a)/n$. Clearly, $n=24$. What are $a$ and $b$? Since we start at time $t=0$, we have that $a=0$. The final recorded time came after 24 periods of 30 seconds, which is 12 minutes or 1/5 of an hour. Thus we have
$$\mathrm{\Delta}x=\frac{b-a}{n}=\frac{1/5-0}{24}=\frac{1}{120};\frac{\mathrm{\Delta}x}{3}=\frac{1}{360}.$$ |
Thus the distance traveled is approximately:
${\int}_{0}^{0.2}}v(t)\mathrm{d}t$ | $\approx {\displaystyle \frac{1}{360}}\left[f({x}_{1})+4f({x}_{2})+2f({x}_{3})+\mathrm{\cdots}+4f({x}_{n})+f({x}_{n+1})\right]$ | ||
$={\displaystyle \frac{1}{360}}\left[0+4\cdot 25+2\cdot 22+\mathrm{\cdots}+2\cdot 40+4\cdot 23+0\right]$ | |||
$\approx 6.2167\text{miles.}$ |
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 $n=4$.
Approximate the definite integral with Simpson’s Rule and $n=4$.
Find the exact value of the integral.
${\int}_{-1}^{1}}{x}^{2}\mathrm{d}x$
${\int}_{0}^{10}}5x\mathrm{d}x$
${\int}_{0}^{\pi}}\mathrm{sin}x\mathrm{d}x$
${\int}_{0}^{4}}\sqrt{x}\mathrm{d}x$
${\int}_{0}^{3}}\left({x}^{3}+2{x}^{2}-5x+7\right)\mathrm{d}x$
${\int}_{0}^{1}}{x}^{4}\mathrm{d}x$
${\int}_{0}^{2\pi}}\mathrm{cos}x\mathrm{d}x$
${\int}_{-3}^{3}}\sqrt{9-{x}^{2}}\mathrm{d}x$
In Exercises 13–20., approximate the definite integral with the Trapezoidal Rule and Simpson’s Rule, with $n=6$.
${\int}_{0}^{1}}\mathrm{cos}\left({x}^{2}\right)\mathrm{d}x$
${\int}_{-1}^{1}}{e}^{{x}^{2}}\mathrm{d}x$
${\int}_{0}^{5}}\sqrt{{x}^{2}+1}\mathrm{d}x$
${\int}_{0}^{\pi}}x\mathrm{sin}x\mathrm{d}x$
${\int}_{0}^{\pi /2}}\sqrt{\mathrm{cos}x}\mathrm{d}x$
${\int}_{1}^{4}}\mathrm{ln}x\mathrm{d}x$
${\int}_{-1}^{1}}{\displaystyle \frac{1}{\mathrm{sin}x+2}}\mathrm{d}x$
${\int}_{0}^{6}}{\displaystyle \frac{1}{\mathrm{sin}x+2}}\mathrm{d}x$
In Exercises 21–24., find $n$ such that the error in approximating the given definite integral is less than $0.0001$ when using:
the Trapezoidal Rule
Simpson’s Rule
${\int}_{0}^{\pi}}\mathrm{sin}x\mathrm{d}x$
${\int}_{1}^{4}}{\displaystyle \frac{1}{\sqrt{x}}}\mathrm{d}x$
${\int}_{0}^{\pi}}\mathrm{cos}\left({x}^{2}\right)\mathrm{d}x$
${\int}_{0}^{5}}{x}^{4}\mathrm{d}x$
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 $f$ be the quadratic function that goes through the points $({x}_{1},{y}_{1})$, $({x}_{1}+\mathrm{\Delta}x,{y}_{2})$ and $({x}_{1}+2\mathrm{\Delta}x,{y}_{3})$. Show that ${\int}_{{x}_{1}}^{{x}_{1}+2\mathrm{\Delta}x}}f\left(x\right)\mathrm{d}x={\displaystyle \frac{\mathrm{\Delta}x}{3}}\left({y}_{1}+4{y}_{2}+{y}_{3}\right)$.