# Calculate integral with $z^a$ using residue theorem

I am trying to solve the following:

Find $\int_0^\infty \frac{x^a}{x^2+3x+2}dx$ for $0<a<1$ by using the residue theorem.

I thought to let $f(z)=\frac{z^a}{z^2+3z+2}$ and by taking the branch cut on $\mathbb C$ minus the positive reals, I could integrate over the keyhole contour formed by a circle of radius R with the keyhole lying on the positive reals and an epsilon ball around 0 (I can include a picture if this is not clear enough).

If I calculated my residues at $-2$ and $-1$ correctly, then the integral over the entire contour should be $-2^a(2\pi i)$. The integrals over the circular parts should go to 0. But I am having trouble making the integrals over the horizontal line segments look like the original integral I wanted to calculate; I know they’re not supposed to cancel each other out but I can’t figure out how to combine them correctly. Any tips would be appreciated!

On the "upper" part of the branch cut, $z^a=x^a$, while on the lower part, $z^a=x^a\,e^{i2\pi a}$.
$$(1-e^{i2\pi a})\int_0^\infty \frac{x^a}{x^2+3x+2}\,dx=2\pi i \times \text{Sum of the Residues}$$
Now, check.your calculation of the residues. On the negative real axis $z^a=|x|^a e^{i\pi a}$
• Ahh, gotcha. I realize I had my contour wrong: I had only been considering horizontal line segments but I see now that I should’ve been looking at radial line segments, where the angle is a third parameter $\delta$ that tends to 0. And yes, my residue calculations were wrong. Thanks! – CFish Aug 11 '18 at 21:06