Working trapezoidal solver. Tested w/ f(x) = x and f(x) = x*x