Use left and right endpoints and the given number of rectangles to find two approximations of the area of the region between the graph of the function and the x-axis over the given interval.

f(x) = cos(x), (0, $\displaystyle \frac{\pi}{2}$), 4 rectangles

Plese check for me where I'm wrong

the width of each retangles is $\displaystyle \frac{\pi}{8}$

use right endpoints we have

$\displaystyle \sum_{i=1}^4 cos\frac{\pi}{8}i\frac{\pi}{8}$

use left endpoints we have

$\displaystyle \sum_{i=1}^4 cos\frac{\pi}{8}(i-1)\frac{\pi}{8}$