# Numerical contour integral

I am trying to compute the double integral for fixed $$m,z>0$$:

  (2Pi I)^{-1} Integrate[(Gamma[y/2] Sqrt[Gamma[3 - y]/Gamma[y]])/
Gamma[(3 - y)/2] z^(3 - y)
(Exp[-m x] - 1) x^(y - 3)/x, {x, 0, ∞},{y,
3/2 - I ∞, 3/2 + I ∞}]


The integral over $$x$$ can be done analytically, and the result depends on the product $$mz$$, so there is effectively just one parameter. The $$x$$ integral needs to be split into two regions I suspect, and in one region the contour of the $$y$$ integral would need to be deformed so that it remains convergent. Since the $$y$$ integral involves complicated branch cuts, I wanted to be able to do it numerically for a range of $$mz$$, to get a least a few digits of precision. I am having difficulty getting stable results numerically tho.

I don't think this integral converges: just looking at the $$x$$-integration,

Assuming[m > 0 && z > 0 && Element[q, Reals],
Integrate[((E^(-m*x)-1)*x^(y-4)*z^(3-y)*Gamma[y/2]*
Sqrt[Gamma[3-y]/Gamma[y]])/Gamma[(3-y)/2] /.
y->3/2+I*q,
{x, 0, ∞}]]

(*    diverges    *)


It only seems to converge if $$\text{Re}(y)$$ is in the interval $$[2,3]$$:

Assuming[m > 0 && z > 0,
Integrate[((E^(-m*x)-1)*x^(y-4)*z^(3-y)*Gamma[y/2]*
Sqrt[Gamma[3-y]/Gamma[y]])/Gamma[(3-y)/2],
{x, 0, ∞}]]

(*    (m^(3-y)*z^(3-y)*Gamma[y-3]*Gamma[y/2]*Sqrt[Gamma[3-y]/Gamma[y]])/Gamma[(3-y)/2]
if 2 < Re[y] < 3                                                                  *)


Using this latter result:

f[m_, z_, y_] =
Assuming[m > 0 && z > 0 && 2 < Re[y] < 3,
Integrate[((E^(-m*x)-1)*x^(y-4)*z^(3-y)*Gamma[y/2]*Sqrt[Gamma[3-y]/Gamma[y]])/Gamma[(3-y)/2],
{x, 0, ∞}]]

(*    ((m*z)^(3-y)*Gamma[y-3]*Gamma[y/2]*Sqrt[Gamma[3-y]/Gamma[y]])/Gamma[(3-y)/2]    *)


we can define the desired integral as

F[mz_?NumericQ, Ry_?NumericQ] :=
2*I*NIntegrate[Re[f[mz, 1, Ry + I t]], {t, 0, ∞}]


making use of some symmetries of f: it only depends on the product $$m\cdot z$$, not on $$m$$ and $$z$$ individually; it is symmetric in $$t$$ so we can restrict the integral to $$[0,∞)$$ (but take it twice); and the result will be purely imaginary so we only integrate the real part of the integrand.

We can now plot, for example, the result for Ry = Re[y] = 5/2: (plotting the imaginary part)

Plot[F[mz, 5/2]/I, {mz, 0, 10}]


We can be adventurous and set Ry = Re[y] = 3/2 by analytic continuation:

Plot[F[mz, 5/2]/I, {mz, 0, 10}]


• i think it converges if you deform the contour of the $y$ appropriately in the relevant regime of $x$. in particular, for large $x>$ the $y$ integral is convergent and does not need to be deformed. for small $x$ one just needs to shift the real part of the contour as you said, which as long as this shift does not cross any branch cuts or poles, it should not affect the answer. – esches Oct 19 '20 at 9:02
• in paritcular, the question is: after deforming the real part of $y$ to the interval $[2,3]$, what finite contributions from poles/branch-cuts would need to be added? also, within the manifestly convergent region, how can i get numerically stable results? even in that region, i cant get stable results from the numerical integral. – esches Oct 19 '20 at 12:50
• My complex analysis skills are too rusty to answer your questions, sorry. Maybe try on the math stackexchange? – Roman Oct 19 '20 at 13:45
• well lets assume the real part IS between 2 and 3. in that case, how can i get a numerically convergent result for the integral? bc even in that case, i am unable to get a stable result (this is more a numerical issue than a mathematical, i think) – esches Oct 19 '20 at 13:55
• @esches please see update. – Roman Oct 19 '20 at 20:40