Question

Problem 5:Write an M-file to evaluate the definite integral below using the composite trapezoidal rule with 1, 2 5,and 10 intervals. Compute the true relative percent error (s.) for each

result. Provide a printout of your m-file and the command window showing the results. I=\int_{a}^{n}(8+4 \cos x) d x

Fig: 1

Fig: 2