TITLE: How can I find the Cauchy Principal Value of this integral using complex analysis?
QUESTION [5 upvotes]: I'm supposed to solve the real integral using a contour integral (The Cauchy Principal Value). Can someone give me a hand? I cannot seem to be able to do it...
This is what I've tried so far:

I tried computing the contour integral first using the Residue theorem. I simplified the total residue to :$$-\cos(\pi a) - i\sin(\pi a)$$
I also tried showing that the part of the integral that doesn't lie on the real line goes to zero as $R$ goes to infinity. (where $R$ is the bound on the integral). I tried using the ML equality in combination with the triangle equality to no avail.

Thank you.

REPLY [3 votes]: After we have agreed that this is just an ordinary integral, the rest is not tough:
Let's denote the four paths by $I_1,I_2,I_3,I_4$ where $I_1$ corresponds to the integral in question, $I_2, I_4$ are the parts parallel to the imaginary axis and $I_3$ is the horizontal one which passes $z=2\pi i$. 
Using the contour above, we easily see that the horizontal parts only differ by phase so $$
I_3=-e^{2\pi a i}I_1
$$
Furthermore it's easy to show that $I_2,I_4$ are vanishing in the limit $|r|\rightarrow\infty$. We can also easily check that there is only one residue at $z=\pi i$ inside the contour. We can conclude that
$$
I_1-e^{2\pi a i}I_1=2\pi i Res[z=i\pi]
$$
Using $Res[z=i\pi]=-i e^{i \pi a}$ we get
$$
I_1=\frac{\pi}{\sin(\pi a)}
$$