Evaluate $\int_0^1x(\tan^{-1}x)^2~\textrm{d}x$

Let's try integration by parts: \begin{align} \int x(\arctan x)^2\,dx &= \frac{x^2}{2}(\arctan x)^2- \int\frac{x^2}{2}2\arctan x\frac{1}{1+x^2}\,dx \\ &= \frac{x^2}{2}(\arctan x)^2- \int\frac{1+x^2-1}{1+x^2}\arctan x\,dx \\ &= \frac{x^2}{2}(\arctan x)^2- \int\arctan x\,dx+ \int\frac{1}{1+x^2}\arctan x\,dx \end{align} Now note that $$ \int\arctan x\,dx=x\arctan x-\int\frac{x}{1+x^2}\,dx $$ and that $$ \int\frac{1}{1+x^2}\arctan x\,dx= \frac{1}{2}(\arctan x)^2 $$


Let $I$ be our integral and using integration by parts on $u=\arctan^2x$, we see that $I$ is equal as

$$\begin{align*}I & =\frac 12x^2\arctan^2x\,\Biggr\rvert_0^1-\int\limits_0^1dx\,\frac {x^2\arctan x}{1+x^2}\\ & =\frac {\pi^2}{32}-\int\limits_0^1dx\,\frac {x^2\arctan x}{1+x^2}\end{align*}$$

The second integral, again, can be solved using integration by parts with $u=\arctan x$. Note that for $dv$, by adding and subtracting one, we get$$v=x-\arctan x$$Hence$$\begin{align*}I & =\frac {\pi^2}{32}-\arctan x(x-\arctan x)\,\Biggr\rvert_0^1+\int\limits_0^1dx\,\frac x{1+x^2}-\int\limits_0^1dx\,\frac {\arctan x}{1+x^2}\\ & =\frac {\pi^2}{32}-\frac {\pi}4+\frac {\pi^2}{16}+\frac 12\log(1+x^2)\,\Biggr\rvert_0^1-\frac 12\arctan^2x\,\Biggr\rvert_0^1\end{align*}$$

Now it's just a matter of evaluating each result from its limits and using that $\arctan 1=\pi/4$ to get

$$\int\limits_0^1dx\, x\arctan^2x\color{blue}{=\frac {\pi^2}{16}-\frac {\pi}4+\frac 12\log2}$$