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 want to express $x^3+x$ as $(x-1)(\text{something})+r$. 
I want to show you a way of solving this problem with a homemade technique. We see that the "something" must be a polynomial of degree $2$, or either we'll be getting $x^4$ which we don't want. 
$$x^3+x=(x-1)(ax^2+bx+c)+r$$
If we multiply out we get
$$x^3+x=ax^3+bx^2+cx-ax^2-bx-c+r$$
Now, we equate the coefficients in each side:
$$1x^3=ax^3$$
$$0x^2=bx^2-ax^2$$
$$1x=cx-bx$$
$$0=r-c$$
What the above means is that two polynomials are equal iff their coefficients are equal.
From the above we get $a=1$, so
$$0x^2=bx^2-x^2$$
$$1x=cx-bx$$
$$0=r-c$$
Thus $b=1$. 
$$1x=cx-1x$$
Then $c=2$, and finally 
$$0=r-3$$
So$r=2$. So we get what we wanted
$$x^3+x=(x-1)(x^2+x+2)+2$$
Dividing by $x-1$ gives what your book has
$$\frac{x^3+x}{x-1}=x^2+x+2+\frac{2}{x-1}$$
