Estimating the sum of a series. Question about my textbook explanation Why does my book show different techniques for finding the integral here? I think they use two different Riemann sum techniques but I'm not sure why. Why does figure 3 use right hand endpoints and why does figure 4 use left hand endpoints?

From my understanding:


*

*The blue rectangles are $R_n$

*Example, if $R_{10}$, then $R_{10} = s - S_{10}$ which is all of the blue rectangles like $a_{11} + a_{12} + ...$
Is the whole point of this to show that the remainder estimate is bounded? But is the visual demonstration inaccurate by using different endpoints for the rectangles? What if different endpoints were used? What if the endpoint techniques were swapped?
 A: The point is that  each rectangle in figure 3 is identical to the corresponding rectangle in figure 4.  In figure 3, where the rectangles coincide with the curve at their upper right corners, the sum of the areas of the rectangles (the shaded area) is visually less than the area under the curve starting at $n$.  This is the second part of the inequality:  $R_n \leq \int_{n}^\infty f(x)\,dx$.
In figure 4, where the rectangles coincide with the curve at their upper left corners, the sum of the areas of the rectangles (the shaded area) is visually greater than the area under the curve starting at $n+1$. This is the first part of the inequality:  $\int_{n+1}^\infty f(x)\,dx \leq R_n $.
If $f(x)$ were not a monotonic decreasing function, this visual proof would be worthless since some of the rectangles in each figure would extend above the curve, and part of the cure would be above the shaded area.  Indeed, for a non-monotonic function, the error estimate implied by this relation is not the right error estimate.
