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

closed-formdefinite integrals

$\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$

Best Answer

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.