See it looks like the rectangles take up about half the area between the red and blue lines.
So next I thought maybe the proportion between the red and blue line that is also under a rectangle when compared to the total area between the red and blue line stays roughly constant? So I measured that proportion with the integral between 0 and 1 and used that instead of the (1/2) in the previous formula...
And that weird function down at the bottom of this picture is what you end up with, it follows the area of the rectangles continuously and has the same amount of area under it as you go to infinity as the rectangles do.
It doesn't quite look like it in this drawing I did but in the actual graph without the drawing areas there is a cool thing to notice:
The green areas are equal to the blue areas, meaning the part of the rectangle that gets cut off above the red line exactly matches the hollow part in between the line and the rectangles. That's an easy way to see that the curve has the same area underneath it as all the rectangles added together.