Trapezoidal Integration In Python