Skip to main content

Exploring Calculus with Maple Introductory Calculus

Section 3.3 Other Integral Approximation Techniques

Subsection 3.3.1 Recommended Tutorials

Before starting on these exercises, you should familiarize yourself with the material covered in the following tutorials:

Subsection 3.3.2 Introduction

The trapezoid rule, the midpoint rule, and Simpson’s rule are all useful numerical methods for approximating a definite integral of a function \(f(x)\) on a finite interval. Maple’s ApproximateInt() command supports each of these techniques, which can be specified by setting the optional method parameter to the desired option.
Each of these techniques will have some associated error with its approximation, measured as the difference between the approximated numerical value and the actual value of the definite integral. For any particular function \(f(x)\text{,}\) it is possible to calculate the largest error (an upper bound) in its approximation for a finite number of subintervals, \(n\text{.}\) In particular:
\begin{align} \abs{E_T} \amp\le \dfrac{K(b-a)^3}{12n^2}, \quad K = \text{ maximum of }|f''(x)|\text{ on } [a,b]\tag{3.1}\\ \abs{E_M} \amp\le \dfrac{K(b-a)^3}{24n^2}, \quad K = \text{ maximum of }|f''(x)|\text{ on } [a,b]\tag{3.2}\\ \abs{E_S} \amp\le \dfrac{K(b-a)^5}{180n^4}, \quad K = \text{ maximum of }|f^{(4)}(x)|\text{ on } [a,b]\tag{3.3} \end{align}
Each error bound calculation relies on the width of the interval \([a,b]\text{,}\) the number of subintervals \(n\text{,}\) and the shape of the function (the second or fourth derivative) on the interval.
In this activity, you will use Maple’s ApproximateInt() command to help visualize these three approximation methods and then calculate the error bounds associated with them.

Exercises 3.3.3 Exercises

1.

Assign \(f(x) = { e}^x\sin(x)\) using the assignment operator, :=, and plot it over the interval \([0,1]\text{.}\)
Hint.
Don’t forget that the exp() function is used for \({ e}^x\text{.}\) You cannot use the letter β€˜e’ on the keyboard for the exponential function. However, you can find \(e\) in the palettes toolbar.

2.

In this exercise, you will use the trapezoid rule to estimate \(\dint_0^1 e^x\sin(x) dx\text{.}\) Use the ApproximateInt() command with method=trapezoid and partition=4 over the interval \([0,1]\) in each of the following steps.
(c)
Approximate the value of the definite integral using output=value.

3.

In this exercise, you will use the midpoint rule to estimate \(\dint_0^1 e^x\sin(x) dx\text{.}\) Use the ApproximateInt() command with method=midpoint and partition=4 over the interval \([0,1]\) in each of the following steps.
(c)
Approximate the value of the definite integral using output=value.

4.

In this exercise, you will use Simpson’s rule to estimate \(\dint_0^1 e^x\sin(x) dx\text{.}\) Use the ApproximateInt() command with method=simpson and partition=4 over the interval \([0,1]\) in each of the following steps.
Note that while partition=4, Simpson’s rule uses twice as many subintervals, so for error calculations, \(n=8\text{.}\)
(c)
Approximate the value of the definite integral using output=value.

5.

In this exercise, you will determine the error bounds for the trapezoid and midpoint approximations you obtained in exercises 2 and 3. Both of these error bound calculations depend on the maximum value of \(\abs{f''(x)}\) over the interval. You may need to recall some knowledge of critical values and extreme values on a closed interval to complete this exercise.
(a)
Plot \(|f''(x)|\) over the interval \([0,1]\) and notice that the maximum value of \(|f''(x)|\) occurs at a critical number of \(|f''(x)|\text{.}\)
(b)
Find the critical number of \(|f''(x)|\) by solving \(f'''(x)=0\) for \(x\text{.}\) Evaluate \(|f''(x)|\) at this \(x\)-value to determine the value of \(K\) that is used in formulas (3.1) and (3.2).

6.

In this exercise, you will determine the error bound for the approximation you obtained in exercise 4 using Simpson’s rule. This error bound calculation depends on the maximum value of \(\abs{f^{(4)}(x)}\) over the interval. Also note that partition=4 actually correponds to \(n=8\text{,}\) since there is an additional sample point in each partition, resulting in twice as many subintervals.
(a)
Plot \(|f^{(4)}(x)|\) over the interval \([0,1]\) and notice that the maximum value of \(|f^{(4)}(x)|\) occurs at one of the two endpoints of the interval.
(b)
Evaluate \(|f^{(4)}(x)|\) at the \(x\)-value of this endpoint where it reaches a maximum. This gives the value of \(K\) in the error formula (3.3).