The trap function uses the trapezoid method to calculate
the integral of the function f over the interval from
a to b. The parameter m sets the
number of intervals to use when evaluating the trapezoids. Additional
options are passed to the function f when evaluating.