How to integrate the following? $\int_{0}^{+\infty}\frac{1-\cos x}{x^{\alpha+1}}\,dx$ 
$$2\alpha\int_{0}^{\infty}\frac{1-\cos{x}}{x^{\alpha+1}}dx=?$$

I know that it should be solved by integrating on a contour of two semicircles with radius $\epsilon$ and $T$, and the real line. Then as $\epsilon\to0$ and $T\to\infty$ it should be the value of residue. How can I calculate the residue?
Note: I checked with wolframalpha, and it should be $$-\cos\left(\frac{\pi\alpha}{2}\right)\Gamma\left(-\alpha\right).$$
 A: Let $I(\alpha)$ be the integral
$$I(\alpha)=2\alpha\int_0^\infty \frac{1-\cos(x)}{x^{1+\alpha}}\,dx \tag 1$$
for $0<\alpha<2$.  Integrating $(1)$ by parts with $u=1-\cos(x)$ and $v=-\frac{1}{\alpha x^{\alpha}}$ reveals
$$I(\alpha)=2\int_0^\infty \frac{\sin(x)}{x^\alpha}\,dx \tag 2$$
Now, moving to the complex plane, we analyze the closed contour integral
$$J(\alpha)=\oint_C \frac{e^{iz}}{z^\alpha}\,dz \tag 3$$
where $C$ is comprised of (i) the segment on the real line from $\epsilon$ to $R$, (ii) the quarter circle with radius $R$, centered at the origin, from $R$ to $iR$, (iii) the line segment along the imaginary axis from $iR$ to $i\epsilon$, and (iv) the quarter circle with radius $\epsilon$, centered at the origin, from $i\epsilon$ to $\epsilon$.
With the branch cut chosen as the line along the non-positive real axis, from $0$ to $-\infty$, the integrand in $3$ is analytic in and on $C$.  Then, Cauchy's Integral Theorem guarantees that $J(\alpha)=0$.  Therefore, we have for $R>\varepsilon>0$
$$\begin{align}
0&=\int_\varepsilon^R \frac{e^{ix}}{x^\alpha}\,dx+iR^{1-\alpha}\int_0^{\pi/2}e^{iR e^{i\phi}}e^{i(1-\alpha)\phi}\,d\phi \\\\&
-e^{i(1-\alpha) \pi/2}\int_\varepsilon^R \frac{e^{-y}}{y^\alpha}\,dy-i\varepsilon^{1-\alpha}\int_0^{\pi/2}e^{i\varepsilon e^{i\phi}}e^{i(1-\alpha)\phi}\,d\phi\tag4
\end{align}$$
In the limit as $R\to \infty$ the contribution to $J(\alpha)$ from the integration along the quarter circle with radius $R$ vanishes.  Hence, we find from $(4)$ that
$$\begin{align}
0&=\int_\varepsilon^\infty \frac{e^{ix}}{x^\alpha}\,dx -e^{i(1-\alpha) \pi/2}\int_\varepsilon^\infty \frac{e^{-y}}{y^\alpha}\,dy-i\varepsilon^{1-\alpha}\int_0^{\pi/2}e^{i\varepsilon e^{i\phi}}e^{i(1-\alpha)\phi}\,d\phi\\\\
&=\int_\varepsilon^\infty \frac{e^{ix}}{x^\alpha}\,dx-\frac{e^{i(1-\alpha) \pi/2}}{1-\alpha}\int_\varepsilon^\infty \frac{e^{-y}}{y^{\alpha-1}}\,dy \\\\
&+\frac{e^{i(1-\alpha) \pi/2}e^{-\varepsilon}\varepsilon^{1-\alpha}}{1-\alpha}-i\varepsilon^{1-\alpha}\int_0^{\pi/2}e^{i\varepsilon e^{i\phi}}e^{i(1-\alpha)\phi}\,d\phi\tag5
\end{align}$$
Taking the imaginary part of $(5)$ and letting $\varepsilon\to 0^+$ yields
$$\begin{align}
\int_0^\infty \frac{\sin(x)}{x^\alpha}\,dx&=\frac{\cos(\pi\alpha/2)}{1-\alpha}\Gamma(2-\alpha)\\\\
&=\cos(\alpha \pi/2)\Gamma(1-\alpha)\\\\
&=-\alpha \cos(\alpha \pi/2)\Gamma(-\alpha)\tag6
\end{align}$$
where we applied twice in succession the functional equation $\Gamma (1+x)=x\Gamma(x)$ to arrive at $(6)$.  Finally, we have
$$\bbox[5px,border:2px solid #C0A000]{2\alpha \int_0^\infty \frac{1-\cos(x)}{x^{1+\alpha}}\,dx=-2\alpha \cos(\alpha \pi/2)\Gamma(-\alpha)}$$
as was to be shown!
A: We have:
$$ I(\alpha) = 2\alpha\int_{0}^{+\infty}\frac{1-\cos x}{x^{\alpha+1}}\,dx  \stackrel{IBP}{=} 2\int_{0}^{+\infty}\frac{\sin x}{x^{\alpha}}\,dx$$
but since $\mathcal{L}(\sin x) = \frac{1}{1+s^2}$ and $\mathcal{L}^{-1}(x^{-\alpha})=\frac{s^{\alpha-1}}{\Gamma(\alpha)}$ we also have:
$$ I(\alpha) = \frac{2}{\Gamma(\alpha)}\int_{0}^{+\infty}\frac{s^{\alpha-1}}{s^2+1}\,ds $$
and the last integral is a value of the Euler beta function. 
By the reflection formula for the $\Gamma$ function the claim follows.
