The denominator factors as: x(x^2-x+2)x(x2−x+2) and cannot be factored further using real numbers (discriminant is negative). The integrand cannot be reduced, so we proceed:
Find, A, B, and CA,B,andC to make:
A/x +(Bx+C)/(x^2-x+2) = (x^2-5x+6)/(x(x^2-x+2))Ax+Bx+Cx2−x+2=x2−5x+6x(x2−x+2)
We need:
Ax^2-Ax+2A+Bx^2+Cx = x^2-5x+6Ax2−Ax+2A+Bx2+Cx=x2−5x+6
Solve the system:
A+B=1A+B=1
-A+C=-5−A+C=−5
2A=62A=6
Obviously, A=3A=3 and this makes B=-2B=−2 and C=-2C=−2
The partial fraction decomposition is:
3/x -(2x+2)/(x^2-x+2) = (x^2-5x+6)/(x(x^2-x+2))3x−2x+2x2−x+2=x2−5x+6x(x2−x+2).
If you have time check by combining the fractions on the left to make sure you've made no mistakes.
Now integrate:
int (x^2-5x+6)/(x^3-x^2+2x)) dx = int (3/x)dx - int (2x+2)/(x^2-x+2) dx∫x2−5x+6x3−x2+2x)dx=∫(3x)dx−∫2x+2x2−x+2dx
The first integral is easy. I'd split the second using:
(2x+2)/(x^2-x+2) = ((2x-1) +3)/(x^2-x+2) 2x+2x2−x+2=(2x−1)+3x2−x+2 because
int (2x-1)/(x^2-x+2) dx∫2x−1x2−x+2dx is a simple substitution and then
int 3/(x^2-x+2) dx∫3x2−x+2dx is an inverse tangent with some constants to figure out by completing the square and substituting.