Evaluating $\int_{-\infty}^{\infty}\frac{\ln\left(1+x^{8}\right)}{x^{2}\left(1+x^{2}\right)^{2}}dx$

calculuscomplex-analysiscontour-integrationimproper-integralsintegration

(Motivation) Here is an integral I made up for fun:

$$\int_{-\infty}^{\infty}\frac{\ln\left(1+x^{8}\right)}{x^{2}\left(1+x^{2}\right)^{2}}dx.$$

WolframAlpha doesn't seem to come up with a closed form, but I believe it is

$$2\pi\left(1+\sqrt{4+2\sqrt{2}}\right)-3\pi\left(\ln\left(\sqrt{2}\right)+\operatorname{arctanh}\left(\frac{2}{7}\sqrt{10+\sqrt{2}}\right)\right).$$

(Question) Aside from my attempt below, how else could one solve this? Could there possibly a more elegant method than constructing a 4-keyhole contour?

I will try to shorten my attempt as much as possible because it is quite lengthy. If someone wants to read all of it and find any little mistakes, then I would greatly appreciate it, as someone who is seeking to expand his complex analysis skills.

(Attempt) Let $f(z) = \dfrac{\log(1+z^8)}{z^2(1+z^2)^2}$. Its pole is $z=i$ with an order of $2$. Notice $z=0$ is a removable singularity because we can redefine $f(z) = z^6 -2z^8 +3z^{10}-4z^{12}+O\left(z^{13}\right)$ to make it holomorphic at $z=0$. The branch points of $f(z)$ are obtained by

$$1+z^8=0 \implies z = \exp\left(\frac{i\pi}{8}(2n+1)\right)$$

where $n \in \left\{0, 1, \ldots, 7\right\}.$ Also, let $B_n = \exp\left(\dfrac{i\pi}{8}(2n+1)\right)$. Additionally,

$$\log\left(1+z^{8}\right)=\log\left(\prod_{n=0}^{7}\left(z-B_{n}\right)\right)=\sum_{n=0}^{7}\log\left(z-B_{n}\right)=\sum_{n=0}^{7}\left(\log\left|z-B_{n}\right|+i\operatorname{arg}\left(z-B_{n}\right)\right).$$

Let $A_n(z) = \operatorname{arg}\left(z-B_{n}\right)$. For $n \in \left\{0,1,2,3\right\}$, let $A_n(z) \in \left(\dfrac{\pi}{8}\left(2n+1\right),\dfrac{\pi}{8}\left(2n+1\right)+2\pi\right)$. For $n \in \left\{4,5,6,7\right\}$, let $A_n(z) \in \left(\dfrac{\pi}{8}\left(2n+1\right)-2\pi,\dfrac{\pi}{8}\left(2n+1\right)\right)$.

For convenience, I created this graphic of what the contour looks like. It can also be viewed here.

enter image description here

By Cauchy's Residue Theorem, we have

$$2\pi i\operatorname{Res}(f(z),z=i) = \left(\int_{-R}^{R}+\sum_{k=1}^{8}\int_{\lambda_k}+\sum_{m=0}^{3}\int_{\gamma_m}+\int_{\Gamma}\right)f\left(z\right)dz.$$

Perhaps I will write an addendum explaining how to show the integrals over $\Gamma$ and $\gamma_m$, for each $m$ listed in the sum, go to $0$.


This is how to calculate the residue:

$$2\pi i\operatorname{Res}\left(\dfrac{\log(1+z^8)}{z^2(1+z^2)^2},z=i\right) = 2\pi i\cdot\frac{1}{\left(2-1\right)!}\lim_{z \to i}\frac{d^{2-1}}{dz^{2-1}}\frac{\log\left(1+z^{8}\right)\left(z-i\right)^{2}}{z^{2}\left(z+i\right)^{2}\left(z-i\right)^{2}} = 2\pi-\frac{3\pi}{2}\ln\left(2\right)$$

after some basic calculus grunt work.


This is how to calculate the $\lambda_1$ and $\lambda_2$ integrals:

$$
\begin{align}
& \lim_{\epsilon \to 0}\lim_{\lambda_1,\lambda_2 \to \Lambda_0}\lim_{R\to\infty}\left(\int_{\lambda_1}f(z-i\epsilon)d(z-i\epsilon) + \int_{\lambda_2}f(z+i\epsilon)d(z+i\epsilon)\right) \\
=&-\lim_{R\to\infty}\lim_{\epsilon\to 0}\int_{e^{i\pi/8}}^{Re^{i\pi/8}}\frac{d(z-i\epsilon)}{(z-i\epsilon)^2(1+(z-i\epsilon)^2)^2}\cdot \left(\log|1+(z-i\epsilon)^8|+i\sum_{n=0}^{7}A_n(z-i\epsilon)\right) \\
&+\lim_{R\to\infty}\lim_{\epsilon\to 0}\int_{e^{i\pi/8}}^{Re^{i\pi/8}}\frac{d(z+i\epsilon)}{(z+i\epsilon)^2(1+(z+i\epsilon)^2)^2}\cdot \left(\log|1+(z+i\epsilon)^8|+i\sum_{n=0}^{7}A_n(z+i\epsilon)\right) \\
=& -2\pi i\int_{e^{i\pi/8}}^{i\infty}\frac{dz}{z^{2}\left(1+z^{2}\right)^{2}} \tag{1}\\
\end{align}
$$

where in $(1)$ we used $\displaystyle \lim_{\epsilon \to 0}A_0(z-i\epsilon) = \dfrac{\pi}{8}+2\pi$ and $\displaystyle \lim_{\epsilon \to 0}A_0(z+i\epsilon) = \dfrac{\pi}{8}.$ Since

$$\int \frac{dz}{z^2(1+z^2)^2} = -\frac{3}{2}\arctan\left(z\right)-\frac{3z^{2}+2}{2z^{3}+2z}+C,$$

we can use the Fundamental Theorem of Line Integrals to get the desired integral over $\Lambda_0$ to be

$$-2\pi i\left(e^{-\frac{i\pi}{8}}+\frac{1}{4}\sec\left(\frac{\pi}{8}\right)-\frac{3}{2}\arctan\left(e^{-\frac{i\pi}{8}}\right)\right).$$

We can apply this same sort of process for the other $\lambda$ integrals. After a lot of work, combining those contributions ultimately yields

$$3\pi\operatorname{arctanh}\left(\frac{2}{7}\sqrt{10+\sqrt{2}}\right)-2\pi\sqrt{4+2\sqrt{2}}.$$


Finally, we put everything together:

$$2\pi-\frac{3\pi}{2}\ln\left(2\right)=\int_{-\infty}^{\infty}\frac{\log\left(1+z^{8}\right)}{z^{2}\left(1+z^{2}\right)^{2}}dz+3\pi\operatorname{arctanh}\left(\frac{2}{7}\sqrt{10+\sqrt{2}}\right)-2\pi\sqrt{4+2\sqrt{2}}+0+0+0+0+0.$$

In conclusion, the integral in question equals

$$2\pi\left(1+\sqrt{4+2\sqrt{2}}\right)-3\pi\left(\ln\left(\sqrt{2}\right)+\operatorname{arctanh}\left(\frac{2}{7}\sqrt{10+\sqrt{2}}\right)\right).$$

Any answer/comment shedding some light is appreciated.

Best Answer

It may be desirable to simplify the integral first \begin{align} I=&\int_{-\infty}^{\infty}\frac{\ln\left(1+x^{8}\right)}{x^{2}\left(1+x^{2}\right)^{2}}dx\\ = &\ 2\int_{0}^{\infty}\ln(1+x^8)\left(\frac1{x^2} -\frac1{1+x^{2}} -\frac1{(1+x^{2})^2}\right)dx \end{align} where \begin{align} &\int_{0}^{\infty}\frac{\ln\left(1+x^{8}\right)}{x^{2}}dx \overset{ibp}=\int_{0}^{\infty}\frac{8x^6}{1+x^{8}} dx=\pi\csc\frac\pi8\\ &\int_{0}^{\infty}\frac{\ln\left(1+x^{8}\right)}{(1+x^2)^2}dx \overset{x\to\frac1x}=\frac12\int_{0}^{\infty}\frac{\ln(1+x^8)}{1+x^2} dx-4\int_0^\infty \underset{=\frac\pi4}{\frac{x^2\ln x}{(1+x^2)^2} }\overset{ibp}{dx} \end{align} Then $$I= 2\pi\left(1+\csc\frac\pi8\right)-3\int_{0}^{\infty}\frac{\ln\left(1+x^{8}\right)}{1+x^2}dx $$ and the simplified integral can be evaluated with either complex or real analysis, which yields the pleasant closed form $$I = 2\pi\left[1+\csc\frac\pi8-3\ln\bigg(\sqrt2+\frac1{\sqrt2} \csc\frac{\pi}{8}\bigg)\right] $$