import numpy as np
from scipy import integrate, special
print(integrate.quad(lambda x: 1 + np.sin(x), -1, 1, weight='cauchy', wvar=0))
print(2 * special.sici(1)[0])
Python: Find principal value of an integral numerically