If I may use contours to show this one.
Consider $\displaystyle I=\frac{z^{a}}{z^{2}-2z\cos(b)+1}, \;\ 0<a<1, \;\ 0<b<\pi$
Use a semicircle in the UHP with center at origin.
The poles lie at $z=e^{\pm ib}=\cos(b)\pm i\sin(b)$
Along the x axis:
$$\int_{-\infty}^{0}\frac{x^{a}}{x^{2}-2x\cos(b)+1}dx+\int_{0}^{\infty}\frac{x^{a}}{x^{2}-2x\cos(b)+1}dx$$
Let $x\to -x$ in the first integral and get:
$$\int_{0}^{\infty}\frac{x^{a}}{x^{2}-2x\cos(b)+1}dx+\int_{0}^{\infty}\frac{(-1)^{a}x^{a}}{x^{2}+2x\cos(b)+1}dx, \;\ e^{\pi ia}=(-1)^{a}$$
Round the big arc:
$$\int_{0}^{\pi}\frac{R^{a}e^{ia\theta}iRe^{i\theta}}{R^{2}e^{2i\theta}-2Re^{i\theta}\cos(b)+1}d\theta$$
which, since $a<1$, vanishes as $R\to 0$
By using $z=e^{ib}+re^{i\phi}$, the residue at $e^{ib}$ is
$$2\pi i Res(e^{ib})=2\pi i \lim_{r\to 0}\frac{(e^{ib}+re^{i\phi})^{a}}{e^{ib}+re^{i\phi}-e^{-ib}}$$
$$=\frac{2\pi i e^{iab}}{e^{ib}-e^{-ib}}=\frac{\pi}{\sin(b)}e^{iab}$$
Thus,
$$\int_{0}^{\infty}\frac{x^{a}}{x^{2}-2x\cos(b)+1}dx+e^{i\pi a}\int_{0}^{\infty}\frac{x^{a}}{x^{2}+2x\cos(b)+1}dx=\frac{\pi}{\sin(b)}e^{iab}$$
Equate real and imaginary parts:
$$\int_{0}^{\infty}\frac{x^{a}}{x^{2}-2x\cos(b)+1}dx+\cos(\pi a)\int_{0}^{\infty}\frac{x^{a}}{x^{2}+2x\cos(b)+1}dx=\frac{\pi}{\sin(b)}\cos(ab)$$
and $$\sin(\pi a)\int_{0}^{\infty}\frac{x^{a}}{x^{2}+2x\cos(b)+1}dx=\frac{\pi}{\sin(b)}\sin(ab)$$
Hence, we have a two for one:
$$\int_{0}^{\infty}\frac{x^{a}}{x^{2}+2x\cos(b)+1}dx=\frac{\pi}{\sin(b)}\frac{\sin(ab)}{\sin(\pi a)}$$ and
$$\int_{0}^{\infty}\frac{x^{a}}{x^{2}-2x\cos(b)+1}dx=\frac{\pi}{\sin(b)}\frac{\sin(a(\pi -b))}{\sin(\pi a)}$$
The last one follows from the first from writing $\pi -b$ for $b$.