Our framework is a very simple framework used to calculate the area under the curve in the given axis-parallel rectangle. We will use a numerical method that is the simplification of the Monte Carlo method to calculate the integral of a function. The following image illustrates the idea. To calculate the area under the curve in a given rectangle, we will take a lot of points from the rectangle and evaluate the curve equation at those points using the *x* coordinate. If the evaluation is less than the *y* coordinates of the point, the point is below the curve at that *x* coordinate. We will count all such points. The area under the curve can be calculated as,

Area under curve = Area of the rectangle * (pointsBelowCurve/totalPoints) ...

Start Free Trial

No credit card required