Midpoint integration of a function over some interval by n partitions.