This calculates the area under a portion of a graph using Riemann Sums, also known as the rectangle area method or rectangle approximation method.
The L calculation uses left rectangles, R uses right rectangles, and M uses midpoint rectangles.
calculation fix