Answer
\begin{aligned}
\int \ln(x^2+1)dx&=x\ln(x^2+1)-2 x-2\tan^{-1}x+c
\end{aligned}
Work Step by Step
Given
$$ \int \ln(x^2+1)dx $$
Use integration by parts , let
\begin{aligned}
u&= \ln(x^2+1)\ \ \ \ \ \ \ &dv&= dx\\
du&= \frac{2xdx}{x^2+1}\ \ \ \ \ \ \ & v&= x
\end{aligned}
Then
\begin{aligned}
\int \ln(x^2+1)dx&=x\ln(x^2+1)-2\int \frac{x^2dx}{x^2+1}
\end{aligned}
To evaluate $\int \dfrac{x^2dx}{x^2+1}$, let
$$x=\tan \theta \ \ \ \ \ dx=\sec^2 \theta d\theta $$
Then
\begin{aligned}
\int\dfrac{x^2dx}{x^2+1}&=\int \dfrac{\tan^2\theta \sec^2\theta d\theta }{\tan^2\theta +1}\\
&=\int \tan^2\theta d\theta \\
&=\int( \sec^2 \theta-1) d\theta \\
&=\tan \theta - \theta +c\\
&= x+\tan^{-1}x+c
\end{aligned}
Hence
\begin{aligned}
\int \ln(x^2+1)dx&=x\ln(x^2+1)-2 x-2\tan^{-1}x+c
\end{aligned}