Calculates and returns Left, Right, or Midpoint Riemann Sum, given the range and number of subintervals