Exercise 18.4

Exercise 18.4#

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} \]

Approximate the value of the integral using the trapezoid and improved trapezoidal rules for \(n = 1, 2, \dots, 10\) sub-intervals.

On the same set of axes, plot the following vs \(n\):

  • The true error of the trapezoidal rule

  • The true error of the improved trapezoidal rule

  • The upper-bound of the theoretical error from (20)

  • The error estimation from (24)

How do each of these compare?