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

Complete answer now!$$I=\int_0^\infty \frac{{\arctan(x^2)}}{x^4+x^2+1}dx {\overset{x=\frac1{t}}=} \int_0^\infty \frac{\arctan\left(\frac{1}{t^2}\right)}{\frac{1}{t^4}+\frac{1}{t^2}+1}\frac{dt}{t^2}\overset{t=x}=\int_0^\infty \frac{{x^2\left(\frac{\pi}{2}-\arctan(x^2)\right)}}{x^4+x^2+1}dx $$ Now if we add the result with the original integral $I$ we get: $$2I=\frac{\pi}{2}\int_0^\infty \frac{x^2}{x^4+x^2+1}dx+\int_0^\infty \frac{(1-x^2)\arctan(x^2)}{x^4+x^2+1}dx$$ $$\Rightarrow I = \frac12 \cdot \frac{\pi}{2}\cdot \frac{\pi}{2\sqrt 3}-\frac12 \int_0^\infty \frac{(x^2-1)\arctan(x^2)}{x^4+x^2+1}dx=\frac{\pi^2}{8\sqrt 3} -\frac12 J$$


Now in order to calculate $J\,$ we start by performing IBP: $$J=\int_0^\infty \frac{(x^2-1)\arctan\left(x^2\right)}{x^4+x^2+1}dx =\int_0^\infty \arctan(x^2) \left(\frac12 \ln\left(\frac{x^2-x+1}{x^2+x+1}\right)\right)'dx=$$ $$=\underbrace{\frac{1}{2}\ln\left(\frac{x^2-x+1}{x^2+x+1}\right)\arctan(x^2)\bigg|_0^\infty}_{=0}+\int_0^\infty \frac{x}{1+x^4}\ln\left(\frac{x^2+x+1}{x^2-x+1}\right)dx$$ Substituting $x=\tan\left(t\right)$ and doing some simplifications yields: $$J=\int_0^\frac{\pi}{2} \frac{2\sin (2t)}{3+\cos(4t)}\ln\left(\frac{2+\sin (2t)}{2-\sin (2t)}\right)dt\overset{2t=x}=\int_0^\pi \frac{\sin x}{3+\cos(2x)}\ln\left(\frac{2+\sin x}{2-\sin x}\right)dx=$$ $$=2\int_0^\frac{\pi}{2}\frac{\sin x}{3+\cos(2x)}\ln\left(\frac{2+\sin x}{2-\sin x}\right)dx=\int_0^\frac{\pi}{2}\frac{\cos x}{1+\sin^2 x}\ln\left(\frac{2+\cos x}{2-\cos x}\right)dx =$$ $$=\frac12\int_0^\pi \frac{\cos x}{1+\sin^2 x}\ln\left(\frac{2+\cos x}{2-\cos x}\right)dx\overset{\large{\tan\left(\frac{x}{2}\right)=t}}=\int_0^\infty \frac{1-t^2}{t^4+6t^2+1}\ln\left(\frac{\color{blue}{t^2+3}}{\color{red}{3t^2+1}}\right)dt$$

Splitting the integral into two parts followed by the substitution $\,\displaystyle{t=\frac{1}{x}}\,$ in the second part gives: $$\int_0^\infty \frac{1-t^2}{t^4+6t^2+1}\ln(\color{red}{3t^2+1})dt =\int_0^\infty \frac{x^2-1}{x^4+6x^2+1}\ln\left(\color{red}{\frac{x^2+3}{x^2}}\right)dx$$ $$\Rightarrow J=\int_0^\infty \frac{1-x^2}{x^4+6x^2+1} \ln(\color{blue}{x^2+3})dx - \int_0^\infty \frac{1-x^2}{x^4+6x^2+1} {\left(\ln(\color{red}{x^2})-\ln(\color{red}{x^2+3})\right)}dx=$$ $$=2\int_0^\infty \frac{1-x^2}{x^4+6x^2+1}\ln\left(\color{purple}{\frac{x^2+3}{x}}\right)dx=2\int_0^\infty \left(\frac12\arctan\left(\frac{2x}{1+x^2}\right)\right)'\ln\left(\frac{x^2+3}{x}\right)dx=$$ $$=\underbrace{\arctan\left(\frac{2x}{1+x^2}\right)\ln\left(\frac{x^2+3}{x}\right)\bigg|_0^\infty}_{=0}-\int_0^\infty \arctan\left(\frac{2x}{1+x^2}\right)\left(\frac{2x}{x^2+3}-\frac{1}{x}\right)dx$$ $$\Rightarrow J=\int_0^\infty \arctan\left(\frac{2x}{1+x^2}\right)\frac{dx}{x}-\int_0^\infty \arctan\left(\frac{2x}{1+x^2}\right) \frac{2x}{x^2+3}dx=J_1-J_2$$


$$J_1=\int_0^\infty \arctan\left(\frac{2x}{1+x^2}\right)\frac{dx}{x}\overset{\large{x=\tan\left(\frac{t}{2}\right)}}=\int_0^\pi \frac{\arctan( \sin t)}{\sin t} dt\overset{t=x}=2\int_0^\frac{\pi}{2} \frac{\arctan( \sin x)}{\sin x} dx$$ In general, we have the following relation: $$\frac{\arctan x}{x}=\int_0^1 \frac{dy}{1+(xy)^2} \Rightarrow \color{red}{\frac{\arctan(\sin x)}{\sin x}=\int_0^1 \frac{dy}{1+(\sin^2 x )y^2}}$$ $$J_1 = 2\color{blue}{\int_{0}^{\frac{\pi}{2}}} \color{red}{\frac{\arctan\left(\sin x\right)}{\sin x}}\color{blue}{dx}=2\color{blue}{\int_0^\frac{\pi}{2}}\color{red}{\int_0^1 \frac{dy}{1+(\sin^2 x )y^2}}\color{blue}{dx}=2\color{red}{\int_0^1} \color{blue}{\int_0^\frac{\pi}{2}}\color{purple}{\frac{1}{1+(\sin^2 x )y^2}}\color{blue}{dx}\color{red}{dy}$$ $$=2\int_0^1 \frac{\arctan\left(\sqrt{1+y^2}\cdot\tan(x)\right) }{\sqrt{1+y^2}} \bigg|_0^\frac{\pi}{2}=\pi\int_0^1 \frac{dy}{\sqrt{1+y^2}}=\boxed{\pi\ln\left(1+\sqrt 2\right)}$$


In order to evaluate $J_2$ we return the integral before was integrated by parts. $$J_2=2\int_0^\infty \arctan\left(\frac{2 x} {x^2 +1}\right)\frac{x}{x^2 +3}dx=2\int_0^{\infty}\frac{(x^2-1)\ln(x^2+3)}{x^4+6x^2+1} dx=$$ $$=(\sqrt 2+1)\int_0^{\infty} \frac{\ln(x^2+3)}{x^2+\left(\sqrt 2+1\right)^2} \ dx - (\sqrt 2-1)\int_0^{\infty} \frac{\ln(x^2+3)}{x^2+\left(\sqrt 2-1\right)^2} dx$$ Using the following identity that is valid for $a\ge 0, b>0$:$$\int_0^{\infty} \frac{\ln(x^2+a^2)}{x^2+b^2} \ dx = \frac{\pi}{b}\ln(a+b)$$ $$\Rightarrow J_2=\pi\ln\left(\frac{\sqrt{3}+\sqrt{2}+1}{\sqrt{3}+\sqrt{2}-1}\right)=\boxed{\frac{\pi} {2}\ln(2+\sqrt 3)}$$ So we found that:$$J=\boxed{\pi \ln(1+\sqrt 2) - \frac{\pi} {2} \ln(2+\sqrt 3)}\Rightarrow I= \large\boxed{\frac{\pi^2} {8 \sqrt 3}+\frac{\pi}{4}\ln(2+\sqrt 3)-\frac{\pi}{2} \ln(1+\sqrt 2)}$$