Exercise 18.1#
Question 1#
Consider the integral
\[
\int_0^{0.9} \frac{dx}{1 - x^2}
\]
which has the exact solution:
\[
\frac{1}{2}\ln\left(\frac{x + 1}{1 - x}\right)~~\Bigg|_{x = 0.9}
\]
Part 1#
Approximate the value of the integral using the composite midpoint rule for \(n = 1, 2, \dots, 10\) sub-intervals and compare the approximations to the exact value by plotting the value of the integral versus \(n\). Be sure to represent the exact solution in the plot as well.
Part 2#
For the same sub-intervals, determine the true error of the midpoint rule. Compare this to the upper bound of the error (which you can determine by finding using (18) with the maximum of \(f''\) in the interval).