$24
Implement the following numerical methods for approximating integrals: (i) trapezoidal rule, (ii) Simpson’s rule, and (iii) Clenshaw-Curtis rule. (Code for generating the points and weights of the Clenshaw-Curtis rule is available on Canvas.)
Using calculus, compute the definite integral of f(x) = cos(3πx) on the interval [−1, 1]. Run a convergence study on the three numerical methods and identify the asymptotic regime and the rate of convergence for each method. FOR FUN: Change the integration interval to [−π, π] and repeat the study. What changes?
1