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