Evaluating an integral using Gamma function For $r \in (0,2)$, I would like to evaluate the integral
$$\frac{2}{r} \int_0^{\infty} \frac{\sin(u)}{u^r} du.$$
The answer should be 
$$\frac{\pi \cdot \mathrm{cosec}{\frac{r\pi}{2}} }{\Gamma(r+1)}. $$
Many thanks for your help. 
 A: Write
$$\int_0^{\infty} du \frac{\sin{u}}{u^r} = \operatorname{Im}{\left [ PV \int_0^{\infty} du \, u^{-r} e^{i u} \right ]} $$
Now consider the contour integral
$$\oint_C dz \, z^{-r} e^{i z} $$
where $C$ is a 90-degree circular wedge of radius $R$ in the first quadrant of the complex plane, with a quarter circle of radius $\epsilon$ cut out at the origin.  Then the contour integral is equal to
$$\int_{\epsilon}^R dx \, x^{-r} \, e^{i x} + i R \int_0^{\pi/2} d\theta\, e^{i \theta} R^{-r} \, e^{-i r \theta} e^{i R e^{i \theta}} \\ + i \int_R^{\epsilon} dy \, e^{-i \pi r/2} y^{-r} e^{-y} + i \epsilon \int_{\pi/2}^0 d\theta\, e^{i \theta} \epsilon ^{-r} \, e^{-i r \theta} e^{i \epsilon e^{i \theta}}$$
The second integral vanishes as $R \to \infty$ because its magnitude is bounded by
$$R^{-(r-1)} \int_0^{\pi/2} d\theta \, e^{-R \sin{\theta}} \le R^{-(r-1)} \int_0^{\pi/2} d\theta \, e^{-2 R \theta/\pi} \le \frac{\pi}{2 R^{r}} $$
which vanishes as $r \gt 0$.  Now, as $\epsilon \to 0$, the fourth integral behaves as
$$i \epsilon^{1-r} \int_{\pi/2}^0 d\theta \, e^{-i (r-1) \theta} \left [ 1+ O(\epsilon) \right ] = \frac{\epsilon^{1-r}}{1-r} \left ( 1-i e^{-i \pi r/2}\right ) + O(\epsilon^{2-r}) $$
There are two cases. 
1) When $r \gt 1$, there is an apparent singularity at the origin, but this will cancel out with another from the other integrals.
Now, rewrite
$$\int_{\epsilon}^{\infty} dx \, x^{-r} \, e^{i x} = \int_{\epsilon}^\infty dx \, x^{-r} \, (e^{i x}-1) + \int_{\epsilon}^\infty dx \, x^{-r} = \int_{\epsilon}^\infty dx \, x^{-r} \, (e^{i x}-1) - \frac{\epsilon^{1-r}}{1-r}$$
Similarly,
$$i \int_{\infty}^{\epsilon} dy \, e^{-i \pi r/2} y^{-r} e^{-y} = i \int_{\infty}^{\epsilon} dy \, e^{-i \pi r/2} y^{-r} (e^{-y}-1) + i e^{-i \pi r/2} \frac{\epsilon^{1-r}}{1-r} $$
Note that the sum of the two integrated pieces cancels out the singular piece from the fourth integral.  The remaining integrals indeed converge as $\epsilon \to 0$ and we have that the contour integral is finally equal to
$$ -\int_{0}^\infty dx \, x^{-r} \, (1-e^{i x}) + i e^{-i \pi/2} \int_{0}^\infty dy \, y^{-r} (1-e^{-y}) $$
By Cauchy's theorem, the contour integral is zero.  Thus, taking imaginary parts, we finally have
$$\begin{align}\int_{0}^\infty dx \, x^{-r} \sin{x} &= - \cos{\left ( \frac{\pi r}{2}\right )} \int_{0}^\infty dy \, y^{-r} (1-e^{-y})\\ &=  - \cos{\left ( \frac{\pi r}{2}\right )} \int_{0}^{\infty} dy \, y^{1-r} \, \int_0^1 du \, e^{-y u}\\ &= - \cos{\left ( \frac{\pi r}{2}\right )} \int_0^1 du \, \int_0^{\infty} dy \, y^{1-r} e^{-y u} \\ &= - \cos{\left ( \frac{\pi r}{2}\right )}  \Gamma(2-r) \int_0^1 du \, u^{r-2} \\ &= \cos{\left ( \frac{\pi r}{2}\right )}  \Gamma(1-r)  \end{align}$$
2) When $r \lt 1$, there is no singular piece.  Thus, by Cauchy's theorem, and taking imaginary parts, we may write that
$$\int_{0}^\infty dx \, x^{-r} \sin{x} =  \cos{\left ( \frac{\pi r}{2}\right )} \int_0^{\infty} dy \, y^{-r} e^{-y} =  \cos{\left ( \frac{\pi r}{2}\right )} \Gamma(1-r) $$
The answer is the same in both cases.  When we apply the reflection formula, we find that
$$\cos{\left ( \frac{\pi r}{2}\right )} \Gamma(1-r) = \frac{\pi \cos{\left ( \frac{\pi r}{2}\right )}}{\sin{(\pi r)}\, \Gamma(r)} = \frac{\pi r}{ 2 \sin{\left ( \frac{\pi r}{2}\right )} \Gamma(1+r)}$$

$$\frac{2}{r} \int_{0}^\infty dx \, x^{-r} \sin{x} = \frac{\pi}{ \sin{\left ( \frac{\pi r}{2}\right )} \Gamma(1+r)}  $$

as was sought.
A: Hint: Use Euler's formula in conjunction with the well-known integral expression for the $\Gamma$ function, and then employ the reflection formula.
A: Write
$$ \frac{1}{ru^r} = \frac{1}{\Gamma(r+1)}\int_0^{\infty} \alpha^{r-1} e^{-u\alpha} \, d\alpha. $$
Then your integral becomes, after swapping the order of integration,
$$ \frac{2}{\Gamma(r+1)} \int_0^{\infty} \alpha^{r-1} \left( \int_0^{\infty} e^{-u\alpha} \sin{u} \, du \right) \, d\alpha. $$
Now, we can do the internal integral by integration by parts or using the complex expansion of the sine. Either way, the inside integral is $\frac{1}{1+\alpha^2}$, so we're down to
$$ \frac{2}{\Gamma(r+1)} \int_0^{\infty} \frac{\alpha^{r-1}}{1+\alpha^2} \, d\alpha $$
Change variables, $u=\alpha^2$, $du/u = 2\, d\alpha/\alpha$ and this turns into
$$ \frac{1}{\Gamma(r+1)}\int_0^{\infty} \frac{u^{r/2-1}}{1+u} \, du $$
The remaining integral is well-known (turn it into the beta function, or do this), and gives the cosecant, so the final answer is
$$ \frac{\pi \operatorname{cosec}{(\pi r/2)}}{\Gamma(r+1)} $$

And curiously, the way the question is written, either this or Ron Gordon's answer could be what is wanted...
