I have to show that:

$$ \int_{0}^{\infty} \frac{x^{-p}}{x^2+2x\cos\theta +1}\,dx = \frac{\pi \sin (p\theta)}{\sin (p\pi) \sin(\theta)}$$

for $0<p<1$ and $0 < \theta < \pi$.

We can write the denominator as $(x+e^{i\theta})(x+e^{-i\theta})$ and I now want to evaluate this integral using contour integration. However, I have no idea how to do this...