using the trapezoid and Simpson methods.
For a=0, b=5 and f(x)=x2 the output of the program is
s10= 4.187500000000000e+01 s20= 4.171875000000000e+01 Simp= 4.166666666666666e+01Since the exact value of the integral is
we see that Simpson's method gives the exact value.