Use the method of partial fractions to determine the integral.
\[ \int \frac {5x^{4}-5x^{3}+14x^{2}-9x+23}{(x^{2}+x+2)(x-1)} \d x \]

Note that the degree of the numerator is larger than the degree of the denominator so we must first do polynomial long division before we can do the partial fractions decomposition.

We expand the denominator to get \((x^{2}+x+2)(x-1)=x^{3}+x-2\).

Dividing \(5x^{4}-5x^{3}+14x^{2}-9x+23\) by \(x^{3}+x-2\) we obtain

\[ \answer { 5x-5} + \frac {\answer {9x^{2}+6x+13}}{\answer {x^{3}+x-2}} \]

That means we can write our original integral as

\[ \int \frac {5x^{4}-5x^{3}+14x^{2}-9x+23}{(x^{2}+x+2)(x-1)} \d x= \int 5x-5 \d x + \int \frac {9x^{2}+6x+13}{x^3+x-2} \d x \]

The first integral is easy to compute so we now focus on the second integral

\[ \int \frac {9x^{2}+6x+13}{x^{3}+x-2} \d x \]

The degree of the top is less than the degree of the denominator so we can use partial fractions to decompose the fraction.

In this case we look at the denominator. It was originally given as \((x^{2}+x+2)(x-1)\).

Can we factor the quadratic term \(x^{2}+x+2\) further?

The quadratic is irreducible The quadratic factors

The denominator can be factored into the product of one irreducible quadratic factor and one simple linear factor.

That means, for some constants \(A\), \(B\) and \(C\) we have:

\[ \frac {9x^{2}+6x+13}{(x^{2}+x+2)(x-1)}= \frac {A}{x-1} + \frac {Bx+C}{x^{2}+x+2} \]

We need to determine the constants \(A\),\(B\), \(C\).

We clear denominators by multiplying both sides of the above equation by \(\answer {(x^{2}+x+2)(x-1)}\).

This gives us

\[ 9x^{2}+6x+13=A\answer {(x^{2}+x+2)} + (Bx+C)\answer {(x-1)} \]

Let us determine the unknown coefficients by expanding the right hand side and then identify coefficients of like terms on the left and right.

Comparing the coefficients of powers of \(x\) on both the left and right we obtain the following system of linear equations

Comparing the \(x^{2}\) terms we get \(\answer {A+B}=9\)
Comparing the \(x\) terms we get \(\answer {A-B+C}=6\)
Comparing the constant terms we get \(\answer {2A-C}=13\)

Solving this system of linear equations gives us
\begin{align} A&=\answer { 7 }\\ B&=\answer {2 }\\ C&=\answer { 1 } \end{align}
This means we can rewrite the second integral as
\[ \int \frac {9x^{2}+6x+13}{(x^{2}+x+2)(x-1)} \d x= \int \frac {7}{x-1} \d x + \int \frac {2x+1}{x^{2}+x+2} \d x \]

That means our original integral can now be written as

\[ \int \frac {5x^{4}-5x^{3}+14x^{2}-9x+23}{(x^{2}+x+2)(x-1)} \d x= \int 5x-5 \d x + \int \frac {7}{x-1} \d x + \int \frac {2x+1}{x^{2}+x+2} \d x \]

We compute the first integral

\[ \int 5x-5 \d x =\answer { \frac {5x^{2}}{2} - 5x +C } \]

Then we compute the second integral

\[ \int \frac {7}{x-1} \d x= \answer { 7\ln |x-1|+C } \]

Finally the third integral becomes

\[ \int \frac {2x+1}{x^{2}+x+2} \d x=\answer { \ln | x^{2}+x+2 | + C} \]
(Use \(C\) for the constants of integration for all three integrals)
Although we can try to use trig substitution on the third integral, you should always remember to try more basic methods if possible. What about \(u\)-substitution?
Putting it all together, we find:
\[ \int \frac {5x^{4}-5x^{3}+14x^{2}-9x+23}{(x^{2}+x+2)(x-1)} \d x= \answer { \frac {5x^{2}}{2} - 5x+7\ln |x-1|+ \ln | x^{2}+x+2 | + C} \]