Integral Trapezoid Method Python