<s>[INST] Integral $\int_0^1 \left(\arctan x \right)^2\,dx$ Evaluate 
$$\int_0^1 \left(\arctan x \right)^2\,dx$$
The answer should be
$${\pi^2\over16} + \frac{\pi\ln(2)}{4} -C$$  
where $C$ is Catalan's constant. 
How do I proceed?
I tried doing integration by parts twice and got stuck at $$\int_0^1{\frac{\log\left(\frac1{x}+x\right)}{1+x^2}}\,dx$$
 [/INST] To get rid of the inverse, we let $y=\arctan x$ and transform the integral into
$$
\begin{aligned}
I &=\int_{0}^{\frac{\pi}{4}} y^{2} \sec ^{2} y d y \\
&=\int_{0}^{\frac{\pi}{4}} y^{2} d(\tan y) \\
& \stackrel{IBP}{=} \left[y^{2} \tan y\right]_{0}^{\frac{\pi}{4}}-2 \int_{0}^{\frac{\pi}{4}} y \tan y d y \\
&=\frac{\pi^{2}}{16}+2 \int_{0}^{\frac{\pi}{4}} y d(\ln (\cos y)) \\
&  \stackrel{IBP}{=}\frac{\pi^{2}}{16}+2[y \ln (\cos y)]_{0}^{\frac{\pi}{4}}-2 \int_{0}^{\frac{\pi}{4}} \ln (\cos y) d y \\
&=\frac{\pi^{2}}{16}+2\left[\frac{\pi}{4} \ln \left(\frac{1}{\sqrt{2}}\right)\right]-2\left(\frac{G}{2}-\frac{\pi}{4} \ln 2\right) \\
&=\frac{\pi^{2}}{16}+\frac{\pi}{4} \ln 2-G
\end{aligned}
$$
where the last integral comes from my post.
</s>