Prove $ \int_{0}^{\infty} {x}^{a - 1} \sin \left(\frac{\pi}{2} a - b x\right) \frac{r}{{x}^{2} + {r}^{2}} d x = \frac{\pi}{2} {r}^{a - 1} {e}^{- br} $ I am attempting to calculate the following integral from Whittaker and Watson chapter 6 using the residue theorem. Show that if $a \in \left(0 , 2\right)$, $b > 0$, and $r > 0$, then
\begin{align}
 \int_{0}^{\infty} {x}^{a - 1} \sin \left(\frac{\pi}{2} a - b x\right) \frac{r}{{x}^{2} + {r}^{2}} d x = \frac{\pi}{2} {r}^{a - 1} {e}^{- b r} \\
\end{align}
During the chapter, we proved that if $Q \left(z\right)$ is a rational function s.t. ${z}^{a} Q \left(z\right) \to 0$ when $z \to 0$ or $z \to \infty$, then
\begin{align}
 \int_{C} {\left(- z\right)}^{a - 1} Q \left(z\right) \mathrm{dz} = 2 \pi i \sum_{\zeta}^{} {\text{Res}}_{z = \zeta} {\left(- z\right)}^{a - 1} Q \left(z\right) \\
\end{align}
and finally that
\begin{align}
 \int_{0}^{\infty} {x}^{a - 1} Q \left(x\right) \mathrm{dx} = \csc \left(a \pi\right) \sum_{\zeta}^{} {\text{Res}}_{z = \zeta} {\left(- z\right)}^{a - 1} Q \left(z\right) \\
\end{align}
Attempt: I am not entirely sure how I should proceed with this integral. I assume that I must first show that
\begin{align}Q \left(x\right) = \frac{\sin \left(\frac{\pi}{2} a - b x\right) r}{{x}^{2} + {r}^{2}}\end{align}
will satisfy the necessary asymptotic conditions. I know
\begin{align}
 {z}^{a} Q \left(z\right) & = {z}^{a} \sin \left(\frac{\pi}{2} a - b z\right) \frac{r}{{z}^{2} + {r}^{2}} \\
 & = {z}^{a} \frac{1}{2 i} \left({e}^{\frac{\pi i}{2} a - i b z} - {e}^{\frac{- \pi i}{2} a + i b z}\right) \frac{r}{{z}^{2} + {r}^{2}} \\
\end{align}
such that when $z = x + i y$ and $| z {|}^{2} > {r}^{2}$
\begin{align}
 | {z}^{a} Q \left(z\right) | \le \frac{| z {|}^{a}}{2} \left({e}^{b y} - {e}^{- b y}\right) \frac{r}{| z {|}^{2} + {r}^{2}} \\
\end{align}
Taking $x = 0$ and allowing $y \to \infty$ causes the above bound to diverge, so I am not sure how to proceed. Am I to use a different theorem for integration. It appeared to me that this integral was specifically designed to be addressed with the above method, for it was the only such problem to feature an ${x}^{a - 1}$ term just like the theorem.
In the meantime, I have computed the residues of the function ${\left(- z\right)}^{a - 1} Q \left(z\right)$.
\begin{align}
 {\text{Res}}_{z = i r} {\left(- z\right)}^{a - 1} Q \left(z\right) & = {\text{Res}}_{z = i r} {\left(- z\right)}^{a - 1} \frac{\sin \left(\frac{\pi}{2} a - b z\right) r}{{z}^{2} + {r}^{2}} \\
 & = \lim_{z \to i r} {\left(- z\right)}^{a - 1} \frac{\sin \left(\frac{\pi}{2} a - b z\right) r}{\left(z + i r\right) \left(z - i r\right)} \left(z - i r\right) \\
 & = {\left(- i r\right)}^{a - 1} \frac{\sin \left(\frac{\pi}{2} a - b i r\right)}{2 i} \\
\end{align}
and likewise
\begin{align}
 {\text{Res}}_{z = - i r} {\left(- z\right)}^{a - 1} Q \left(z\right) & = \lim_{z \to - i r} {\left(- z\right)}^{a - 1} \frac{\sin \left(\frac{\pi}{2} a - b z\right) r}{z - i r} \\
 & = - {\left(i r\right)}^{a - 1} \frac{\sin \left(\frac{\pi}{2} a + b i r\right)}{2 i} \\
\end{align}
When $a$ is even,
\begin{align}
 {\text{Res}}_{z = i r} {\left(- z\right)}^{a - 1} Q \left(z\right) + {\text{Res}}_{z = - i r} {\left(- z\right)}^{a - 1} Q \left(z\right) & = \frac{- {\left(i r\right)}^{a - 1}}{2 i} \left[\sin \left(\frac{\pi}{2} a - b i r\right) - \sin \left(\frac{\pi}{2} a + b i r\right)\right] \\
 & = \frac{- {\left(i r\right)}^{a - 1}}{2 i} \sin \left(- b i r\right) \cos \left(\frac{\pi}{2} a\right) \\
 & = \frac{{\left(i r\right)}^{a - 1}}{4} \cos \left(\frac{\pi}{2} a\right) \left[{e}^{b r} - {e}^{- b r}\right] \\
\end{align}
I feel that calculating the residue at the origin will be tedious and might not be necessary.
 A: Let contour $C=C_1+C_2+C_3+C_4$, where $C_1$ is the positive real axis, from $\epsilon$ to $\infty$. $C_2$ is large semi-circle on the upper half plane, with radius $R$, $C_3$ is negative real axis, from $-\infty$ to $-\epsilon$. $C_4$ is small semi-circle on the upper half plane, with radius $\epsilon$.
On $C_1$,
$$I_1=\int_0^\infty z^{a-1}\frac{r}{z^2+r^2}e^{ibz}dz$$
On $C_2$, $z=R e^{i\theta}$
$$|I_2|\le \frac{2\pi r}{R^{2-a}}\to0~~\text{as}~~R\to\infty$$
On $C_3$,
$$\begin{align} I_3&=\int_{-\infty}^0 z^{a-1}\frac{r}{z^2+r^2}e^{ibz}dz,~~~z=e^{i\pi}x\\
\\
I_3&=e^{i(a-1)\pi}\int_0^\infty x^{a-1}\frac{r}{x^2+r^2}e^{-ibx}dx\\
\\
I_3&=-e^{ia\pi}\int_0^\infty x^{a-1}\frac{r}{x^2+r^2}e^{-ibx}dx  \end{align}$$
On $C_4$, $z=\epsilon e^{i\theta}$
$$|I_4|\le \frac{\pi}{2r}\epsilon^a\to0~~\text{as}~~\epsilon\to0$$
$$I_1+I_2+I_3+I_4=2\pi i\cdot \text{Res}(z=ir)$$
$$\text{Res}(z=ir)=\lim_{z\to ir} (z-ir)\frac{z^{a-1}r}{z^2+r^2}e^{ibz}=\frac{r^{a-1}e^{-br}}{2i}e^{i\frac{\pi}{2}(a-1)}=-\frac{r^{a-1}e^{-br}}{2}e^{i\frac{\pi}{2}a}$$
$$\begin{align}\int_0^\infty z^{a-1}\frac{r}{z^2+r^2}\left(e^{ibz}-e^{ia\pi-ib z}\right)dz&=-i\pi \cdot r^{a-1}e^{-br}e^{i\frac{\pi}{2}a}\\
\\
\int_0^\infty z^{a-1}\frac{r}{z^2+r^2}\left(e^{-i\left(\frac{\pi}{2}a-bz\right)}-e^{i\left(\frac{\pi}{2}a-bz\right)}\right)dz&=-i\pi \cdot r^{a-1}e^{-br}\\
\\
-2i\int_0^\infty z^{a-1}\frac{r}{z^2+r^2}\sin\left(\frac{\pi}{2}a-bz\right)dz&=-i\pi \cdot r^{a-1}e^{-br}\\
\\
\int_0^\infty z^{a-1}\frac{r}{z^2+r^2}\sin\left(\frac{\pi}{2}a-bz\right)dz&=\frac{\pi}2 \cdot r^{a-1}e^{-br}
\end{align}$$
