Trapezoidal rule using mathematica