Obtaining a Desired Accuracy Using the Trapezoidal Rule
Find the number of subintervals \(n\) needed to guarantee that the Trapezoidal Rule approximates \(\int_{1}^{2}\dfrac{e^{x}}{x}dx\) correct to within 0.0001.
Solution To be sure that the approximation of \(\int_{1}^{2} \dfrac{e^{x}}{x}dx\) is correct to within 0.0001, we require the error be less than \(0.0001.\) That is, \[ \begin{eqnarray*} \hbox{Error} & \leq & \dfrac{(b-a)^{3}M}{12n^{2}}=\dfrac{(2-1)^{3}M}{12n^{2}}\underset{\underset{\color{#0066A7}{M=e}}{\color{#0066A7}{\uparrow}}} {=}\dfrac{e}{12n^{2}} \lt 0.0001 \\ n^{2} & \gt &\dfrac{e}{(0.0001) (12) }=\dfrac{e}{0.0012} \\ n & \gt &{\sqrt{\dfrac{e}{0.0012}}}\approx 47.6 \end{eqnarray*} \]
To ensure that the error is less than \(0.0001,\) we round up to \(48\) subintervals.