Answer
$$\frac{1}{2} \ln |x+1|+\frac{1}{4} \ln \left|x^{2}+1\right|-\frac{1}{2} \tan ^{-1} x+C$$
Work Step by Step
Given $$\int \frac{x^{2}}{(x+1)\left(x^{2}+1\right)} d x$$
Since
\begin{align*}
\frac{x^2}{(x+1)\left(x^{2}+1\right)}&=\frac{A}{x+1}+\frac{Bx+C}{x^{2}+1}\\
&=\frac{A(x^{2}+1)+B(x-1)}{(x+1)\left(x^{2}+1\right)}\\
x^2&=A(x^{2}+1)+B(x+1)
\end{align*}
\begin{align*}
\text{at } x&=-1 \ \ \ \ \to A=\frac{1}{2} \\
\text{at } x&= 0\ \ \ \ \to C=\frac{-1}{2}\\
\text{at } x&= 1\ \ \ \ \to B =\frac{1}{2}
\end{align*}
Hence
\begin{aligned}
\int \frac{x^{2}}{(x+1)\left(x^{2}+1\right)} d x &=\int \frac{\frac{1}{2}}{x+1} d x+\int \frac{\frac{1}{2} x-\frac{1}{2}}{x^{2}+1} d x \\
&=\int \frac{\frac{1}{2}}{x+1} d x+\frac{1}{2} \int \frac{x}{x^{2}+1} d x-\frac{1}{2} \int \frac{1}{x^{2}+1} d x \\
&=\frac{1}{2} \ln |x+1|+\frac{1}{4} \ln \left|x^{2}+1\right|-\frac{1}{2} \tan ^{-1} x+C
\end{aligned}