Using scipy.quad with iε trick: Bad results
In order to circumvent the cauchy principle value, I tried to integrate an integral using a small shift iε into the complex plane to evade the pole. However, as can be inferred from the figure below, the result is pretty bad. The code for this result is shown below. Do you have ideas how to improve this method? Why is it not working? I already tried changing ε or the limit in the integral. Edit: I included the method "cauchy" with the principle value, which seems not to work at all. import matplotlib.pyplot as plt from scipy.integrate import quad import numpy as np def cquad(func, a, b, *