Evaluate $\int_{-\infty}^{\infty}\frac{\sqrt{a+ix}}{a^2+x^2}\,dx$ using residue calculus

I'm asked to evaluate $$\int_{-\infty}^{\infty}\frac{\sqrt{a+ix}}{a^2+x^2}\,dx$$ $\mathbb{R}\ni a>0$, using residue calculus (where $\sqrt{\cdot}$ is the PV $\sqrt{}$). My approach is as follows:

By solving $a+iz=-\alpha, \mathbb{R}\ni\alpha>0$ we find that the branch cut of $\sqrt{a+ix}$ is the line $ia+i\alpha$.

Then we verify that $\lim_{R\to\infty}\max_{|z|=R}\frac{\sqrt{a+iz}}{a^2+z^2}R=0$

From these $2$ facts we can conclude that we can close the contour in the bottom half plane, and find $$\int_{-\infty}^{\infty}\frac{\sqrt{a+ix}}{a^2+x^2}\,dx=-2\pi i\text{Res}_{z=-ai}\frac{\sqrt{a+ix}}{a^2+x^2}=\frac{\sqrt{2}\pi}{\sqrt{a}}$$

However, the problem is that when I try to verify this using Mathematica, it seems to be wrong:

Integrate[Sqrt[a + I*x]/(a^2 + x^2), {x, -Infinity, Infinity}]
ConditionalExpression[-(1/(  8 Sqrt[2] Sqrt[a] \[Pi]^(   3/2)))(MeijerG[{{1/2, 3/4, 5/4}, {}}, {{0, 1/2, 1/2}, {}}, -1, 2] +     MeijerG[{{1/2, 3/4, 5/4}, {}}, {{0, 1/2, 1/2}, {}}, 1,      2]), (Re[a^2] >= 0 || a^2 \[NotElement] Reals) && Re[a] > 0]


At first I thought this is just some way to complicated way of writing $\frac{\sqrt{2}\pi}{\sqrt{a}}$, but that does not seem to be the case. For example for $a=2$ my answer is $\pi$ while Mathematica's answers is $3.965.. +0.491...i$. Now I would think my answer is correct, since the imaginary part of the function is odd, so we would expect the integral to have imaginary part $0$.

Any help would be much appreciated. I'm looking for either: the mistake in my answer, or an explanation for why Mathematica is giving the wrong answer.

Thanks.

Edit: I'm pretty sure this is a bug in Mathematica at this point, especially considering the following result:

a = 2;
N[Integrate[Sqrt[a + I*x]/(a^2 + x^2), {x, -Infinity, Infinity}]]
NIntegrate[Sqrt[a + I*x]/(a^2 + x^2), {x, -Infinity, Infinity}]
3.96542 + 0.491097 I
3.14159 + 0. I


So the numeric solver does agree with my answer, while the symbolic solver just seems to be wrong. Unfortunate; I didn't expect Mathematica to have bugs like this, although I think it's inevitable in an application that big.

• According to Mathematica, $I(a)~=~\pi~\sqrt{1+\dfrac1a}~.~$ Maple, however, agrees with your result. – Lucian Jun 16 '15 at 21:59
• @Lucian What version of Mathematica are you using? I'm using 10 and got the output I mention in the question. – user2520938 Jun 17 '15 at 5:03
• Version $5$. :-$)$ – Lucian Jun 17 '15 at 5:38
• i get $I(a)=\frac{(1+i) \pi }{\sqrt{a}}$ which agrees quite well with numerical calculations – tired Jun 17 '15 at 16:11
• @tired Using what program/reasoning do you get that result? – user2520938 Jun 17 '15 at 17:36