Is there a known closed form solution to $\int_0^1\frac{\ln(1+x^{2n})}{1+x^2} \,dx$?

$\require{begingroup} \begingroup$ $\def\e{\mathrm{e}}\def\W{\operatorname{W}}\def\Wp{\operatorname{W_0}}\def\Wm{\operatorname{W_{-1}}}\def\Catalan{\mathsf{Catalan}}$

Related question

Is there a known closed form solution to

\begin{align} I_n&= \int_0^1\frac{\ln(1+x^{2n})}{1+x^2} \,dx =? \tag{0}\label{0} \end{align}

It checks out numerically, for $n=1,\dots,7$ that

\begin{align} I_1= \int_0^1\frac{\ln(1+x^2)}{1+x^2} \,dx &= \tfrac\pi2\,\ln2-\Catalan \tag{1}\label{1} ,\\ I_2= \int_0^1\frac{\ln(1+x^{2\cdot2})}{1+x^2} \,dx &= \tfrac\pi2\,\ln(2+\sqrt2)-2\Catalan \tag{2}\label{2} ,\\ I_3= \int_0^1\frac{\ln(1+x^{2\cdot3})}{1+x^2} \,dx &= \tfrac\pi2\,\ln6-3\Catalan \tag{3}\label{3} ,\\ I_4= \int_0^1\frac{\ln(1+x^{2\cdot4})}{1+x^2} \,dx &= \tfrac\pi2\,\ln(4+\sqrt2+2\sqrt{4+2\sqrt2})-4\Catalan \tag{4}\label{4} ,\\ I_5= \int_0^1\frac{\ln(1+x^{2\cdot5})}{1+x^2} \,dx &= \tfrac\pi2\,\ln(10+4\sqrt5)-5\Catalan = \tfrac\pi2\,\ln(10\cot^2\tfrac\pi5)-5\Catalan \tag{5}\label{5} ,\\ I_6= \int_0^1\frac{\ln(1+x^{2\cdot6})}{1+x^2} \,dx &= \tfrac\pi2\,\ln((5\sqrt2+2\sqrt{12})(1+\sqrt2))-6\Catalan \tag{6}\label{6} ,\\ I_7= \int_0^1\frac{\ln(1+x^{2\cdot7})}{1+x^2} \,dx &= \tfrac\pi2\,\ln(14\cot^2\tfrac\pi7)-7\Catalan \tag{7}\label{7} , \end{align}

so \eqref{0} seems to follow the pattern

\begin{align} I_n&= \tfrac\pi2\,\ln(f(n))-n\Catalan \tag{8}\label{8} \end{align}

for some function $f$.

Items \eqref{5} and \eqref{7} look promising as they agree to $f(n)=2n\cot^2(\tfrac\pi{n})$, but the other fail on that.


Edit:

Also, it looks like \begin{align} \int_1^\infty\frac{\ln(1+x^{2n})}{1+x^2} \,dx &=\tfrac\pi2\,\ln(f(n))+n\Catalan \tag{9}\label{9} \end{align}

and

\begin{align} \int_0^\infty\frac{\ln(1+x^{2n})}{1+x^2} \,dx &=\pi\,\ln(f(n)) \tag{10}\label{10} \end{align}

with the same $f$.


Edit

Thanks to the great answer by @Quanto, the function $f$ can be defined as

\begin{align} f(n)&= 2^n\!\!\!\!\!\!\!\!\!\! \prod_{k = 1}^{\tfrac{2n-1+(-1)^n}4} \!\!\!\!\!\!\!\!\! \cos^2\frac{(n+1-2k)\pi}{4n} \tag{11}\label{11} . \end{align}

$\endgroup$


Solution 1:

The close-form result can be expressed as

$$\color{blue}{ \int_0^1\frac{\ln(1+x^{2n})}{1+x^2} \,dx = -nG+\frac\pi2 n \ln 2 + \pi \sum_{k=1}^{[\frac n2]}\ln \cos\frac{(n+1-2k)\pi}{4n} } $$

as shown below. Note that

\begin{align} I_n = \int_0^1\frac{\ln(1+x^{2n})}{1+x^2} \,dx \overset{x\to\frac1x} == \frac12 J_n - nG \end{align}
where $ \int_1^\infty\frac{\ln x}{1+x^2} \,dx=G$ and

$$J_n =\int_0^\infty\frac{\ln(1+x^{2n})}{1+x^2} \,dx $$ Substitute $$1+x^{2n} = \prod_{k=1}^{n}(1+e^{i\pi\frac{n+1-2k}n }x^2) $$ and use the known result $\int_0^\infty \frac{\ln(1+ax^2)}{1+x^2}dx= \pi\ln(1+a^{\frac12}) $ to integrate

\begin{align} J_{n}& =\int_0^\infty\frac{dx}{1+x^2} \sum_{k=1}^{n} \ln (1+e^{i\pi\frac{n+1-2k}n }x^2) = \pi\sum_{k=1}^{n} \ln (1+e^{i\pi\frac{n+1-2k}{2n} })\\ &=n \pi \ln 2 + 2\pi\sum_{k=1}^{[\frac n2]} \ln \cos\frac{(n+1-2k)\pi}{4n} \end{align} where the symmetry of the sequence is recognized in the last step.

Solution 2:

Not a complete answer, but an elaboration of what I said in the comments. To evaluate $$\int_1^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx$$

Write it as $$\int_1^\infty\frac{\ln\left(x^{-2n}+1\right)+\ln\left(x^{2n}\right)}{1+x^2} dx = \int_1^\infty\frac{\ln\left(x^{-2n}+1\right)}{1+x^2} dx+2n\int_1^\infty\frac{\ln\left(x\right)}{1+x^2} dx$$

The second integral is a standard integral for Catalan's constant. To solve the first, make the substitution $x \to \frac{1}{x}$ to get $$\int_0^1\frac{\ln(1+x^{2n})}{1+x^2} dx + 2nG$$

So if you know the value of any of the integrals with bounds $(0,\infty)$ or $(1,\infty)$ or $(0,1)$, you could find the other two.


The series for $\ln(1+x)$ converges for $|x|<1$, so expand it to get $$\int_0^1\frac{\sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k}x^{2nk}}{1+x^2}dx = \sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k}\int_{0}^{1}\frac{x^{2nk}}{1+x^{2}}dx$$

Then you can expand $\frac{1}{1+x^2}$ to get $$\sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k}\int_{0}^{1}x^{2nk}\sum_{m=0}^{\infty}\left(-1\right)^{m}x^{2m}dx = \sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k}\sum_{m=0}^{\infty}(-1)^m\int_{0}^{1}x^{2nk}x^{2m}dx$$

Finally, evaluate the inner integral to get $$\sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k}\sum_{m=0}^{\infty}(-1)^m\frac{1}{2nk+2m+1}$$

Solution 3:

Just to put in more closed form what @Varu Vejalla has evaluated

$I=\int_0^1\frac{\ln(1+x^{2n})}{1+x^2} dx$

$\int_0^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx=\frac{1}{2}\int_{-\infty}^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx=\int_0^1\frac{\ln(1+x^{2n})}{1+x^2} dx+\int_1^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx=I+\int_1^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx$ $\int_1^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx [t=\frac{1}{x}]=\int_0^1\frac{\ln(1+t^{2n})}{1+t^2} dt-\int_0^1\frac{\ln(t^{2n})}{1+t^2} dx=I+2nG$

$$I=\frac{1}{4}\int_{-\infty}^\infty\frac{\ln(1+x^{2n})}{1+x^2} dx-nG$$

Branch points of $\log$ (roots of $1+x^{2n}$) are $e^{\frac{i\pi}{2n}},e^{-\frac{i\pi}{2n}}, e^{\frac{3i\pi}{2n}}, e^{\frac{-3i\pi}{2n}},... e^{\frac{(2n-1)i\pi}{2n}}, e^{-\frac{(2n-1)i\pi}{2n}} $

Next we integrate in the complex plane, closing the contour in the upper half-plane for the roots $e^{-\frac{(2k-1)i\pi}{2n}}$ and in the lower half-plane for the roots $e^{+\frac{(2k-1)i\pi}{2n}}$ - to integrate the single-valued function.

Finally we get $$I=\frac{2\pi{i}}{4*2i}\log\Bigl((-i-e^{\frac{i\pi}{2n}})(i-e^{-\frac{i\pi}{2n}})...(-i-e^{\frac{(2n-1)i\pi}{2n}})((-i-e^{-\frac{(2n-1)i\pi}{2n}})\Bigr)-nG=$$ $$=\frac{\pi}{4}\log\Bigl((2+2\sin\frac{\pi}{2n})...(2+2\sin\frac{(2n-1)\pi}{2n})\Bigr)-nG$$

$$I=\frac{\pi}{4}\log\Bigl((1+\sin\frac{\pi}{2n})...(1+\sin\frac{(2n-1)\pi}{2n})\Bigr)+\frac{\pi{n}}{4}\log2-nG$$