A Computer Project

Part 1

Use (a) the left endpoint rectangle rule, (b) the midpoint rectangle rule, (c) the trapezoid rule, (d) Simpson's rule, and (e) the two-point Gaussian quadrature to compute the integral

with the number of subintervals of equal length n = 1, ..., 10, respectively. Compute also all the corresponding absolute errors.

  1. Make a table of six columns with one for n and the other five for the the computed values by the five rules, respectively. Keep eight digits after decimal points.
  2. In a single plot, display five curves showing the absolute errors in the log-log scale (i.e. log(error) vs. log(n)) for the five corresponding rules.
  3. Discuss convergence rates for these quadrature rules based on the computational result.

Part 2

Use the trapezoid rule and Simpson's rule to compute the above integral with the number of subintervals of equal length n = 2k, k = 0, ..., 8. Then, apply the Richardson extrapolation procedure to the computed values corresponding to the trapezoid rule for the pairs (2k-1,2k), k = 1, ..., 8. Compute all the corresponding absolute errors.

  1. Make a table of four columns with one for n, one for the computed values by the trapezoid rule, one for that by the Richardson extrapolation, and one for that by Simpson's rule. Keep eight digits after decimal points.
  2. In a single plot, display three curves showing in the log-log scale the absolute errors (i.e. log (error) vs. log (n)) for the two corresponding rules and the Richardson extrapolation.
  3. Discuss the computational result in terms of convergence rates.