TITLE: Compute $\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx$
QUESTION [9 upvotes]: How does one compute the following integral?
$$\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx$$

I have tried extending $x$ to the complex plane then evaluating the following contour integral 
$$\oint_C \frac{\sqrt{x}e^{ix}}{1+x^2} dx$$
with the contour $C$ running along the whole real axis and then upper semicircle. I obtain
$$\int_{0}^{\infty} \frac{\sqrt{x}\big(\cos(x)+\sin(x)\big)}{1+x^2}\,\mathrm dx=\frac\pi{e\sqrt2}$$
but not the original integral.

REPLY [2 votes]: Using the Laplace transform of the sine function, we get $$ \begin{align}  \int_{0}^{\infty} \frac{\sqrt{x}\sin x}{1+x^{2}} \, \mathrm dx &= \int_{0}^{\infty} \sqrt{x} \sin(x) \int_{0}^{\infty} \sin(t) e^{-xt} \, \mathrm dt \, \mathrm dx  \\ &= \int_{0}^{\infty}  \sin(t) \int_{0}^{\infty} \sqrt{x} \sin(x) e^{-tx} \, \mathrm dx \, \mathrm dx  \\ &= -\Im\int_{0}^{\infty} \sin(t) \int_{0}^{\infty} \sqrt{x} e^{-(t+i)x} \, dx \, \mathrm dt \\ &= -\frac{\sqrt{\pi}}{2} \, \Im  \int_{0}^{\infty} \frac{\sin(t)}{(t+i)^{3/2}} \, \mathrm dt \tag{1}\\ &= - \sqrt{\pi} \,  \Im \int_{0}^{\infty} \frac{\cos (t)}{\sqrt{t+i}} \, \mathrm dt \tag{2}\\ &=- \frac{\sqrt{\pi}}{2} \,  \Im \left(\int_{0}^{\infty} \frac{e^{it}}{\sqrt{t+i}} \, \mathrm dt + \int_{0}^{\infty}\frac{e^{-it}}{\sqrt{t+i}} \, \mathrm dt \right). \end{align} $$

$(1)$ $\mathcal{L} \{\sqrt{x} \} (s) = \frac{\sqrt{\pi}}{2 s^{3/2}}$ if $\Re(s) >0$
$(2)$ Integrate by parts.

Next, using the principal branch of the square root, let's integrate the function $$f(z) = \frac{e^{iz}}{\sqrt{z+i}}, $$ around an infinitely large closed quarter-circle in the first quadrant of the complex plane.
Applying Jordan's lemma, we get
$$ \begin{align} \int_{0}^{\infty} \frac{e^{it}}{\sqrt{t+i}} \, \mathrm dt&=e^{i \pi/4} \int_{0}^{\infty} \frac{e^{-t}}{\sqrt{t+1}} \, \mathrm dt \\ &= 2 e^{i \pi/4} \, e \int_{1}^{\infty} e^{-u^{2}} \, \mathrm du \tag{3} \\ &= 2 e^{i \pi/4} e \, \frac{\sqrt{\pi}}{2} \operatorname{erfc} (1) \\ &= e^{i \pi/4} e \sqrt{\pi}\operatorname{erfc} (1). \end{align}$$
And by integrating the function $$g(z) = \frac{e^{-iz}}{\sqrt{z+i}} $$ around an infinitely large closed quarter-circle in the fourth quadrant of the complex plane (indented at $z=-i$), we get $$ \begin{align} \int_{0}^{\infty}\frac{e^{-it}}{\sqrt{t+i}} \, \mathrm dt &= \int_{0}^{1}  \frac{e^{-t}}{\sqrt{(1-t)e^{ i \pi /2}}} \, (-i \, \mathrm dt)  + \int_{1}^{\infty} \frac{e^{-t}}{\sqrt{(t-1)e^{-i \pi /2} }} \, (-i \mathrm \, dt) \\ &=  -e^{i \pi/4}\int_{0}^{1} \frac{e^{-t}}{\sqrt{1-t}} \, \mathrm dt +  e^{ - i \pi /4} \int_{1}^{\infty} \frac{e^{-t}}{\sqrt{t-1}} \, \mathrm dt \\ &= -\frac{2 e^{ i \pi /4}}{e} \int_{0}^{1} e^{v^{2}} \, \mathrm dv + \frac{2e^{ - i \pi/4}}{e} \int_{0}^{\infty} e^{-w^{2}} \, \mathrm dw \tag{4} \\ &= -\frac{2e^{ i \pi /4}}{e} \frac{\sqrt{\pi}}{2} \operatorname{erfi}(1) +  \frac{2 e^{ - i \pi /4}}{e}\frac{\sqrt{\pi}}{2}  \\ &= \frac{\sqrt{\pi}}{e} \left(-e^{ i \pi /4} \operatorname{erfi}(1) + e^{-i \pi /4} \right). \end{align}$$

$(3)$ Let $u^{2} = t+1$.
$(4)$ Let $v^{2} = 1-t$ and let $w^{2} = t-1$.

Putting everything together, we have
$$ \begin{align} \int_{0}^{\infty} \frac{\sqrt{x}\sin x}{1+x^{2}} \, \mathrm dx  &= - \frac{\sqrt{\pi}}{2} \Im \left(e^{i \pi/4} e \sqrt{\pi}\operatorname{erfc}(1) + \frac{\sqrt{\pi}}{e} \left(-e^{ i \pi /4} \operatorname{erfi}(1) + e^{-i \pi /4} \right) \right)\\ &= - \frac{\sqrt{\pi}}{2} \left(\frac{e \sqrt{\pi}}{\sqrt{2}} \operatorname{erfc}(1) - \frac{\sqrt{\pi} }{\sqrt{2}e} \operatorname{erfi}(1) - \frac{\sqrt{\pi}}{\sqrt{2}e} \right)  \\ &= \frac{\pi}{2 \sqrt{2}e} \left(1+ \operatorname{\color{red}{erfi}}(1) - e^{2} \operatorname{erfc}(1) \right). \end{align}$$