What is up with the antiderivative of $\arctan^2(x)$?
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
You can see an integration of $\ds{\arctan^{2}\pars{x}}$ over $\ds{\pars{0,1}}$ in this link which I guess it's simpler than the present one.
\begin{align} \int\arctan^{2}\pars{x}\,\dd x & = x\arctan^{2}\pars{x} - \int x\bracks{2\arctan\pars{x}\,{1 \over x^{2} + 1}} \dd x \\[5mm] & = x\arctan^{2}\pars{x} - \ln\pars{x^{2} + 1}\arctan\pars{x} + \int{\ln\pars{x^{2} + 1} \over x^{2} + 1}\,\dd x \end{align}
\begin{align} \int{\ln\pars{x^{2} + 1} \over x^{2} + 1}\,\dd x & = 2\,\Re\int\ln\pars{x + \ic}\pars{{1 \over x - \ic} - {1 \over x + \ic}}{1 \over 2\ic}\,\dd x \\[5mm] & = \Im\ \underbrace{\int{\ln\pars{x + \ic} \over x - \ic}\,\dd x} _{\ds{\mbox{Set}\,\,\, t = x + \ic}}\ -\ \Im\ \underbrace{\int{\ln\pars{x + \ic} \over x + \ic}\,\dd x} _{\ds{=\ {1 \over 2}\,\ln^{2}\pars{x + \ic}}} \\ & = -\,\Im\int{\ln\pars{t} \over 2\ic - t}\,\dd t - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = -\,\Im\ \underbrace{\int{\ln\pars{2\ic\braces{t/\bracks{2\ic}}} \over 1 - t/\pars{2\ic}}\,{\dd t \over 2\ic}} _{\ds{\mbox{Set}\,\,\, z = {t \over 2\ic}}}\ -\ {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = -\,\Im\int{\ln\pars{2\ic z} \over 1 - z}\,\dd z - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = \Im\braces{\ln\pars{1 - z}\ln\pars{2\ic z} - \int{\ln\pars{1 - z} \over z}} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = \Im\bracks{\ln\pars{1 - z}\ln\pars{2\ic z} + \,\mrm{Li}_{2}\pars{z}} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = \Im\bracks{\ln\pars{1 - {t \over 2\ic}}\ln\pars{t} + \,\mrm{Li}_{2}\pars{t \over 2\ic}} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = \Im\bracks{\ln\pars{{\ic \over 2}\bracks{x - \ic}}\ln\pars{x + \ic} + \,\mrm{Li}_{2}\pars{1 - x\ic \over 2}} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = \Im\bracks{\bracks{{\pi \over 2}\,\ic - \ln\pars{2}}\ln\pars{x + \ic} + \,\mrm{Li}_{2}\pars{1 - x\ic \over 2}} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = {\pi \over 2}\,\Re\ln\pars{x + \ic} - \ln\pars{2}\Im\ln\pars{x + \ic} + \Im\mrm{Li}_{2}\pars{1 - x\ic \over 2} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \\[5mm] & = {\pi \over 4}\ln\pars{x^{2} + 1} + \ln\pars{2}\arctan\pars{x} + \Im\mrm{Li}_{2}\pars{1 - x\ic \over 2} - {1 \over 2}\,\Im\ln^{2}\pars{x + \ic} \end{align}