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

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.


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


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