How to evaluate $\int_{-\infty}^{+\infty}\frac{\cos x}{\left(1+x+x^2\right)^2+1}\mathrm{~d}x$

334 Views Asked by At

Question

$$\int_{-\infty}^{+\infty}\frac{\cos x}{\left(1+x+x^2\right)^2+1}\mathrm{~d}x$$

Wolfram alpha says it is

$$\int_{-\infty}^{\infty} \frac{\cos(x)}{\left(1 + x + x^2\right)^2 + 1} \,dx = \frac{\pi (1 + 2\sin(1) + \cos(1))}{5e} \approx 0.745038$$

My try \begin{align} &\quad\int_{-\infty}^{+\infty}\frac{\cos x}{\left(1+x+x^2\right)^2+1}\mathrm{~d}x\\ &=\underbrace{\int_{-\infty}^{0}\frac{\cos x}{\left(1+x+x^2\right)^2+1}\mathrm{~d}x}_{x\to-x}+\int_{0}^{+\infty}\frac{\cos x}{\left(1+x+x^2\right)^2+1}\mathrm{~d}x\\ &=\int_{0}^{\infty}\left[\frac{\cos x}{\left(1+x+x^2\right)^2+1}+\frac{\cos x}{\left(1-x+x^2\right)^2+1}\right]\mathrm{~d}x\\ &=\int_{0}^{\infty}\frac{\cos x}{\left(1+x^2\right)}\left[\frac{1}{2+2x+x^2}+\frac{1}{2-2x+x^2}\right]\mathrm{~d}x\\ &=2\int_{0}^{\infty}\frac{\left(2+x^2\right)\cos x}{\left(1+x^2\right)\left(4+x^4\right)}\mathrm{~d}x\\ &=\frac{2}{5}\int_0^\infty\frac{\cos x}{1+x^2}\mathrm{~d}x+\frac{12}{5}\int_0^\infty\frac{\cos x}{4+x^4}\mathrm{~d}x\\ &\quad-\frac{2}{5}\int_0^\infty\frac{x^2\cos x}{4+x^4}\mathrm{~d}x\\ &=\frac{2}{5}I_1+\frac{12}{5}I_2-\frac{2}{5}I_3. \end{align}

Alright, now we have three integrals, within which the $I_1$ is a specific case of the so-called $\text{Laplace}$ integral. We can solve it with the following trick.

\begin{align} I_1&=\int_0^\infty\frac{\cos x}{1+x^2}\mathrm{~d}x\\ &=\int_0^\infty\cos x\int_0^\infty\mathrm{e}^{-\left(1+x^2\right)t}\mathrm{~d}t\mathrm{d}x\\ &=\int_0^\infty\mathrm{e}^{-t}\int_0^\infty\mathrm{e}^{-x^2t}\cos x\mathrm{~d}x\mathrm{d}t\\ &=\int_0^\infty\mathrm{e}^{-t}\int_0^\infty\mathrm{e}^{-x^2t}\sum_{n=0}^\infty\frac{(-)^nx^{2n}}{(2n)!}\mathrm{~d}x\mathrm{d}t\\ &=\sum_{n=0}^\infty\frac{(-)^n}{(2n)!}\int_0^\infty\mathrm{e}^{-t}\underbrace{\int_0^\infty\mathrm{e}^{-x^2t}x^{2n}\mathrm{~d}x}_{x^2t\to x}\mathrm{d}t\\ &=\frac{1}{2}\sum_{n=0}^\infty\frac{(-)^n}{(2n)!}\int_0^\infty\mathrm{e}^{-t}t^{-n-\frac{1}{2}}\int_0^\infty\mathrm{e}^{-x}x^{n-\frac{1}{2}}\mathrm{~d}x\mathrm{d}t\\ &=\frac{1}{2}\int_0^\infty\mathrm{e}^{-t}t^{-\frac{1}{2}}\sum_{n=0}^\infty\frac{(-)^n}{(2n)!}\Gamma\left(n+\frac{1}{2}\right)t^{-n}\mathrm{d}t\\ &=\frac{1}{2}\int_0^\infty\mathrm{e}^{-t}t^{-\frac{1}{2}}\sum_{n=0}^\infty\frac{(-)^n(2n-1)!!}{(2n)!2^n}\Gamma\left(\frac{1}{2}\right)t^{-n}\mathrm{d}t\\ &=\frac{\sqrt{\pi}}{2}\int_0^\infty\mathrm{e}^{-t}t^{-\frac{1}{2}}\sum_{n=0}^\infty\frac{1}{n!}\left(-\frac{1}{4t}\right)^n\mathrm{d}t\\ &=\frac{\sqrt{\pi}}{2}\underbrace{\int_0^\infty\mathrm{e}^{-t-\frac{1}{4t}}t^{-\frac{1}{2}}\mathrm{d}t}_{t\to t^2}\\ &=\sqrt{\pi}\int_0^\infty\mathrm{e}^{-t^2-\frac{1}{4t^2}}\mathrm{d}t=\frac{\sqrt{\pi}}{\mathrm{e}}\underbrace{\int_0^\infty\mathrm{e}^{-\left(t-\frac{1}{2t}\right)^2}\mathrm{d}t}_{t-\frac{1}{2t}\to t}\\ &=\frac{\sqrt{\pi}}{\mathrm{e}}\int_{-\infty}^\infty\mathrm{e}^{-t^2}\left(\frac{1}{2}+\frac{t}{2\sqrt{2+t^2}}\right)\mathrm{d}t\\ &=\frac{\sqrt{\pi}}{\mathrm{e}}\int_{0}^\infty\mathrm{e}^{-t^2}\mathrm{d}t\quad (\text{Gauss Integral})\\ &=\frac{\pi}{2\mathrm{e}}. \end{align}

My question is how to evaluate $I_2$ and $I_3$ ? or any other method?

5

There are 5 best solutions below

1
On BEST ANSWER

Evaluate $I_2$ and $I_3$ together, i.e. \begin{align} &\int_0^\infty\frac{(6-x^2)\cos x}{4+x^4}dx\\ =& \ \frac12\int_{-\infty}^\infty\frac{(6-x^2)\cos x}{4+x^4}dx\\ =& \ \frac12\int_{-\infty}^\infty\cos x\bigg( \frac{{2x+3}}{\underset{t=x+1}{(x+1)^2+1}}- \frac{{2x+3}}{\underset{t=x-1}{(x-1)^2+1}}\bigg) dx\\ =&\int_{-\infty}^\infty\frac{2t\sin t \sin1+\cos t\cos1}{t^2+1}dt \end{align} where the odd terms resulting from the substitutions $t=x\pm 1$ are discarded because they vanish upon integration. Then, utilize the known integrals $$\int_{-\infty}^\infty \frac{t\sin t}{t^2+1} dt = \int_{-\infty}^\infty \frac{\cos t}{t^2+1} dt= \frac\pi e$$ to arrived at the desired result

$$\int_{-\infty}^{\infty} \frac{\cos x}{\left(1 + x + x^2\right)^2 + 1} \,dx = \frac{\pi }{5e}(1 + 2\sin1 + \cos1) $$

1
On

Here is the standard complex analytic approach.


Note that $f(z)=\frac{e^{iz}}{(1+z+z^2)^2+1}$ is meromorphic with precisely two poles on the upper half plane given by $z=i,-1+i$ with respective residues

$$\text{Res}(f,i)=-\frac{(2+i)}{10}e^{-1}\qquad\text{Res}(f,-1+i)=\frac{(2-i)}{10}e^{-1-i}$$

For $r>0$ let $\gamma_1$ be the straight path from $-r$ to $r$, and let $\gamma_2$ be the counterclockwise semicircular path from $r$ to $-r$. Note that

$$\left|\int_{\gamma_2}\frac{e^{iz}}{(1+z+z^2)^2+1}dz\right|\leq\pi r\max_{z\in\gamma_2}\left| \frac{e^{iz}}{(1+z+z^2)^2+1}\right|=O(r^{-3}) $$ so the above integral vanishes as $r\rightarrow\infty$.

By the residue theorem we have that \begin{equation} \begin{split} 2\pi i\left[-\frac{(2+i)}{10}e^{-1}+\frac{(2-i)}{10}e^{-1-i}\right]&=\lim_{r\rightarrow\infty}\oint_{\gamma_1+\gamma_2}\frac{e^{iz}}{(1+z+z^2)^2+1}dz\\ &=\lim_{r\rightarrow\infty}\int_{\gamma_1}\frac{e^{iz}}{(1+z+z^2)^2+1}dz+\lim_{r\rightarrow\infty}\int_{\gamma_2}\frac{e^{iz}}{(1+z+z^2)^2+1}dz\\ &=\int_{-\infty}^\infty\frac{e^{ix}}{(1+x+x^2)^2+1}dx \end{split} \end{equation}

Taking the real parts of both sides, we have that

$$\int_{-\infty}^\infty\frac{\cos(x)}{(1+x+x^2)^2+1}dx=\frac{\pi}{5e}(1+2\sin(1)+\cos(1))$$

0
On

Here is my solution

\begin{align} I&=\int_{-\infty}^{\infty}{\frac{\cos x}{\left( 1+x+x^2 \right) ^2+1}dx} \\& =\mathrm{Re}\int_{-\infty}^{\infty}{\frac{e^{ix}}{\left( 1+x^2 \right) \left( x^2+2x+2 \right)}dx} \\& =\mathrm{Re}\int_{-\infty}^{\infty}{\left[ \frac{\left( 1-2x \right) e^{ix}}{5\left( 1+x^2 \right)}+\frac{1}{5}\frac{\left( 2x+3 \right) e^{ix}}{\left( x+1 \right) ^2+1} \right] dx} \\& =\mathrm{Re}\frac{1}{5}2\pi i\left[ \frac{\left( 1-2z \right) e^{iz}}{z+i}\mid_{z=i}^{\,\,}+\frac{\left( 2z+3 \right) e^{iz}}{z+1+i}\mid_{z=i-1}^{\,\,} \right] \\& =\mathrm{Re}\frac{1}{5}2\pi i\left[ \frac{\left( 1-2i \right) e^{-1}}{i+i}+\frac{\left( 2i+1 \right) e^{-1-i}}{i+i} \right] \\& =\mathrm{Re}\frac{\pi}{5e}\left[ \left( 1-2i \right) +\left( 2i+1 \right) \left( \cos 1-i\sin 1 \right) \right] \\& =\mathrm{Re}\frac{\pi}{5e}\left[ \left( 1+\cos 1+2\sin 1 \right) +i\left( -2+2\cos 1-\sin 1 \right) \right] \\& =\frac{\pi}{5e}\left( 1+\cos 1+2\sin 1 \right) \\& \end{align}

So

\begin{align} J&=\int_{-\infty}^{\infty}{\frac{\sin x}{\left( 1+x+x^2 \right) ^2+1}dx}=\frac{\pi}{5e}\left( -2+2\cos 1-\sin 1 \right) \\& \end{align}

0
On

Another solution.

Write $$\left(1+x+x^2\right)^2+1=\prod_{n=1}^4 (x-r_i)$$ where $$r_{1,2}=\pm i \qquad \text{and} \qquad r_{3,4}=-1\pm i$$ Using partial fraction decomposition $$\frac 1{\left(1+x+x^2\right)^2+1}=\frac{\frac{1}{5}-\frac{i}{10 }}{x+(1-i)}+\frac{\frac{1}{5}+\frac{i}{10}}{x+(1+i)}-\frac{\frac {1}{5}+\frac{i}{10}}{x-i}-\frac{\frac{1}{5}-\frac{i}{10}}{x+i}$$

So, four integrals $$I(r)=\int \frac {\cos(x)}{x-r}\,dx=\int\frac{\cos (r+t)}{t}\,dt=\cos(r)\int \frac{\cos (t)}{t}\,dt-\sin(r)\int \frac{\sin (t)}{t}\,dt$$ $$I(r)=\cos (r)\,\text{Ci}(t) -\sin (r)\, \text{Si}(t)$$

Have a look at formula $3.722.4^8$ in the seventh edition of the "Table of Integrals, Series and Products" by I.S. Gradshteyn and I.M. Ryzhik $$\Im(r) >0 \qquad \implies \qquad J(r)=\int_{-\infty}^{+\infty} \frac {\cos(x)}{x-r}\,dx=+i \pi e^{+i r}$$ $$\Im(r) >0 \qquad \implies \qquad J(r)=\int_{-\infty}^{+\infty} \frac {\cos(x)}{x-r}\,dx=-i \pi e^{-i r}$$

Combining all the above and simplifying the complex numbers, the result.

0
On

Noting that $$ \left(1+x+x^2\right)^2+1 = {\left[\left(x^2+1\right)^2+2 x\left(x^2+1\right)+x^2\right]+1 } \\ \qquad = \left(x^2+1\right)\left(x^2+2 x+2\right), $$ whose 4 simple poles are $\pm i$ and $-1\pm i$.

Using contour integration along anti-clockwise direction of the path $$\gamma=\gamma_{1} \cup \gamma_{2} \textrm{ where } \gamma_{1}(t)=t+i 0(-R \leq t \leq R) \textrm{ and } \gamma_{2}(t)=R e^{i t} (0<t<\pi), $$ we have $$ \begin{aligned} &\int_{-\infty}^{+\infty} \frac{\cos x}{\left(1+x+x^2\right)^2+1} d x \\ =&\Re \int_\gamma \frac{e^{zi}}{\left(z^2+1\right)\left(z^2+2 z+2\right)} d y \\ =&\Re\left[2 \pi i \left(\lim _{z \rightarrow i}(z-i) \frac{e^{z i}}{\left(z^2+1\right)\left(z^2+2 z+2\right)}+\right.\lim _{z \rightarrow-1+i}(z+1-i) \frac{e^{zi}}{\left(z^2+1\right)\left(z^2+2 z+2\right)}\right] \\ =&2 \pi \Re\left[i \left(\lim _{z \rightarrow i} \frac{e^{z i}}{(z+i)\left(z^2+2 z+2\right)} + \lim _{z \rightarrow-1+i} \frac{e^{z i}}{\left(z^2+1\right)(z+1+i)}\right)\right] \\ =&2\pi \Re\left[i\left(\frac{e^{-1}}{2 i(1+2 i)}+\frac{e^{-1-i}}{-2 i(2 i-1)}\right)\right] \\ =&\frac{\pi}{e} \Re\left(\frac{1}{1+2 i}+\frac{e^{-i}}{1-2 i}\right) \\ =& \frac{\pi}{5 e}(1+\cos 1+2\sin 1) \end{aligned} $$