# Compute $\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx$

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.

• WA does not appear to give the solution in terms of regular constants. It suggests a need to use error functions and the substitution $x\mapsto x^2$ followed by partial fractions on the denominator. – Simply Beautiful Art Aug 12 '17 at 0:21
• @SimplyBeautifulArt: The solution does not have to be regular constants, so long it is in special functions. I thought of that substitution before. How then do you deal with $\sin(x^2)$? – Hans Aug 12 '17 at 0:29
• @SimplyBeautifulArt: I think I know what to do. Do use the transformation then pick the contour to be around the first quadrant of the complex plane and take care of the singularity. I will try this later --- occupied right now. – Hans Aug 12 '17 at 0:37
• Yeah. And replace the sine with an exponential function (which is where we get our ole friend error function) – Simply Beautiful Art Aug 12 '17 at 0:39
• @Hans: After a simple substitution, we are ultimately left with evaluating $J(i),~$ where $$J(a)~=~\int_0^\infty\frac{e^{-ax^2}}{x^2+x^{-2}}~dx,$$ which is nothing more than $-F'(a),~$ for $$F(a) ~=~ \int_0^\infty\frac{e^{-ax^2}}{x^4+1}~dx,$$ which, in its turn, constitutes a solution to the differential functional equation $$F(a)+F''(a)=\dfrac12~\sqrt{\dfrac\pi a},$$ see Gaussian integral for more details. – Lucian Aug 30 '17 at 4:42

For information :

$\int_{0}^{\infty} \frac{\sqrt{x}\sin(y\:x)}{1+x^2} dx$ is the Fourier Sine Transform of $\frac{\sqrt{x}}{1+x^2}\quad$ In the Harry Bateman's Tables of Integral Transforms an even more general formula can be seen on page 71, Eq.28 , the Fourier Sine Transform of $x^{2\nu}(x^2+a^2)^{-\mu-1}$ : $$\frac{1}{2}a^{2\nu-2\mu}\frac{\Gamma(1+\nu)\Gamma(\mu-\nu)}{\Gamma(\mu+1)}y \:_1\text{F}_2(\nu+1;\nu+1-\mu,3/2;a^2y^2/4)\:+\:4^{\nu-\mu-1}\sqrt{\pi}\frac{\Gamma(\nu-\mu)}{\Gamma(\mu-\nu+3/2)}y^{2\mu-2\nu+1}\:_1\text{F}_2(\mu+1;\mu-\nu+3/2,\mu-\nu+1;a^2y^2/4)$$ With$\quad y=1\quad;\quad a=1\quad;\quad \nu=1/4\quad;\quad \mu=0\quad\to\quad \int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx =$
$$=\frac{1}{2}\Gamma(5/4)\Gamma(-1/4) \:_1\text{F}_2(5/4;5/4,3/2;1/4)\:+\:4^{-3/4}\sqrt{\pi}\frac{\Gamma(5/4)}{\Gamma(5/4)}\:_1\text{F}_2(1;5/4,3/4;1/4)$$ The Generalized Hypergeometric $_1$F$_2$ function (don't confuse with the well-known 2F1) reduces to functions of lower level in the particular cases :

$\:_1\text{F}_2(5/4;5/4,3/2;1/4)=\sinh(1)$

$\:_1\text{F}_2(1;5/4,3/4;1/4)=\frac{\sqrt{\pi}}{4e}\left(e^2\text{erfi}(1)+\text{erf}(1) \right)$

and after simplification : $$\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx = -\frac{\pi}{\sqrt{2}}\sinh(1)+\frac{\pi}{2\sqrt{2}\:e}\left(e^2\text{erfi}(1)+\text{erf}(1) \right)$$ $$\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx =\frac{\pi}{2\sqrt{2}\:e}\left(e^2\text{erfi}(1)+\text{erf}(1) +1-e^2\right)$$ $$\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx =\frac{\pi}{2\sqrt{2}\:e}\left(-e^2\text{erfc}(1)+\text{erf}(1) +1\right)$$ For the Hypergeometric $_1$F$_2$ function, see : http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric1F2/02/

About the functions erf, erfi, erfc, see : http://mathworld.wolfram.com/Erf.html , http://mathworld.wolfram.com/Erfi.html , http://mathworld.wolfram.com/Erfc.html

• Nice! +1. Where can I find the derivation of the transforms, at least this particular one, in Harry Bateman's Tables of Integral Transforms? – Hans Aug 31 '17 at 19:52
• The Bateman's Tables of Integral Transforms (1954), is a extensive compilation of equations of integral transforms, without reference. Sorry, I have no more information. – JJacquelin Aug 31 '17 at 20:18

This doesn't answer your specific question, but I thought it might be worth mentioning that we can generalize the result you found using the same contour.

Namely, $$\int_{0}^{\infty} \frac{x^{s-1} \sin \left(x-\frac{\pi s}{2} \right)}{1+x^{2}} \, dx = -\frac{\pi}{2e},\quad 0 <s <3.$$

This integral (with a couple more parameters) appears as an exercise on page 154 in the textbook An Introduction to the Theory of Functions of a Complex Variable by E.T. Copson. Copson attributes it to Cauchy.

What makes this integral somewhat interesting is the fact that its value is independent of $s$.

By integrating $$f(z) =z^{s-1} \, \frac{e^{- i \pi s/2}e^{iz}}{1+z^{2}}$$ around a large semicircular contour in the upper half-plane that is indented at the origin and applying Jordan's lemma, we get

\begin{align} \int_{-\infty}^{0} (|x|e^{i \pi})^{s-1} \, \frac{e^{- i \pi s/2} e^{ix}}{1+x^{2}} \, dx + \int_{0}^{\infty} x^{s-1} \frac{e^{- i \pi s/2}e^{ix}}{1+x^{2}} \, dx &= 2 \pi i \operatorname{Res} [f(z), e^{i \pi /2}] \\ &= 2 \pi i \left( (e^{i \pi /2})^{s-1} \frac{e^{- i \pi s/2} e^{-1}}{2i}\right)\\ & = \frac{\pi}{i e}. \end{align}

(As long as $s>0$, the contribution from the indentation around the origin will vanish as the radius of the indentation goes to $0$.)

But the left side of the equation can be written as $$-\int_{0}^{\infty} u^{s-1} \, \frac{e^{i \pi s/2}e^{-iu}}{1+u^{2}} \, du+ \int_{0}^{\infty} x^{s-1} \frac{e^{- i \pi s/2}e^{ix}}{1+x^{2}} \, dx = 2i \int_{0}^{\infty} x^{s-1} \, \frac{\sin\left(x- \frac{\pi s}{2} \right)}{1+x^{2}} \, dx,$$ and the result follows.

I originally posted something similar as an answer to a different question, but I think it's more appropriate to post it here.

• This is exactly the contour and approach I described I was trying in my question. The integral I obtained is precisely the one you quoted when $s=\frac32$. The intrigue of the independence of the integral from $s$ is alleviated by the fact that had it been dependent there is a multiplicative factor and dividing that factor would have made the right hand side a constant. But this general integral is interesting in its own right. – Hans Nov 27 '17 at 3:21
• Right before you posted your comment, I added the words "more generally" to my answer to reflect the fact that I was generalizing the result you got. – Random Variable Nov 27 '17 at 3:53
• I see. I do think it is interesting. That was why I upvoted your answer. It would be better if you could explicitly say this is a generalization of my result even though it does not answer the original question per se. – Hans Nov 27 '17 at 6:24

My goal is to prove $$\int_{0}^{\infty} \frac{\sqrt{x}\sin(x)}{1+x^2} dx =\frac{\pi}{2\sqrt{2}\:e}\left(-e^2\text{erfc}(1)+\text{erf}(1) +1\right)$$ as stated in @JJacquelin's answer. My following attempt falls short of that. But it does provide an equivalent integral with much faster convergence.

Take the contour integral $$2\oint_C \frac{z^2e^{iz^2}}{1+z^4} dz$$ with contour $C$ run along the real axis from $0$ to $R$, trace the circle $Re^{i\theta}$ with $\theta$ running from $0$ to $\frac\pi 4$, then roll back to the origin along $xe^{i\frac\pi 4}$ with $x$ running from $R$ to $0$ while circumventing around the point $e^{i\frac\pi 4}$ clockwise with radius $\delta>0$. The integral on the octal circle vanishes as $R\to\infty$. We have $$\oint_C \frac{z^2e^{iz^2}}{1+z^4} dz=\int_{0}^{\infty} \frac{x^2e^{ix^2}}{1+x^4} dx-e^{i\frac34\pi}\int_0^\infty \frac{x^2e^{-x^2}}{1-x^4}dx+\cdots$$

(to be continued)