Width of intervals is (b-a)/n = (2 - -1)/n = 3/n.
Endpoints are: -1 = -1 + 0 3/n,
-1 + 1 (3/n),
-1 + 2 (3/n),
....,
-1 + (n-1) 3/n,
-1 + n 3/n = 2
Lower sums are at left hand endpoints;
Mathematica can do this sum:
Upper sums are similar:
Again Mathematica can do this sum:
The actual area is:
Triangle below axis is -(1/4) - (1) in width, and 1 + 4 (-1) in hight.
Triangle above axis is 2 - (-1.4) in width, and 1 + 8 in height:
A closer look at the local min near .35: f(x) is BLUE, f'(x) is RED