TITLE: Integrate: $\int x(\arctan x)^{2}dx$
QUESTION [5 upvotes]: I'm not sure how to start I think we have to use integration by parts
$$\int x(\arctan x)^{2}dx$$

REPLY [7 votes]: With $\tan(u)=x$,
$$
\begin{align}
\int x\arctan(x)^2\mathrm{d}x
&=\int\tan(u)\,u^2sec^2(u)\,\mathrm{d}u\\
&=\frac12\int u^2\,\mathrm{d}\sec^2(u)\\
&=\frac12u^2\sec^2(u)-\int u\sec^2(u)\,\mathrm{d}u\\
&=\frac12u^2\sec^2(u)-\int u\,\mathrm{d}\tan(u)\\
&=\frac12u^2\sec^2(u)-u\tan(u)+\int\tan(u)\,\mathrm{d}u\\
&=\frac12u^2\sec^2(u)-u\tan(u)-\log|\cos(u)|+C\\
&=\frac12(1+x^2)\arctan(x)^2-x\arctan(x)+\frac12\log(1+x^2)+C
\end{align}
$$