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.
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.
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.
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.
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.
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.
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).
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.
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.