Evaluate the following integral:
$\int \frac{x^{4}}{(x-1)\left(x^{2}+1\right)} d x$
$\frac{x^{4}}{(x-1)\left(x^{2}+1\right)}=\frac{x^{4}}{x^{3}-x^{2}+x-1}$
$=\frac{x\left(x^{3}-x^{2}+x-1\right)+1\left(x^{3}-x^{2}+x-1\right)+1}{x^{3}-x^{2}+x-1}$
$=x+1+\frac{1}{(x-1)\left(x^{2}+1\right)}$
Now, let $\frac{1}{(x-1)\left(x^{2}+1\right)}=\frac{A}{x-1}+\frac{B x+C}{x^{2}+1}$
$\Rightarrow 1=A\left(x^{2}+1\right)+(B x+C)(x-1)$
For, $\mathrm{x}=1, \mathrm{~A}=\frac{1}{2}$
For, $\mathrm{x}=0, \mathrm{C}=\mathrm{A}-1=-\frac{1}{2}$
For, $x=-1, B=-\frac{1}{2}$
$\therefore \int \frac{x^{4}}{(x-1)\left(x^{2}+1\right)} d x=\int x d x+\int d x+\frac{1}{2} \int \frac{1}{x-1} d x-\frac{1}{2} \int \frac{x+1}{x^{2}+1} d x$
$=\frac{x^{2}}{2}+x+\frac{1}{2} \log |x-1|-\frac{1}{4} \log \left(x^{2}+1\right)-\frac{1}{2} \tan ^{-1} x+c$