I want to plot the middle Riemann sum of half a circle from the interval -1 to 1. Half the circle is:
Sqrt[1 - x^2]
Currently I'm getting the right Riemann sum by getting the x axis, and y axis and then getting a table for the rectangles.
rectangles[x_, y_] :=
Table[Rectangle[{x[[i]], 0.}, {x[[i + 1]], y[[i]]}], {i,Length[x] - 1}]
I then show the plot
Show[{Plot[y, {x, -1, 1}],
Graphics[{Opacity[0.3], Pink, EdgeForm[Thin],rectangles[xaxis,
yaxis]}]}]
and get the sum:
area = Sum[(xaxis[[i + 1]] - xaxis[[i]]) yaxis[[i]], {i, 1,
Length[xaxis] - 1}] // N
What do I change to plot the middle sum and get the area of it?