Integration of $\int_0^\infty\frac{1-\cos x}{x^2(x^2+1)}\,dx$ by means of complex analysis

Dear all: this time I have the integral $$\int_0^\infty\frac{1-\cos x}{x^2(x^2+1)}\,dx$$and we must try to solve it using complex integration, residues, Cauchy's Theorem and the whole lot. (BTW, does anyone have any idea whether this integral can be solved without complex functions?)

$\underline{\text{What I did}}$: Letting $\,\gamma\,$ be the integration path containing the segments $$\begin{align}(i)&\,\,\text{the real interval} \,[-R\,,\,-\epsilon]\\(ii)&\,\,\text{the "little" half circle} \,\{z\;|\;z=\epsilon e^{i\theta}\,,\,\theta\in [0,\pi]\}\\(iii)&\,\,\text{ the real interval}\,[\epsilon\,,\,R]\\(iv)&\,\,\text{ and the "big" half circle}\,\{z\;|\;z=R e^{i\theta}\,,\,\theta\in [0,\pi]\}\end{align}$$ we take the integral $$I:=\oint_\gamma\frac{1-e^{iz}}{z^2(z^2+1)}\,dz$$ As the only pole of this function within $\,\gamma\,$ is the simple one $\,z=i\,$ (for $\,\epsilon<1<R\,$, say), and $$\,\operatorname{Res}_{z=i}\left(\frac{1-e^{iz}}{z^2(z^2+1)}\right)=\lim_{z\to i}\frac{1-e^{iz}}{z^2(z+i)}=\frac{e^{-1}-1}{2i}$$We get from the Cauchy's residue theorem $$\displaystyle{I=2\pi i\,\frac{e^{-1}-1}{2i}=\pi\left(\frac{1}{e}-1\right)}$$

We now pass to evaluate the above integral on each segment of $\,\gamma\,$ described above:$$\text{on}\,(iv)\,\text{it is easy:}\,\left|\frac{1-e^{iz}}{z^2(z^2+1)}\right|\leq\frac{1+e^{-R\cos\theta}}{R^4}\xrightarrow[R\to\infty]{} 0$$

On $\,(i)\,,\,(iii)\,$ together and letting $\,R\to \infty\,$ we get $\,\displaystyle{\int_{-\infty}^\infty\frac{1-\cos x}{x^2(x^2+1)}\,dx}\,$ , which isn't a problem as the integrand function is even.

So here comes the problem: on $\,(ii)\,$ we have:$$z=\epsilon e^{i\theta}\Longrightarrow dz=\epsilon ie^{i\theta}d\theta\,,\,0\leq\theta\leq \pi\,\,\text{but going from left to right, so}$$$$\oint_{z=\epsilon e^{i\theta}}\frac{1-e^{iz}}{z^2(z^2+1)}\,dz=\int_\pi^0\frac{1-e^{i\epsilon e^{i\theta}}}{\epsilon^2e^{2i\theta}\left(\epsilon^2e^{2i\theta}+1\right)}\,\epsilon ie^{i\theta}\,d\theta$$

Now, the only thing I could came up with to evaluate the above integral when $\,\epsilon\to 0\,$ is to get the limit into the integral, getting $$\lim_{\epsilon\to 0}\frac{1-e^{i\epsilon e^{i\theta}}}{\epsilon e^{i\theta}\left(\epsilon^2 e^{2i\theta}+1\right)}=-i\Longrightarrow \int_\pi^0\frac{1-e^{i\epsilon e^{i\theta}}}{\epsilon^2e^{2i\theta}\left(\epsilon^2e^{2i\theta}+1\right)}\,\epsilon ie^{i\theta}\,d\theta\xrightarrow [\epsilon\to 0]{} -\pi$$applying L'Hospital, so the final result is$$\pi\left(\frac{1}{e}-1\right)=I\xrightarrow [R\to\infty\,,\,\epsilon\to 0]{} \int_{-\infty}^\infty\frac{1-\cos x}{x^2(x^2+1)}\,dx-\pi$$from which we get the value of $\,\displaystyle{\frac{\pi}{2e}}\,$ for our integral, which is correct (at least according to Wolframalpha), yet...

How can I justify the introduction of the limit into the integral?? The only way that seems to me possible (if at all) is to substitute $$\epsilon\to\frac{1}{\delta}$$ to get an indefinite integral with upper limit equal to $\,\infty\,$ inj $\,(ii)\,$ above and then use the dominated convergence theorem (or perhaps the monotone one).

My question is two fold: Is the substitution just described what can put me out of my misery in this case? , and: Is it possible to justify the passage of the limit into the integral without making the substitution and, thus, without resourcing to an indefinite integral with infinite upper limit?

Thank you to anyone investing he/his time just to read this question, and of course any ideas, corrections will be deeply appreciated.


Solution 1:

$$\int_0^\infty\frac{1-\cos x}{x^2(x^2+1)}\,dx$$

Since

$$\frac{1}{{{x^2}({x^2} + 1)}} = \frac{1}{{{x^2}}} - \frac{1}{{{x^2} + 1}}$$

You have

$$\int_0^\infty {\frac{{1 - \cos x}}{{{x^2}}}} {\mkern 1mu} - \int_0^\infty {\frac{{1 - \cos x}}{{1 + {x^2}}}} dx$$

Now

$$\int_0^\infty {\frac{{1 - \cos x}}{{{x^2}}}} {\mkern 1mu} =- \left. {\frac{{1 - \cos x}}{x}} \right|_0^\infty + \int_0^\infty {\frac{{\sin x}}{x}} {\mkern 1mu} = \int_0^\infty {\frac{{\sin x}}{x}} = \frac{\pi }{2}$$

So maybe now it is easier to tackle $$\int_0^\infty {\frac{{1 - \cos x}}{{1 + {x^2}}}} dx$$ which gives

$$\int_0^\infty {\frac{{1 - \cos x}}{{1 + {x^2}}}} dx = \int_0^\infty {\frac{{dx}}{{1 + {x^2}}}} - \int_0^\infty {\frac{{\cos x}}{{1 + {x^2}}}dx} = \frac{\pi }{2} - \int_0^\infty {\frac{{\cos x}}{{1 + {x^2}}}dx} $$

and thus

$$\int_0^\infty {\frac{{1 - \cos x}}{{{x^2}({x^2} + 1)}}} {\mkern 1mu} dx = \int_0^\infty {\frac{{\cos x}}{{1 + {x^2}}}dx} $$

EDIT

Since the last solution is not very satisfactory, as it has been discussed, I'll supply this solution:

Define

$$F\left( \varphi \right) = \int\limits_0^{ + \infty } {\frac{{\cos \varphi x}}{{1 + {x^2}}}dx} $$

Clearly the integral is absolutely convergent.

Thus, use the Laplace Transform, to obtain:

$$L\left( s \right) = \int\limits_0^{ + \infty } {\frac{s}{{{x^2} + {s^2}}}\frac{1}{{1 + {x^2}}}dx} $$

We evaluate this integral:

$$\frac{s}{{{x^2} + {s^2}}}\frac{1}{{1 + {x^2}}} = \frac{s}{{1 - {s^2}}}\left( {\frac{1}{{1 + {x^2}}} - \frac{1}{{{s^2} + {x^2}}}} \right)$$

$$\eqalign{ & L\left( s \right) = \frac{s}{{1 - {s^2}}}\int\limits_0^{ + \infty } {\left( {\frac{1}{{1 + {x^2}}} - \frac{1}{{{s^2} + {x^2}}}} \right)dx} \cr & L\left( s \right) = \frac{s}{{1 - {s^2}}}\left( {\frac{\pi }{2} - \int\limits_0^{ + \infty } {\frac{1}{{{s^2} + {x^2}}}dx} } \right) \cr & L\left( s \right) = \frac{s}{{1 - {s^2}}}\left( {\frac{\pi }{2} - \frac{1}{s}\frac{\pi }{2}} \right) \cr & L\left( s \right) = \frac{\pi }{2}\frac{s}{{1 - {s^2}}}\frac{{s - 1}}{s} = \frac{\pi }{2}\frac{1}{{1 + s}} \cr} $$

Taking the inverse transform, we arrive at

$$F\left( \varphi \right) = \frac{\pi }{2}{e^{ - \varphi }}$$

This is clearly for $\varphi >0$, thus the evenness of the function forces

$$F\left( \varphi \right) = \frac{\pi }{2}{e^{ - |\varphi| }}$$

and the result follows:

$$F\left( 1 \right) = \int\limits_0^\infty {\frac{{\cos x}}{{1 + {x^2}}}dx} = \frac{\pi }{{2e}}$$


Solution 2:

Since the integrand is even, we get $$ \begin{align} \int_0^\infty\frac{1-\cos(x)}{x^2(x^2+1)}\,\mathrm{d}x &=\frac12\int_{-\infty}^\infty\frac{1-\cos(z)}{z^2(z^2+1)}\,\mathrm{d}z\tag{1} \end{align} $$ Since $\lim\limits_{z\to0}\frac{1-\cos(z)}{z^2}=\frac12$, the singularity of the integrand near $z=0$ is removable. Therefore, since the integrand vanishes for $z$ within $\frac12$ of the real axis as $|z|\to\infty$ and there are no singularities within $\frac12$ of the real axis, the integral in $(1)$ does not change when shifting the path of integration from $z=t$ to $z=t-\frac{i}{2}$.

Now we can break up the integral as $$ \frac14\int_{\gamma^+}\frac{1-e^{iz}}{z^2(z^2+1)}\mathrm{d}z +\frac14\int_{\gamma^-}\frac{1-e^{-iz}}{z^2(z^2+1)}\mathrm{d}z\tag{2} $$ where $\gamma^+$ and $\gamma^-$ are as depicted below:

$\hspace{4.6cm}$path of integration

$\gamma^+$ circles two singularities ($z=0$ and $z=i$) clockwise, and $\gamma^-$ circles one singularity ($z=-i$) counter-clockwise.

All of the singularities are simple, so to get the residue at $z=z_0$, we just need to multiply by $z-z_0$ and taking $\displaystyle\lim_{z\to z_0}$

At $z=0$ the residue of $\displaystyle\frac{1-e^{iz}}{z^2(z^2+1)}$ is $-i$

At $z=i$ the residue of $\displaystyle\frac{1-e^{iz}}{z^2(z^2+1)}$ is $\displaystyle\frac{1-e^{-1}}{-2i}$

At $z=-i$ the residue of $\displaystyle\frac{1-e^{-iz}}{z^2(z^2+1)}$ is $\displaystyle\frac{1-e^{-1}}{2i}$

Putting these together with $(2)$ yields $$ \begin{align} \frac12\int_{-\infty}^\infty\frac{1-\cos(z)}{z^2(z^2+1)}\,\mathrm{d}z &=\frac{2\pi i}{4}\left(-i+\frac{1-e^{-1}}{-2i}\right)-\frac{2\pi i}{4}\left(\frac{1-e^{-1}}{2i}\right)\\ &=\frac{\pi}{2}\left(1-\frac{1-e^{-1}}{2}-\frac{1-e^{-1}}{2}\right)\\ &=\frac{\pi}{2e} \end{align} $$

Solution 3:

An easy way:

Consider $$I(a)=\int_0^\infty\frac{1-\cos ax}{x^2(x^2+1)}\,dx ;a\geqslant 0$$ Next:

$$\frac{dI}{da}= \int_0^\infty\frac{\sin ax}{x}\frac{dx}{x^2+1} $$

$$\frac{d^2I}{da^2}=\int_0^\infty\frac{\cos ax}{x^2+1}\,dx=\frac{\pi e^{-a}}{2} $$

Remark: The last result is well known in this site

Thus

$$\frac{dI}{da}=-\frac{\pi e^{-a}}{2}+\frac{\pi}{2} $$ because of $\frac{dI(0)}{da}=0$

$$I(a)= \frac{\pi e^{-a}}{2}+\frac{\pi a}{2}-\frac{\pi}{2}$$ because of $I(0)=0$

Finally, original integral:

$$I=I(1)=\frac{\pi e^{-1}}{2}$$

Solution 4:

HINT: I think that this integral would work great by using Feynman way. Your integral is very similar to one you may find in this document, namely the last page, the last integral where the author offers a set of problems to solve by using this way:

http://ocw.mit.edu/courses/mathematics/18-304-undergraduate-seminar-in-discrete-mathematics-spring-2006/projects/integratnfeynman.pdf

Solution 5:

Maple gets this anti-derivative: $$ \int \frac{1 - \operatorname{cos} (x)}{x^{2} \bigl(x^{2} + 1\bigr)} d x = -\operatorname{arctan} (x) - \frac{1}{x} - \frac{\operatorname{Si} (x - i) \operatorname{sinh} (1)}{2} - \frac{i}{2} \operatorname{Ci} (x - i) \operatorname{cosh} (1) - \frac{\operatorname{Si} (x + i) \operatorname{sinh} (1)}{2} + \frac{i}{2} \operatorname{Ci} (x + i) \operatorname{cosh} (1) + \frac{\operatorname{cos} (x)}{x} + \operatorname{Si} (x) $$ Perhaps this is done by writing $1/(x^2(1+x^2))$ in complex partial fractions? Then: the limit at $+\infty$ is $-\pi\sinh(1)/2$ and at $0$ is $-\pi\cosh(1)/2$. Subtract to get $\pi/(2e)$.