With n = 4 and the interval x ∈ [0 , 2] then the subintervals are [0 , .5] , [.5 , 1] , [1 , 1.5] , and [1.5 , 2].
The midpoints of those subints (all of width = .5) are x = .25 , .75 , 1.25 , and 1.75
The heights at those x-values are e.25 - 7 , e.75 - 7 , e1.25 - 7 , and e1.75 - 7.
So the sum of the areas of those 4 rectangles = .5(e.25 - 7 + e.75 - 7 + e1.25 - 7 + e1.75 - 7).