Using the Monte Carlo method.
- Generate independently and uniformly n points from a rectangle [a, b] x [0, M]
for a given M >= sup{ f(x) : x ∈ [a,b] } - Count a number of generated points that lay under the curve of a function f(x)
A point (x, y) lies under the curve of f(x) if y <= f(x) ( = C ) - The approximation is C/n * ( b−a ) * M, where ( b−a ) * M is an area of the rectangle