At the moment, I am taking a calculus course at my high school (we are starting to learn about integrals) and thought of an interesting problem while learning about Riemann Sums. Once I develop a method on how to solve this problem for any general curve, I hope to write a script in python.
Problem
Consider the following parameters:
- $y = f(x) = (x - 1.5)^{1/3} + 2$
- Domain: $[-2, 6]$
- $n = 4$
- The width of each subdivision, $\Delta w_k$, does not have to be equal.
Using left-hand endpoints, right-hand endpoints, midpoints, or a combination of all three, how could you orient the rectangles to cover the greatest area underneath the curve? Ideally, the intended python script I want to write would involve an algorithm that can be applied to any particular curve, any specific domain interval, and any number of subdivisions.
How would you even approach this problem? What steps would you outline?
Graph of $y = f(x) = (x - 1.5)^{1/3} + 2$
Same Graph with Varying Widths
This is an example that involves the midpoint approximation with varying widths ($\Delta w_k$).
