Composite Trapezoidal Rule. To approximate the integral
by sampling at the equally spaced points , for
. Notice that and .
You are given the function
for the interval .
Plot the function.
Use the composite trapezoidal rule with 11 sample points to compute an approximation to the integral of taken over by using the MATLAB program given above.
Do the error analysis. Error term for the composite trapezoidal rule is given as;
Calculate the exact value of the integration by using MATLAB. Compare your results for the aspects of integration and error analysis.
Repeat the procedure with increased number of sample points.
Solution: