# Performing a contour integration in Mathematica for a contour starting at $1$ and ending at $-\infty$ while avoiding the origin?

I would like to compute the following integral $$I(k)$$ in Mathematica to check if the result equals something I 'feel' is correct but I have no experience with contour integrals in Mathematica.

I want to compute $$I(k) = \frac{k}{4\pi}\int_\gamma \log(t) \frac{1}{\sqrt{1-t}} J_1(k\sqrt{1-t}) dt,$$ where $$k > 0$$, $$J_1$$ is the Bessel function of the first kind and where $$\gamma$$ is a contour starting at $$1$$ and ending at $$-\infty$$ which does not contain the origin.

I have a feeling this should have some relation to the function $$H_0^{(1)}(k)$$ which is the is the Hankel function of the first kind of order $$0$$.

Edit: I noticed I was missing the $$\log(t)$$ term in the integral after a comment by Carl.

• Just write down all intermediate points inside Integrate iterator. For example, answ= 1 - k/2 Integrate[ 1/Sqrt[1 - t] BesselJ[1, k Sqrt[1 - t]], {t, 1, 1/2, I/2, -I/2, -1/2, -Infinity}, Assumptions -> k > 0] After simplification it yields answ=2. – user18792 Jul 20 '19 at 15:17
• Since you effectively changed the question completely due to the missing term, I suggest starting a new question with the correct integral. Otherwise, It is not fair to the person who answered you using your original integral, and keep this question the way it was before. – Nasser Jul 21 '19 at 4:36
• They didn't answer my question my question which specifically was on how to integrate from $-\infty$ to $1$ while avoiding the origin, i.e. how to do contour integration. Their answer features an incorrect path of integration - integration from $-\infty$ to $0$ which is just a standard line integral, something I already know how to do. However, their subsequent comment was helpful as it made we realise I was missing a term in the integral. – sonicboom Jul 21 '19 at 6:08

Mathematica can do the integral analytically:

1 - k/2 Integrate[1/Sqrt[1-t] BesselJ[1, k Sqrt[1-t]], {t, -Infinity, 0}, Assumptions->k>0]


1 - BesselJ[0, k]

I believe the $$H_0^1$$ function you are referring to is called the HankelH1 function in Mathematica (check the Wolfram Language code in the copyable plain text button in the WA link you provided). In that case, note:

FunctionExpand[HankelH1[0, k]]


BesselJ[0, k] + I BesselY[0, k]

So, your integral is related by the equation $$i(k)=1-\Re(H_0^{(1)}(k))$$.

• Thanks but the contour actually has to 'arc around' 0, i.e., it has to go from $-\infty$ to $1$ without passing over zero. – sonicboom Jul 20 '19 at 17:26
• @sonicboom Since your function has no singularity at the origin, why are you trying to 'arc around' it? – Carl Woll Jul 20 '19 at 17:47
• You are correct, I just realised I am missing a $\frac{1}{2\pi}\log(t)$ in the integral! I will edit my original post. – sonicboom Jul 20 '19 at 19:23
• I am now back home and have access to Mathematica. It seems it can't evaluate the integral at all now that I have included the logarithmic term. Even just trying to evaluate the indefinite integral is failing, I might have to just try and do it numerically with NIntegrate and plot it instead. – sonicboom Jul 20 '19 at 19:30