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: