<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] First Approach - Using Euler sums
We begin by finding the Maclaurin series expansion for $\arctan^2 x$. 
Since
$$\arctan x = \sum_{n = 0}^\infty \frac{(-1)^n x^{2n + 1}}{2n + 1}, \qquad |x| < 1,$$
applying the Cauchy product to the product between two inverse tangent functions leads to:
\begin{align}
\arctan^2 x &= \arctan x \cdot \arctan x\\
&= \left (\sum_{n = 0}^\infty \frac{(-1)^n x^{2n + 1}}{2n + 1} \right ) \cdot \left (\sum_{n = 0}^\infty \frac{(-1)^n x^{2n + 1}}{2n + 1} \right )\\
&= \sum_{n = 1} \frac{(-1)^{n + 1}}{n} \left (H_{2n} - \frac{1}{2} H_n \right ) x^{2n}, \qquad |x| \leqslant 1.
\end{align}
Here $H_n$ is the $n$th harmonic number.
Making use of this result, the integral becomes
\begin{align}
I &= \int_0^1 \arctan^2 x \, dx\\
&= \sum_{n = 1}^\infty \frac{(-1)^{n + 1}}{n} \left (H_{2n} - \frac{1}{2} H_n \right ) \int_0^1 x^{2n} \, dx\\
&= \sum_{n = 1}^\infty \frac{(-1)^{n + 1}}{n (2n + 1)} \left (H_{2n} - \frac{1}{2} H_n \right )\\
&= \sum_{n = 1}^\infty (-1)^{n + 1} \left (\frac{1}{n} - \frac{2}{2n + 1} \right ) \left (H_{2n} - \frac{1}{2} H_n \right )\\
&= \frac{1}{2} \sum_{n = 1}^\infty \frac{(-1)^n H_n}{n} - \sum_{n = 1}^\infty \frac{(-1)^n H_n}{2n + 1} - \sum_{n = 1}^\infty \frac{(-1)^n H_{2n}}{n} + 2 \sum_{n = 1}^\infty \frac{(-1)^n H_{2n}}{2n+1}.\tag1
\end{align}
Values for each of the above four alternating Euler sums can be found here. Theirs values are:

$$\sum_{n = 1}^\infty \frac{(-1)^n H_n}{n} = \frac{1}{2} \ln^2 2 - \frac{\pi^2}{12}, \qquad \sum_{n = 1}^\infty \frac{(-1)^n H_n}{2n + 1} = \mathbf{G} - \frac{\pi}{2} \ln 2,$$
$$\sum_{n = 1}^\infty \frac{(-1)^n H_{2n}}{n} = \frac{1}{4} \ln^2 2 - \frac{5\pi^2}{48}, \qquad \sum_{n = 1}^\infty \frac{(-1)^n H_{2n}}{2n + 1} = -\frac{\pi}{8} \ln 2.$$

On substituting into (1) one obtains
$$\int_0^1 \arctan^2 x \, dx = \frac{\pi^2}{16} + \frac{\pi}{4} \ln 2 - \mathbf{G},$$
as desired.
Second Approach - Integral of a function and its inverse
Let $f(x) = \arctan^2 x$. As $f$ is a monotonically increasing function on the interval $[0,1]$ an inverse given by $f^{-1} (x) = \tan (\sqrt{x})$ exists on the interval $[0,\frac{\pi^2}{4})$. Making use of the result:
$$\int_a^b f(x) \, dx + \int_{f(a)}^{f(b)} f^{-1} (x) \, dx = b \cdot f(b) - a \cdot f(a),$$
noting that for our $f$ we have $f(a) = f(0) = 0$ and $f(b) = f(1) = \frac{\pi^2}{16}$, one sees that
$$\int_0^1 \arctan^2 x \, dx + \int_0^{\frac{\pi^2}{16}} \tan (\sqrt{x}) \, dx = \frac{\pi^2}{16}.$$
Thus
\begin{align}
\int_0^1 \arctan^2 x \, dx &= \frac{\pi^2}{16} - \underbrace{\int_0^{\frac{\pi^2}{16}} \tan (\sqrt{x}) \, dx}_{x \, \mapsto \, x^2}\\
&= \frac{\pi^2}{16} - 2 \int_0^{\frac{\pi}{4}} x \tan x \, dx\\
&= \frac{\pi^2}{16} - 2 \left (-x \ln (\cos x) \Big{|}_0^{\frac{\pi}{4}} + \int_0^{\frac{\pi}{4}} \ln (\cos x) \, dx \right ) \qquad (\text{by parts})\\
&= \frac{\pi^2}{16} - \frac{\pi}{4} \ln 2 - 2 \int_0^{\frac{\pi}{4}} \ln (\cos x) \, dx\\
&= \frac{\pi^2}{16} - \frac{\pi}{4} \ln 2 - 2 \left (\frac{\mathbf{G}}{2} - \frac{\pi}{4} \ln 2 \right )\tag1\\
&= \frac{\pi^2}{16} + \frac{\pi}{4} \ln 2 - \mathbf{G},
\end{align}
as expected. Note that in ($1$) we have made use of the result
$$\int_0^{\frac{\pi}{4}} \ln (\cos x) \, dx = \frac{\mathbf{G}}{2} - \frac{\pi}{4} \ln 2,$$
several proofs for which can be found here.
</s>