First, simplify the quotient:
\(\displaystyle\int\frac{x^3-x+3}{x^2+x-2}\,\mathrm dx=\int\left(x-1+\frac{2x+1}{x^2+x-2}\right)\,\mathrm dx\)
The first two terms are trivial to deal with, while the last term can be taken care of with a substitution of \(y=x^2+x-2\). This gives \(\mathrm dy=(2x+1)\,\mathrm dx\), and you have
\(\displaystyle\int (x-1)\,\mathrm dx+\int\frac{\mathrm du}u\)
\(\dfrac12x^2-x+\ln|u|+C\)
\(\dfrac12x^2-x+\ln|x^2+x-2|+C\)