im guessing n=4 means using 4 rectangles
so you would basically break the interval 1,3 into 4 equal pieces
then evaluate f(x) at those places
then calculate the area of each rectangle they create
add them together and there you go
kind of hard to explain without drawing a pic though
for left endpoint
x from 1 to 3 means we have a distance of 2
break that into 4 pieces and we get halfs
so our first rectangle goes from x=1 to 1.5 and its height is f(1)
gives us an area of f(1) * .5 = 5 *.5=2.5
second piece is from x=1.5 to 2, height is f(1.5)
calculate area of this one
then do the other 2 more rectangles, add up all the areas
then for the right endpoints use the first rectangle is from x=1 to 1.5 and height is f(1.5) since its the right side of the rectangle that we care about for height
for midpoint do f(1.25)
does that make sense?