I am stuck on this complex analysis homework problem :( here is my attack so far:
If I integrate around a keyhole contour, I can show that $$\int_0^{\infty}\frac{x^a}{x^2+1}dx=\frac{2\pi i}{1-e^{2a\pi i}}\sum_{w\in\{i,-i\}}RES(\frac{e^{a\log z}}{z^2+1},w).$$ Now, luckily the poles in this integrand are simple, so it's easy enough to find: $$RES(\frac{e^{a\log z}}{z^2+1},i)=\frac{e^{a\pi i/2}}{2i},$$ while $$RES(\frac{e^{a\log z}}{z^2+1},-i)=\frac{-e^{-a\pi i/2}}{2i},$$ and adding these fellas together we get $\sin(a\pi/2)$ by Euler's i.d. So it goes $$\int_0^{\infty}\frac{x^a}{x^2+1}dx=\frac{2\pi i\sin(a\pi/2)}{1-e^{2a\pi i}}.$$ But where to go now? The integral on the left is real, while I have my doubts about the term on the right.
Have I made a mistake, or there's some further trick I don't see? (I'm almost certain it's the former, since I'm an expert at mistakes but an amateur at finding them). Anyways, I would appreciate any help, or advice on this problem. Thanks!
The trick to this one? You've got the wrong residues. We have to use the same branch of the function in calculating the residues that we did in setting up the integral. Specifically, since we run $\arg z$ from $0$ to $2\pi$, we should write the two zeros of the denominator as $i=\exp\left(\frac{\pi i}{2}\right)$ and $-i=\exp\left(\frac{3\pi i}{2}\right)$. The residues are then $\frac1{2i}e^{a\pi i/2}{2i}$ and $\frac{-1}{2i}e^{3a\pi i/2}$.
That leads to a factor of $e^{a\pi i}$ in the numerator. Divide through by it, the denominator becomes $i$ times a sine, and it all comes out real.