Long division in integration by partial fractions I am trying to figure out what my book did, I can't make sense of the example.
"Since the degree of the numberator is greater than the degree of the denominator, we first perform the long division. This enables us to write
$$\int \frac{x^3 + x}{x -1} dx = \int \left(x^2 + x + 2 + \frac{2}{x-1}\right)dx = \frac{x^3}{3} + \frac{x^2}{2} + 2x + 2\ln|x-1| + C$$
I am mostly concerned with the transformation of the problem by long division I think.
I attempt to do this on my own.
$(x+1)$ and $(x^3 + x)$ inside the long division bracket
I am left with $x^2 - 1$ on top and a leftover -1
This is not in their answer, I do not know how they did that.

You did not do the long division correctly.
                    x^2 + x + 2
                _________________________
        x - 1  |    x^3       + x
                  - x^3 + x^2
                  -----------
                        + x^2 + x
                        - x^2 + x
                          --------
                               2x 
                              -2x + 2
                              -------
                                  + 2

So the quotient is $x^2 + x + 2$, and the remainder is $2$. 
You can verify this by doing the product and adding the remainder: 
$$(x-1)(x^2+x+2) = x^3 + x^2 + 2x - x^2 - x -2 = x^3 + x - 2$$
so
$$(x-1)(x^2+x+2) + 2 = x^3 + x  -2  + 2 = x^3 + x.$$
Whereas you claim a quotient of $x^2-1$ and a remainder of $-1$, which would give
$$(x-1)(x^2-1) -1 = x^3 -x - x^2 + 1 -1 = x^3 - x^2 - x \neq x^3 + x.$$
(Even if you tried with $x+1$ instead fo $x-1$, your answer is still incorrect, since
$$(x+1)(x^2-1)-1 = x^3 - x + x^2 -1 -1 = x^3 + x^2 - x -2 \neq x^3+x.$$
If you divide by $x+1$ correctly, you'll get a quotient of $x^2-x+2$ and a remainder of $-2$,
$$(x+1)(x^2-x+2)-2 = x^3 -x^2 +2x +x^2 -x + 2 -2 = x^3 +x$$
which is the correct total.)
