G'day all,

I have to develop my own code in MATLAB to approxmiate the integral of $\displaystyle x^2 \ sin(x) $ from 0 to $\displaystyle \pi $ using the midpoint method, the trapezoid method, and Simpson's method. I have completed this task, but now the question asks me to "compare the discretization error of these 3 mehtods taking different step-sizes" and I dont know what to do for it (again using MATLAB)

I cannot seem to find formulas for the discretization errors produced by the above rules.

Can anybody please help me understand how to go about doing this?