TITLE: Proving $\int\limits_{0}^{\infty}\frac{1-\text{e}^{-x}\cos(ax)}{x^{r+1}}\operatorname d\!x = \frac{\Gamma(1-r)}{r}(1-a^2)^{r/2} \cos(r \arctan(a))$
QUESTION [5 upvotes]: does anyone have an idea or a guess how to prove the following equation:  
$$\int\limits_{0}^{\infty}\frac{1-\text{e}^{-x}\cos(ax)}{x^{r+1}}\operatorname d\!x = \dfrac{\Gamma(1-r)}{r}(1-a^2)^{\frac{r}{2}} \cos(r \arctan(a))$$
for a fixed real-valued $a$ and  $r \in (0,1)$.
I cannot come up with a way to solve the integral. Thanks!

REPLY [3 votes]: $$
\begin{align}
\int_0^\infty\frac{1-e^{-x}\cos(ax)}{x^{r+1}}\,\mathrm{d}x
&=\mathrm{Re}\left(\int_0^\infty\frac{1-e^{-x(1+ia)}}{x^{r+1}}\,\mathrm{d}x\right)\tag{1}\\
&=\mathrm{Re}\left((1+ia)^r\int_{\gamma(a)}\frac{1-e^{-z}}{z^{r+1}}\,\mathrm{d}z\right)\tag{2}\\
&=\mathrm{Re}\left((1+ia)^r\int_{\gamma(0)}\frac{1-e^{-z}}{z^{r+1}}\,\mathrm{d}z\right)\tag{3}\\
&=\mathrm{Re}\left((1+ia)^r\int_0^\infty\frac{1-e^{-x}}{x^{r+1}}\,\mathrm{d}x\right)\tag{4}\\
&=\mathrm{Re}\left(-\frac{(1+ia)^r}{r}\int_0^\infty(1-e^{-x})\,\mathrm{d}x^{-r}\right)\tag{5}\\
&=\mathrm{Re}\left(\frac{(1+ia)^r}{r}\int_0^\infty x^{-r}e^{-x}\,\mathrm{d}x\right)\tag{6}\\
&=\mathrm{Re}\left(\frac{(1+ia)^r}{r}\Gamma(1-r)\right)\tag{7}\\
&=-\Gamma(-r)\sqrt{1+a^2}^{\raise{2pt}{\large\,r}}\cos(r\tan^{-1}(a))\tag{8}
\end{align}
$$
Justification:
$(1)$: $e^{iax}=\cos(ax)+i\sin(ax)$
$(2)$: substitute $z=x(1+ia)$ and $\gamma(a)=(0,\infty)(1+ia)$
$(3)$: since there are no singularities inside the wedge and
$\hphantom{(3):}$the integrand decays to order $-r-1$ at $\infty$ and blows up to order $-r$ near $0$
$(4)$: substitute $x=z$
$(5)$: prepare to integrate by parts
$(6)$: integrate by parts
$(7)$: definition of $\Gamma$
$(8)$: take the real part and $\Gamma(1-r)=-r\Gamma(-r)$
Let me explain a bit more in detail what is going on in step $(3)$. We are using contour integration to justify the change of path of integration from $\gamma(a)=(0,\infty)(1+ia)$ in $(2)$ to $\gamma(0)=(0,\infty)$ in $(3)$. The difference of the integral along these two paths is the limit the integral around the wedge-shaped contour
$$
\overbrace{[\epsilon,R]}^{\gamma(0)}\cup\overbrace{R(1+ia[0,1])}^{\text{vanishes}}\cup\overbrace{(1+ia)[R,\epsilon]}^{\gamma(a)\text{ reversed}}\cup\overbrace{\epsilon(1+ia[1,0])}^{\text{vanishes}}
$$
as $\epsilon\to0$ and $R\to\infty$ since the integrals along the paths $R(1+ia[0,1])$ and $\epsilon(1+ia[1,0])$ vanish. Since there are no singularities of the integrand inside the contour, the integral around the contour is $0$.