We need to evaluate $$\int \ln(1+x^2)\arctan x \, \mathrm{d}x$$
My thoughts were to set $u = \arctan x \implies x = \tan u$ so that our integral is transformed to $$\int 2u \sec^2 u \ln \sec u \, \mathrm{d}u$$
Am I on the right path? How do I continue from here? Are there alternative ways of doing this?
Hint The substitution $x = \tan u$ is certainly the most natural first step.
Since our integrand in $u$ is a product of functions, applying integration by parts is a reasonable choice. Taking $$v = u, \qquad dw = \sec^2 u \log \sec u$$ gives $$dv = du, \qquad w = u + \tan u (\log \sec u - 1)$$ (deriving this formula for $w$ requires another application of integration by parts). So, the integration by parts formula gives that our integral is $$\int u \sec^2 u \log \sec u = \left(u + \tan u (\log \sec u - 1)\right) - \int \left(u + \tan u \log \sec u - \tan u\right) du .$$ Separating the integral on the r.h.s. gives three integrals: The integrals $$\int u \,du \qquad \textrm{and} \qquad \int \tan u\,du$$ are standard, and the integral $$\int \tan u \log \sec u$$ can be handled with a substitution. Back-substituting then gives the antiderivative as a function of $x$.