# Contour integraion of a rational function of logarithm and exponential

$$\int_{0}^\infty \frac{\log(x)\cos(x)}{(x^2+1)^2}\,dx = – \frac{\pi \mathrm{Ei}(1)}{4e}-\frac{\pi}{4e}$$

$$\textit{proof}$$

Consider the following function

$$f(z) = \frac{\log(z) }{(z^2+1)^2}e^{iz}$$

Now consider the principle logarithm where

$$\log(z) = \log|r|+i \theta \,\,\, , \theta \,\in (-\pi , \pi]$$

Consider the following contour

Then by the residue theorem
$$\small \int_{C_R}f(z)\,dz+\int_{c_r}f(z)\,dz+\int_{r}^R \frac{\log(x) }{(x^2+1)^2}e^{ix}\,dx+\int_{-R}^{-r} \frac{(\log|x|+\pi i) }{(x^2+1)^2}e^{ix}\,dx\\ = 2\pi \,i\mathrm{Res}_{ i} f(z)$$

Which simplifies to

$$\small \int_{C_R}f(z)\,dz+\int_{c_r}f(z)\,dz+\int_{r}^R \frac{\log(x) }{(x^2+1)^2}e^{ix}\,dx+\int_{r}^{R} \frac{(\log(x)+\pi i) }{(x^2+1)^2}e^{-ix}\,dx\\ = 2\pi i\mathrm{Res}_{ i} f(z)$$

Or

$$\small \int_{C_R}f(z)\,dz+\int_{c_r}f(z)\,dz+2\int_{r}^R \frac{\cos(x) \log(x)}{(x^2+1)^2}\,dx+\pi i \int_{r}^{R} \frac{e^{-ix}}{(x^2+1)^2}\,dx \\= 2\pi i\mathrm{Res}_{ i} f(z)$$
Note that for the semi-circle

$$M_R= \mathrm{max}_{\theta \in [0,\pi]}\left| \frac{\log(R)+i\theta }{(R^2e^{2 i\theta}+1)^2}\right|\leq \frac{\log R+ \pi}{|R^2 e^{2 i\theta}+1|} \to 0$$

It follows by the Jordan’s lemma that

$$\lim_{R\to \infty} \int_{C_R}f(z)\,dz =0$$

For the smaller semi-circle

$$\int_{c_r}f(z)\,dz = ir\int^{\pi}_0 \frac{\log r +i \pi }{(r^2e^{2i\theta}+1)^2}e^{r e^{i \theta}}e^{i\theta}\,d\theta$$

Note that

$$\left| \frac{\log r +i \pi }{(r^2e^{2i\theta}+1)^2}e^{r ie^{i \theta}}\right|\leq \frac{(\log r + \pi)(e^{r}+1) }{|r^2e^{2i\theta}+1|}\leq M_r$$

By the ML inequality we have

$$\lim_{r \to 0}\left| \int_{c_r}f(z)\,dz \right|\leq \lim_{r \to 0} \pi r M_r \to 0$$

It follows then

$$2\int_{0}^\infty \frac{\cos(x) \log(x)}{(x^2+1)^2}\,dx+\pi i \int_{0}^\infty \frac{e^{-ix}}{(x^2+1)^2}\,dx = 2\pi i\mathrm{Res}_{ i} f(z)$$

Evaluating the residue

$$\mathrm{Res}_{i} f(z) = \lim_{z \to i} \frac{d}{dz}\left( (z-i)^2 \frac{\log(z) }{(z^2+1)^2}e^{iz}\right)=\frac{\pi +i}{4e}$$

Note that

$$\int_{0}^\infty \frac{e^{ix}}{(x^2+1)^2}\,dx=\frac{\pi}{2e}-i \frac{\mathrm{Ei}(1)}{2e}$$

Since

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

By integrating around a semi-circle in the upper half plane

$$\int_{0}^\infty \frac{\cos(x)}{(x^2+1)^2}\,dx = \frac{\pi}{2e}$$

For the other integral, It is easy to see that

$$\int_{0}^\infty \frac{\sin(x)}{x^2+a^2 }\,dx = \frac{1}{2a}[e^{-a} \mathrm{Ei}'(a)-e^{a}\mathrm{Ei}(-a)]$$

By differentiation and letting $a \to 1$ we have
$$\int_{0}^\infty \frac{\sin(x)}{(x^2+1)^2 }\,dx=\frac{\mathrm{Ei}(1)}{2e}$$

We deduce that

$$2\int_{0}^\infty \frac{\log(x) \cos(x)}{(x^2+1)^2}\,dx +\pi i\left( \frac{\pi}{2e}-i \frac{\mathrm{Ei}(1)}{2e}\right) = 2\pi i \left(\frac{π}{4 e}+\frac{i}{4e} \right)$$

This simplifies to

$$\int_{0}^\infty \frac{\log(x)\cos(x)}{(x^2+1)^2}\,dx = – \frac{\pi \mathrm{Ei}(1)}{4e}-\frac{\pi}{4e}$$

This entry was posted in Contour Integration and tagged , , , , , , , . Bookmark the permalink.