Integral $\int_0^\infty \frac{\ln(1+x+x^2)}{1+x^2}dx$

Solution 1.

By splitting the integral at $1$ and letting $x\to \frac{1}{x}$ in the second part, we get:$$I=\int_0^\infty \frac{\ln(1+x+x^2)}{1+x^2}dx=\int_0^1 \frac{\ln(1+x+x^2)+\ln\left(1+\frac{1}{x}+\frac{1}{x^2}\right)}{1+x^2}dx$$ $$=2\int_0^1 \frac{\ln(1+x+x^2)}{1+x^2}dx-2\int_0^1 \frac{\ln x}{1+x^2}dx$$ Via the substitution $x=\frac{1-t}{1+t}\Rightarrow dx=-\frac{2}{(1+t)^2}dt$ and using this, we obtain: $$I=2\int_0^1\frac{\ln\left(\frac{3+t^2}{(1+t)^2}\right)}{1+t^2}dt+2G=2\int_0^1 \frac{\ln(3+t^2)}{1+t^2}dt-4\int_0^1\frac{\ln(1+t)}{1+t^2}+2G$$ The second one is a well known Putnam integral, and for the first one we can try to use Feynman's trick. $$I=2J-\frac{\pi}{2}\ln 2+2G, \quad J=\int_0^1 \frac{\ln(3+x^2)}{1+x^2}dx$$

$$J(a)=\int_0^1 \frac{\ln(2+a(1+x^2))}{1+x^2}dx\Rightarrow J'(a)=\frac1a\int_0^1 \frac{dx}{\frac{a+2}{a}+x^2}dx$$ $$=\frac1a\sqrt{\frac{a}{a+2}}\arctan\left(x\sqrt{\frac{a}{a+2}}\right)\bigg|_0^1=\frac{1}{\sqrt{a(a+2)}}\arctan\left(\sqrt{\frac{a}{a+2}}\right)$$ We are looking to find $J=J(1)$, but we also have: $J(0)=\frac{\pi}{4}\ln 2$ so: $$J=J(1)-J(0)+J(0)=\underbrace{\int_0^1 J'(a)da}_{=K}+\frac{\pi}{4}\ln 2 $$ Now letting $\sqrt{\frac{a+2}{a}}=x\Rightarrow \frac{1}{\sqrt{a(a+2)}}da=-a dx=-\frac{2}{x^2-1}dx\,$ gives us: $$K=\int_0^1 \frac{1}{\sqrt{a(a+2)}}\arctan\left(\sqrt{\frac{a}{a+2}}\right)da=2\int_\sqrt 3^\infty \frac{\arctan \left(\frac{1}{x}\right)}{x^2-1}dx$$ $$=\frac{\pi}{2}\ln(2+\sqrt 3)-2\int_{\sqrt 3}^\infty \frac{\arctan x}{x^2-1}dx $$ $$H=2\int_{\sqrt 3}^\infty \frac{\arctan x}{x^2-1}dx\overset{x=\tan t}=-2\int_\frac{\pi}{3}^\frac{\pi}{2} \frac{t}{\cos(2t)}dt\overset{\large 2t=x+\frac{\pi}{2}}=\int_{\frac{\pi}{6}}^\frac{\pi}{2} \frac{\frac{\pi}{4}+\frac{x}{2}}{\sin x}dx$$ $$=\frac{\pi}{4}\ln\left(\tan\frac{x}{2}\right)\bigg|_\frac{\pi}{6}^\frac{\pi}{2}+\frac12 \int_0^\frac{\pi}{2}\frac{x}{\sin x}dx-\frac12\int_0^\frac{\pi}{6}\frac{x}{\sin x}dx$$ The last two integrals are linked in this post and using their values we get: $$H=\frac{\pi}{4}\ln(2+\sqrt 3)+G+\frac{\pi}{12}\ln(2+\sqrt 3)-\frac23G=\boxed{\frac{\pi}{3}\ln(2+\sqrt 3)+\frac13G}$$ $$\Rightarrow \boxed{K=\frac{\pi}{6}\ln(2+\sqrt 3)-\frac13G}\Rightarrow \boxed{J=\frac{\pi}{6}\ln(2+\sqrt 3)+\frac{\pi}{4}\ln 2-\frac13G}$$ $$\Rightarrow I=\int_0^\infty \frac{\ln(1+x+x^2)}{1+x^2}dx=\boxed{\frac{\pi}{3}\ln(2+\sqrt 3)+\frac43G}$$


Solution 2.

We can start by considering: $$A=\int_0^\frac{\pi}{2} \ln(2+\sin x)dx,\quad B=\int_0^\frac{\pi}{2}\ln(2-\sin x)dx$$ Like in mrtaurho's approach we have: $$I=\frac{\pi}{2}\ln 2 +A=\frac{\pi}{2}\ln 2+\frac12\left((A+B)+(A-B)\right)\tag 1$$ A solution for $A-B\,$ can be found here. $$A-B=\int_0^\frac{\pi}{2}\ln\left(\frac{2+\sin x}{2-\sin x}\right)dx=-\frac{\pi}{3}\ln(2+\sqrt 3) +\frac{8}{3}G\tag2$$ And for $A+B$ we can directly use this result. $$A+B=\int_0^\frac{\pi}{2} \ln(4-\sin^2 x)=\int_0^\frac{\pi}{2} \ln(4\cos^2x +3\sin^2 x)dx$$$$=\pi \ln 2 +\int_0^\frac{\pi}{2} \ln\left(\cos^2 x+\frac34 \sin^2 x\right)dx=\pi\ln\left(1+\frac{\sqrt 3}{2}\right)\tag3$$ Now plugging $(2)$ and $(3)$ into $(1)$ yields the result.

$$\boxed{I=\frac{\pi}{2}\ln 2+\frac12\left(\pi\ln(2+\sqrt 3)-\pi \ln 2-\frac{\pi}{3}\ln(2+\sqrt 3)+\frac83G\right)=\frac{\pi}{3}\ln(2+\sqrt 3)+\frac43G}$$


Start by letting $x\mapsto\tan x$ we obtain $$\int_0^\infty\frac{\log(1+x+x^2)}{1+x^2}\mathrm dx\stackrel{x\mapsto\tan x}=\int_0^\frac\pi2\log(1+\tan x+\tan^2x)\mathrm dx=\int_0^\frac\pi2\log\left(\frac{1+\sin x\cos x}{\cos^2x}\right)\mathrm dx$$ Splitting the logarithm we are left with a standard integral, solvable by differentiating the Beta Function for instance, and another one which I already referred to within the comments. To be precise we get \begin{align*} \int_0^\frac\pi2\log\left(\frac{1+\sin x\cos x}{\cos^2x}\right)\mathrm dx&=\pi\log 2+\int_0^\frac\pi2\log(1+\sin x\cos x)\mathrm dx\\ &=\pi\log 2+2\int_0^\frac\pi4\log\left(1+\frac12\sin2x\right)\mathrm dx\\ &=\pi\log 2+\int_0^\frac\pi2\log\left(1+\frac12\sin x\right)\mathrm dx\\ &=\frac\pi2\log2+\int_0^\frac\pi2\log\left(2+\sin x\right)\mathrm dx \end{align*} The latter integral $-$ even a more general case $-$ is examined within this AoPS thread. An expression is deduced by the user gustin33. I won't copy his derivation here since his own solution is impressive enough. For the given case he obtained $$\int_0^\frac\pi2\log\left(2+\sin x\right)\mathrm dx=\frac{4G}3+\frac\pi3\log(2+\sqrt3)-\frac\pi2\log2 $$ Which overall yields to the result.

$$\therefore~\int_0^\infty\frac{\log(1+x+x^2)}{1+x^2}\mathrm dx~=~\frac{4G}3+\frac\pi3\log(2+\sqrt3)$$

The crucial point of the linked post is the identity $$\int_0^\frac\pi2\log(a+\sin x)\mathrm dx=2\operatorname{Ti}_2(a+\sqrt{a^2-1})-\frac\pi2(\log2+\cosh^{-1}a)$$ For $a=2$ the result follows. I will see if I can find another proof for this identity; otherwise I will just leave this here.


EDIT I

Maybe I am on the right track now! Using the integral representation for the Dilogarithm used in this post and reexpressing the Inverse Tangent Integral in terms of the Dilogarithm aswell we obtain $$\small \begin{align*} \operatorname{Ti}_2(a+\sqrt{a^2-1})&=\frac1{2i}\left[\operatorname{Li}_2(ia+i\sqrt{a^2-1})-\operatorname{Li}_2(-ia+-i\sqrt{a^2-1})\right]\\ &=\frac1{2i}\left[\int_0^1\frac{ia+i\sqrt{a^2-1}}{(ia+i\sqrt{a^2-1})t-1}\log t\mathrm dt-\int_0^1\frac{-ia+-i\sqrt{a^2-1}}{(-ia+-i\sqrt{a^2-1})t-1}\log t\mathrm dt\right]\\ &=\frac{a+\sqrt{a^2-1}}2\int_0^1\left[\frac1{(-1)+i(a+\sqrt{a^2-1})t}+\frac1{(-1)-i(a+\sqrt{a^2-1})t}\right]\log t\mathrm dt\\ &=-(a+\sqrt{a^2-1})\int_0^1\frac{\log t}{1+(a+\sqrt{a^2-1})^2t^2}\mathrm dt \end{align*} $$ Mabye this integral is useful for someone. I will try to find something from which it is useful to me too.


EDIT II

The integral can also be reduced to finding $$\int_0^1\frac{\arctan t}{t^2+t+1}\frac{1-t^2}{1+t^2}\mathrm dt$$ I am almost certain I have seen this one before aswell. I will search for it.


\begin{align}I&=\int_0^\infty \frac{\ln(1+x+x^2)}{1+x^2}dx\\ &=\int_0^1 \frac{\ln(1+x+x^2)}{1+x^2}dx+\int_1^\infty \frac{\ln(1+x+x^2)}{1+x^2}dx\\ \end{align} In the latter integral perform the change of variable $y=\dfrac{1}{x}$

\begin{align}I&=2\int_0^1 \frac{\ln(1+x+x^2)}{1+x^2}dx+2\text{G} \end{align} Perform the change of variable $y=\dfrac{1-x}{1+x}$, \begin{align}I&=2\int_0^1 \frac{\ln(3+x^2)}{1+x^2}dx-4\int_0^1 \frac{\ln(1+x)}{1+x^2}dx+2\text{G}\\ &=\frac{\pi}{2} \ln 3+2\int_0^1 \frac{\ln\left(1+\frac{x^2}{3}\right)}{1+x^2}dx-4\int_0^1 \frac{\ln(1+x)}{1+x^2}dx+2\text{G}\\ \end{align}

Define $F$ on $[0;1]$ by, \begin{align}F(a)=\int_0^1 \frac{\ln(1+a^2x^2)}{1+x^2}dx\end{align} Observe that, $\displaystyle F(0)=0,F\left(\frac{1}{\sqrt{3}}\right)=\int_0^1 \frac{\ln\left(1+\frac{x^2}{3}\right)}{1+x^2}dx$.

\begin{align}F^\prime (a)&=\int_0^1 \frac{2a x^2}{(1+x^2)(1+a^2x^2)}dx\\ &=2\left[a\left(\frac{\arctan x}{a^2-1}-\frac{\arctan(ax)}{a(a^2-1)}\right)\right]_0^1\\ &=\frac{\pi a}{2(a^2-1)}-\frac{2\arctan a}{a^2-1} \end{align} Therefore, \begin{align}F\left(\frac{1}{\sqrt{3}}\right)&=\frac{\pi}{2}\int_0^{\frac{1}{\sqrt{3}}}\frac{ a}{a^2-1}\,da+2\int_0^{\frac{1}{\sqrt{3}}}\frac{\arctan a}{1-a^2}\,da\\ &=\frac{\pi}{4}\Big[\ln(1-a^2)\Big]_0^{\frac{1}{\sqrt{3}}}+2\int_0^{\frac{1}{\sqrt{3}}}\frac{\arctan a}{1-a^2}\,da\\ &=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)+2\int_0^{\frac{1}{\sqrt{3}}}\frac{\arctan a}{1-a^2}\,da\\ \end{align} Perform the change of variable $y=\dfrac{1-a}{1+a}$, \begin{align}F\left(\frac{1}{\sqrt{3}}\right)&=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)+\int_{2-\sqrt{3}}^1\frac{\arctan\left(\frac{1-a}{1+a}\right)}{a}\,da\\ &=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)+\frac{\pi}{4}\int_{2-\sqrt{3}}^1\frac{1}{a}\,da-\left(\int_0^1\frac{\arctan a}{a}\,da-\int_0^{2-\sqrt{3}}\frac{\arctan a}{a}\,da\right)\\ &=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)-\frac{\pi}{4}\ln\left(2-\sqrt{3}\right)-\text{G}+\int_0^{2-\sqrt{3}}\frac{\arctan a}{a}\,da\\ &=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)-\frac{\pi}{4}\ln\left(2-\sqrt{3}\right)-\text{G}+\Big[\arctan a\ln a\Big]_0^{2-\sqrt{3}}-\int_0^{2-\sqrt{3}}\frac{\ln a}{1+a^2}\,da\\ &=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)-\frac{\pi}{6}\ln\left(2-\sqrt{3}\right)-\text{G}-\int_0^{2-\sqrt{3}}\frac{\ln a}{1+a^2}\,da\\ \end{align} Perform the change of variable $\displaystyle a=\tan u$, \begin{align}F\left(\frac{1}{\sqrt{3}}\right)&=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)-\frac{\pi}{6}\ln\left(2-\sqrt{3}\right)-\text{G}-\int_0^{\frac{\pi}{12}}\ln(\tan u)\,du\end{align} The last integral value is $-\dfrac{2}{3}\text{G}$

(see https://math.stackexchange.com/a/987972/186817 )

Therefore, \begin{align}F\left(\frac{1}{\sqrt{3}}\right)&=\frac{\pi}{4}\ln\left(\frac{2}{3}\right)-\frac{\pi}{6}\ln\left(2-\sqrt{3}\right)-\dfrac{1}{3}\text{G}\end{align}

it is well known that, \begin{align}\int_0^1 \frac{\ln(1+x)}{1+x^2}\,dx=\frac{1}{8}\pi\ln 2\end{align} Therefore, \begin{align}I&=\frac{\pi}{2}\ln 3+\frac{\pi}{2}\ln\left(\frac{2}{3}\right)-\frac{\pi}{3}\ln\left(2-\sqrt{3}\right)-\dfrac{2}{3}\text{G}-\frac{\pi}{2}\ln 2+2\text{G}\\ &=\dfrac{4}{3}\text{G}-\frac{\pi}{3}\ln\left(2-\sqrt{3}\right)\\ &=\boxed{\dfrac{4}{3}\text{G}+\frac{\pi}{3}\ln\left(2+\sqrt{3}\right)} \end{align} NB:

Perform the change of variable $y=\dfrac{1-x}{1+x}$, \begin{align}K&=\int_0^1\frac{\ln(1+x)}{1+x^2}\,dx\\ &=\int_0^1\frac{\ln\left(\frac{2}{1+x}\right)}{1+x^2}\,dx\\ &=\int_0^1\frac{\ln 2}{1+x^2}\,dx-K\\ &=\frac{1}{4}\pi\ln 2-K \end{align} Therefore, \begin{align}K&=\frac{1}{8}\pi\ln 2\end{align}