Home > other >  Rectangles of the area under the curve of any function
Rectangles of the area under the curve of any function

Time:11-20

I am struggling in writing a code that would produce a plot of any function with rectangle overlay of the area under the function for a specific interval. I see many examples of density functions with histograms but I want my rectangle to be bound by the function curve. We can take a function like x^2 as an example. Can someone help? something like this:

Image reference: Polygons under a curve

  • Related