My complex integral cancels at the end; how can I modify the integrand to prevent this? $$\int_0^\infty \frac{x^a}{x^2 + b^2}$$
for $-1< a < 1$ and b>0 -- these constraints help with estimating the integral on the big circle and small circle of a keyhole contour that I chose to use.
But in the end, the remaining two integrals over the two straight lines, above and below $R^+$, cancel each other out.
EDIT: as per the comments below, the integrals don't cancel, so I have my final answer as $$\frac {\pi b^{a-1}2i[sin(\frac{\pi a}{2})]}{1-e^{ia2 \pi}},$$
which is still a complex number, unfortunately.  The solution that I compared my work to has the answer of 
$$\frac {\pi b^{a-1}}{2cos(\frac{\pi a}{2})},$$, and it integrated on a simpler, upper semi-circle, while avoiding the branch point at 0.
I am pretty sure my computations over the two straight lines are correct, but I will try again tomorrow, as it is really late here :-(
If the above two solutions are, by inspection, equivalent, please let me know :-)  
Thanks,
 A: The contour encloses the two poles at $\pm i b$, so we find
$$(1 - e^{2\pi i a})\int_0^\infty \frac{x^a}{x^2+b^2}\,dx = 2\pi i \Biggl(\operatorname{Res}\biggl(\frac{z^a}{z^2+b^2}; ib\biggr) + \operatorname{Res}\biggl(\frac{z^a}{z^2+b^2}; -ib\biggr)\Biggr).$$
For the residues, we have
\begin{align}
\operatorname{Res}\biggl(\frac{z^a}{z^2+b^2}; ib\biggr) &= \frac{(ib)^a}{2ib} = b^{a-1}\frac{1}{2i}e^{\pi ia/2},\\
\operatorname{Res}\biggl(\frac{z^a}{z^2+b^2}; -ib\biggr) &= \frac{(-ib)^a}{-2ib} = -b^{a-1}\frac{1}{2i}e^{3\pi ia/2},
\end{align}
since with the chosen branch of $w\mapsto w^a$ we have $(-i)^a = e^{3\pi ia/2}$ - with the branch cut on the positive real half-axis, we chose the branch with $0 < \arg z < 2\pi$, so $-i = e^{3\pi i/2}$. The residue sum is hence
$$\frac{b^{a-1}}{2i}e^{\pi i a/2}(1 - e^{\pi ia})$$
and
$$\int_0^\infty \frac{x^a}{x^2+b^2}\,dx = \frac{\pi b^{a-1}e^{\pi i a/2}(1 - e^{\pi i a})}{1-e^{2\pi ia}} = \frac{\pi b^{a-1} e^{\pi i a/2}}{1+e^{\pi i a}} = \frac{\pi b^{a-1}}{e^{-\pi ia/2} + e^{\pi i a/2}} = \frac{\pi b^{a-1}}{2\cos \frac{\pi a}{2}}.$$
I suspect that you chose the wrong branch to compute $(-i)^a$ in the residue at $-ib$ and got the value
$$-\frac{b^{a-1}}{2i} e^{-\pi i a/2}$$
there, which gives a sum of
$$b^{a-1} \frac{e^{\pi i a/2} - e^{-\pi ia/2}}{2i} = b^{a-1}\sin \frac{\pi a}{2}$$
and thus leads precisely to your erroneous result.
