It sounds like you're doing MRAM. When doing MRAM, you set the height of the rectangle to the midpoint of your rectangle widths. To find the actual value of the height of your rectangle, you take that midpoint's distance from the origin in the x direction, and plug that number into the equation for your curve. For example, say you have the function:
y = x + 1 (sorry, I don't know LaTeX)
And you want to approximate the area underneath this curve from 0 to 10, using MRAM with 5 rectangles.
The first step is to divide your area into five rectangles, each of width 2 ( 5 is how far you want to go, divided by the number of rectangles you want to use equals 2). So, at this point, we're trying to find the area of 6 rectangles, all of width 2.
To find the height of the rectangles (your origional question, lol), you simply take the midpoint of each rectangle, and plug it into the function defining your curve (in this case, y = x + 1) Doing this, we come up with:
Rectangle 1:
y = 1 + 1
y = 2
Rectangle 2:
y = 3 + 1
y = 4
Rectangle 3:
y = 5 + 1
y = 6
Rectangle 4:
y = 7 + 1
y = 8
Rectangle 5:
y = 9 + 1
y = 10
So there are your heights of your rectangle. Now, we simply multiply the lengths of the rectangles by their heights, and add the areas all together to get our MRAM using 6 rectangles!
2 * 2 + 2 * 4 + 2 * 6 + 2 * 8 + 2 * 10
Pulling out the twos, we get
2*(2+4+6+8+10)
which equals
2*(30)
60
And that is how you find the midpoints, and use them to approxiamte an integral for a given curve! I hope that is actually what you're trying to do, and that I did not just waste my time explaining all that :-)