I have tried to evaluate $\int_0^\infty \dfrac{x^\alpha}{(x^2 + 1)^2}\ dx$ for $-1 < \alpha < 3$ using the keyhole contour, but am not sure about my working, especially in defining the analytic branch of log $z$ when we consider the function $f(z) = \dfrac{z^\alpha}{(z^2 + 1)^2}$ where $z^\alpha = e^{\alpha\text{log}\ z}$. Below is my working:
Using the keyhole contour $K_{\varepsilon,M}$ and considering the complex function $\dfrac{z^\alpha}{(z^2 + 1)^2}$, we inspect the integral of the function over each part of the contour (namely $C_{\varepsilon},C_M, I_1$ and $I_2$) in the limit $\varepsilon \to 0,\ M \to \infty$. For $C_{\varepsilon}$, we have $|z^2 +1|$ to be the modulus of points lying on a circle of radius $\varepsilon^2$ centered at $z = 1$ and hence $|z^2 + 1| > 1/2$ for $\varepsilon$ small enough (e.g. $\varepsilon^2 < 1/2$). We thus have: \begin{align*} \int_{C_{\varepsilon}} \dfrac{z^\alpha}{(z^2 + 1)^2}\ dz \ll \pi\varepsilon\ \text{max}_{C_\varepsilon}\bigg|\dfrac{z^\alpha}{(z^2 + 1)^2}\bigg| \ll 4\pi\varepsilon^{\alpha + 1} \Rightarrow \lim_{\varepsilon \to 0}\int_{C_{\varepsilon}} \dfrac{z^\alpha}{(z^2 + 1)^2}\ dz = 0 \end{align*} For any $z \in C_M$, we have $|z^2 + 1| \geq |z^2| = M^2$ for $M$ big enough. We thus have: \begin{align*} \int_{C_M} \dfrac{z^\alpha}{(z^2 + 1)^2}\ dz \ll 2\pi M \ \text{max}_{C_M}\bigg|\dfrac{z^\alpha}{(z^2 + 1)^2}\bigg| \ll 2\pi M^{\alpha - 3} \Rightarrow \lim_{M \to \infty}\int_{C_M} \dfrac{z^\alpha}{(z^2 + 1)^2}\ dz = 0 \end{align*} For $I_1$, we have $\begin{aligned} = \lim_{\varepsilon \to 0,\ M \to \infty}\int_{I_1}\dfrac{z^\alpha}{(z^2 + 1)^2}\ dz = \int_0^\infty \dfrac{x^\alpha}{(x^2 + 1)^2}\ dx \end{aligned}$. As for $I_2$, we have $z^\alpha = e^{\alpha(\text{ln}x + 2\pi i)} = x^{\alpha}e^{2\pi i\alpha}$, and hence we have $\begin{aligned} = \lim_{\varepsilon \to 0,\ M \to \infty}\int_{I_2}\dfrac{z^\alpha}{(z^2 + 1)^2}\ dz = -e^{2\pi i\alpha}\int_0^\infty \dfrac{x^\alpha}{(x^2 + 1)^2}\ dx \end{aligned}$. Then, by the Residue Theorem, we have: \begin{align*} \int_0^\infty \dfrac{x^\alpha}{(x^2 + 1)^2}\ dx &= \frac{2\pi i}{1 - e^{2\pi i\alpha}}\sum_k \text{Res}\bigg(\dfrac{z^\alpha}{(z^2 + 1)^2}; z_k\bigg) \\ &= \frac{2\pi i}{1 - e^{2\pi i\alpha}}\bigg(\lim_{z \to i} \frac{d}{dz}\bigg(\dfrac{z^\alpha}{(z + i)^2}\bigg) + \lim_{z \to -i} \frac{d}{dz}\bigg(\dfrac{z^\alpha}{(z - i)^2}\bigg)\bigg) \\ &= \frac{2\pi i}{1 - e^{2\pi i\alpha}}\bigg(\frac{\alpha -1}{4}i^{\alpha -3} + \frac{\alpha -1}{4}(-i)^{\alpha -3}\bigg) \\ &= \frac{\pi i(\alpha -1)\text{cos}(\pi(\alpha - 3)/2)}{1 - e^{2\pi i\alpha}} \end{align*}
where the keyhole contour is given as !Keyhole Contour 1
Any help in correcting my working or giving hints or posting your solution is appreciated.