Math, Mathematics, Science, Numerical Analysis, Integration.
by supplying the value of n, when calling the function. Here is another(it just use numpy and matplotlib): A plot using Matplotlib to show how introducing more trapezoids help in better approximation. This code not only gives you the freedom to give any value of n but also shows how trapezoids