I have this simple integral: $\int \frac{-x^2+2x-3}{x^3-x^2+x-1}dx$ and I can't come up with the correct answer.
Here's what I did:
I found the roots for $x^3-x^2+x-1$ so I could do partial fractions:
$\frac{-x^2+2x-3}{x^3-x^2+x-1}=\frac{A}{x-1}+\frac{Bx+C}{x^2+1}=\frac{A(x^2+1)+(Bx+C)(x-1)}{(x-1)(x^2+1)}$
I then found the values for $A$, $B$ and $C$:
$x^2(A+B)+x(-B+C)+A-C=-x^2+2x-3$
$ \left\{ \begin{array}{c} A+B=-1 \\ -B+C=2 \\ A-C=-3 \end{array} \right. $
$A=-1$, $B=0$, $C=2$
So now back again with the integral:
$\int \frac{-1}{x-1}dx+\int \frac{2}{x^2+1}dx=-\int \frac{1}{x-1}dx + 2 \int \frac{1}{x^2+1}dx=-\ln|x-1|+2|x^2+1|=2\ln|\frac{x^2+1}{x-1}|+C$
But why the correct answer is $2 \arctan(x)-\ln|x-1|+C$? Where does the $arctan$ come from?
Your computation is almost correct, but you made a mistake here.
Note that$\int\dfrac{2}{x^2+1}=2\arctan(x)$, but not $\int\dfrac{2}{x^2+1}\ne2|x^2+1|$