Proof of $\int_0^\infty \frac{x^{\alpha}dx}{1+2x\cos\beta +x^{2}}=\frac{\pi\sin (\alpha\beta)}{\sin (\alpha\pi)\sin \beta }$ I found a nice formula of the following integral here

$$\int_0^\infty \frac{x^{\alpha}dx}{1+2x\cos\beta +x^{2}}=\frac{\pi\sin (\alpha\beta)}{\sin (\alpha\pi)\sin \beta }$$

It states there that it can be proved by using contours method which I do not understand. It seems that the RHS is Euler's reflection formula for the gamma function but I am not so sure. Could anyone here please help me how to obtain it preferably (if possible) with elementary ways (high school methods)? Any help would be greatly appreciated. Thank you.

Decomposing the integral into two, we have
$$
I= \int_0^{\infty} \frac{x^\alpha}{1+2 x \cos \beta+x^2} d x=\frac{1}{e^{\beta i}-e^{-\beta i}} \int_0^{\infty}\left(\frac{x^\alpha}{x+e^{-\beta i}}-\frac{x^\alpha}{x+e^{\beta i}}\right) d x
$$
Putting $u=\frac{x}{e^{\beta i}}$ transforms the second integral into
\begin{aligned} \int_0^{\infty} \frac{x^x}{x+e^{\beta i}} d x & =\int_0^{\infty} \frac{\left(e^{\beta i} u\right)^\alpha}{u+1} d u \\ & =e^{\alpha \beta i} \int_0^{\infty} \frac{u^\alpha}{u+1} d u \\ & =e^{\alpha \beta i} B(\alpha+1,-\alpha) \\ & =-\frac{\pi e^{\alpha \beta i}}{\sin (\pi \alpha)}\end{aligned}
Similarly, we get the first one by replacing $\beta$ by $-\beta$.
$$\int_0^{\infty} \frac{x^\alpha}{x+e^{-\beta i}} d x = -\frac{\pi e^{-\alpha \beta i}}{\sin (\pi \alpha)}$$
Plugging them together yields
$$
\boxed{I=\frac{1}{2 i \sin \beta} \frac{\pi}{\sin (\alpha \pi)}\left(e^{\alpha \beta i}-e^{-\alpha \beta i}\right)=\frac{\pi \sin (\alpha \beta)}{\sin (\alpha \pi) \sin \beta}}$$
