I'm calculating the upper incomplete gamma function using Python's mpmath.gammainc
:
import numpy as np
from mpmath import gammainc
z = 0 # define power of t as t^(-1)
a = 0.5+0.4j # integral lower limit
b = np.inf # integral upper limit
myfun = np.array([gammainc(z,a,b,regularized=False)], dtype=complex)
It is a one-dimensional integral as defined in the mpmath docs. I want to compare this result myfun
using scipy's quad
function:
myfun2 = scipy.integrate.quad(exp(-t)/t, a, inf)[0]
However I don't think quad
accepts complex arguments for the upper/lower bounds of integration. I don't know if it's possible to separate the problem into real/imaginary parts. Any ideas?