Is it possible to compute $\int_{-\infty}^\infty {x \sin x\over x^4+1}dx$ without using complex analysis?
Solution 1:
We have $$ \int_{\mathbb{R}}\frac{x\sin x}{x^4+1}\,dx= \frac{1}{2\sqrt{2}}\int_{\mathbb{R}}\sin(x)\left[\frac{1}{x^2-x\sqrt{2}+1}-\frac{1}{x^2+x\sqrt{2}+1}\right]\,dx $$ by partial fraction decomposition. On the other hand $$ \int_{\mathbb{R}}\frac{\sin x}{x^2-x\sqrt{2}+1}\,dx = \int_{\mathbb{R}}\frac{\sin\left(x+\frac{1}{\sqrt{2}}\right)}{x^2+\frac{1}{2}}\,dx $$ $$ \int_{\mathbb{R}}\frac{\sin x}{x^2+x\sqrt{2}+1}\,dx = \int_{\mathbb{R}}\frac{\sin\left(x-\frac{1}{\sqrt{2}}\right)}{x^2+\frac{1}{2}}\,dx $$ so the whole problem boils down to evaluating $$ \int_{\mathbb{R}}\frac{\cos(x)}{x^2+\frac{1}{2}}\,dx=2\int_{0}^{+\infty}\frac{\cos(x)}{x^2+\frac{1}{2}}\color{red}{=}{\pi \sqrt{2}\, e^{-\frac{1}{\sqrt{2}}}}.$$ The last identity can be proved through the Laplace transform, the Fourier transform, Feynman's trick, ordinary differential equations, the residue theorem or the known relation between the Cauchy distribution and the Laplace distribution. A slick way is to notice that by integration by parts $$ \frac{1}{x^2+\frac{1}{2}}=\int_{0}^{+\infty} \cos(xz) \sqrt{2} e^{-\frac{z}{\sqrt{2}}}\,dz = \int_{0}^{+\infty} \frac{\sin(xz)}{x}\,e^{-\frac{z}{\sqrt{2}}}\,dz $$ holds, then to apply Fubini's theorem to a double integral, recalling that for any $z\geq 0$ $$ \int_{0}^{+\infty}\frac{\sin(xz)\cos(x)}{x}\,dx = \left\{\begin{array}{rcl}0&\text{if}& z<1\\\frac{\pi}{4}&\text{if}&z=1\\\frac{\pi}{2}&\text{if}&z>1.\end{array}\right.$$
Solution 2:
The same answer as @JackD'Aurizio with slightly more details. I was doing this after he sent his answer so I finish anyway.
Let $\alpha=\frac{1}{2\sqrt[]{2}}$. After partial fraction decomposition we get: \begin{align} \int^\infty_{-\infty}\frac{x\sin(x)}{x^4+1}\,dx=-\alpha\int^\infty_{-\infty}\frac{\sin(x)}{x^2+\sqrt[]{2}x+1}\,dx+\alpha\int^\infty_{-\infty}\frac{\sin(x)}{x^2-\sqrt[]{2}x+1}\,dx \end{align} Now define: \begin{align} I:=\int^\infty_{-\infty}\frac{\sin(x)}{x^2+\sqrt[]{2}x+1}\,dx,\ \ \ \ J:=\int^\infty_{-\infty}\frac{\sin(x)}{x^2-\sqrt[]{2}x+1}\,dx \end{align} First we do $I$. Completing the squares in the denominator yields: \begin{align} I=\int^\infty_{-\infty}\frac{\sin(x)}{(x+\frac{\sqrt[]{2}}{2})^2+\frac{1}{2}}\,dx \end{align} Substitute $u=x+\frac{\sqrt[]{2}}{2}$ and use the formula for $\sin(x+y)$: \begin{align} I&=\int^\infty_{-\infty}\frac{\sin\left(u-\frac{\sqrt[]{2}}{2}\right)}{u^2+\frac{1}{2}}\,du\\& = \int^\infty_{-\infty}\frac{\sin\left(u\right)\cos\left(-\frac{\sqrt[]{2}}{2}\right)}{u^2+1}\,du+\int^\infty_{-\infty}\frac{\cos(u)\sin\left(-\frac{\sqrt[]{2}}{2}\right)}{u^2+\frac{1}{2}}\,du\\ \end{align} The integral with $\sin(u)$ is convergent and the ingerand is an odd function, so it vanishes. Now we get: \begin{align} I=\sin\left(-\frac{\sqrt[]{2}}{2}\right)\int^\infty_{-\infty}\frac{\cos(u)}{u^2+\frac{1}{2}}\,du \end{align} This integral can be done with the explicitly mentioned trick by you, namely Feynman's trick. It is done nicely with full details by user Mark Viola in this answer. So we get: \begin{align} I=\sin\left(-\frac{\sqrt[]{2}}{2}\right) \frac{\pi\sqrt[]{2}}{e^{1/\sqrt[]{2}}}=-\sin\left(\frac{\sqrt[]{2}}{2}\right) \frac{\pi\sqrt[]{2}}{e^{1/\sqrt[]{2}}} \end{align} The same can be done for $J$ (do it yourself!). We get: \begin{align} J=\sin\left(\frac{\sqrt[]{2}}{2}\right)\frac{\pi\sqrt[]{2}}{e^{1/\sqrt[]{2}}} \end{align} Finally we get:
\begin{align} \int^\infty_{-\infty}\frac{x\sin(x)}{x^4+1}\,dx = \frac{\pi}{e^{1/\sqrt[]{2}}}\sin\left(\frac{\sqrt[]{2}}{2}\right) \end{align}
Solution 3:
Just using basic integration methods.
Let us call $a,b,c,d$ the roots of $x^4+1=0$. Then using partial fraction decomposition $$\frac x{x^4+1}=\frac{a}{(a-b) (a-c) (a-d) (x-a)}+\frac{b}{(b-a) (b-c) (b-d) (x-b)}+\frac{c}{(c-a) (c-b) (c-d) (x-c)}+\frac{d}{(d-a) (d-b) (d-c) (x-d)}$$ which makes that we are left with four integrals looking like $$I_r=\int \frac{\sin(x)}{x-r}\,dx=\int \frac{\sin(y+r)}{y}\,dy=\cos(r)\int \frac{\sin(y)}{y}\,dy+\sin(r)\int \frac{\cos(y)}{y}\,dy$$ that is to say $$I_r=\cos (r)\, \text{Si}(y)+ \sin (r)\,\text{Ci}(y)$$ where appear sine and cosine integrals.
For sure, now the problem is to recombine all of that (tedious work) and replace $a,b,c,d$ by the roots of unity and finally integrate between the bounds. I let you the pleasure of doing it.
By the end, you should arrive to $$\int_{-\infty}^\infty {x\sin x\over x^4+1}\,dx=\pi \,e^{-\frac{1}{\sqrt{2}}} \, \sin \left(\frac{1}{\sqrt{2}}\right)$$