$\int \frac{x^3+2}{(x-1)^2}dx$ In order to integrate 
$$\int \frac{x^3+2}{(x-1)^2}dx$$ 
I did:
$$\frac{x^3+2}{(x-1)^2} = x+2+3\frac{x}{(x-1)^2}\implies$$
$$\int \frac{x^3+2}{(x-1)^2} dx= \int x+2+3\frac{x}{(x-1)^2}dx$$
But I'm having trouble integrating the last part:
$$\int \frac{x}{(x-1)^2}dx$$
Wolfram alpra said me that:
$$\frac{x}{(x-1)^2} = \frac{1}{(x-1)} + \frac{1}{(x-1)^2}$$
How to intuitively think about this partial fraction expansion? I've seen some examples but suddenly these conter intuitive examples opo out and I get confused. I can check that his is true but I couldn't find this expansion by myself
Then:
$$\int \frac{x}{(x-1)^2} dx = \int \frac{1}{(x-1)} + \frac{1}{(x-1)^2}dx = \ln (x-1) + (x-1)^{-1}$$
Then:
$$\int \frac{x^3+2}{(x-1)^2} dx= \int x+2+\frac{x}{(x-1)^2}dx = \frac{x^2}{2} + 2x + 3[\ln(x-1)+(x-1)^{-1}]$$ but wolfram alpha gives another answer. What I did wrong?

You can write $\displaystyle\frac{x}{(x-1)^2}=\frac{A}{x-1}+\frac{B}{(x-1)^2}$; then multiply by $(x-1)^2$ to get $x=A(x-1)+B$.
Letting $x=1$ gives $B=1$, and comparing the coefficients of $x$ gives $A=1$.
(Notice that $\displaystyle\int\frac{1}{(x-1)^2}=-\frac{1}{x-1}+C$.)

You could also find $\displaystyle\int\frac{x}{(x-1)^2}$ by letting $u=x-1, x=u+1, dx=du$ to get 
$\hspace{.4 in}\displaystyle\int\frac{u+1}{u^2}du=\int\left(\frac{1}{u}+\frac{1}{u^2}\right) du$, 
or use integration by parts with $u=x, du=dx, dv=(x-1)^{-2}dx, v=-(x-1)^{-1}$ to get
$\;\;-x(x-1)^{-1}+\ln|x-1|+C$
