Evaluate the integral $\int \frac{x^2(x-2)}{(x-1)^2}dx$ 
Find $$\int \frac{x^2(x-2)}{(x-1)^2} dx .$$

My attempt:
$$\int \frac{x^2(x-2)}{(x-1)^2}dx = \int \frac{x^3-2x^2}{x^2-2x+1}dx $$
By applying polynomial division, it follows that
$$\frac{x^3-2x^2}{x^2-2x+1} = x + \frac{-x}{x^2-2x+1}$$
Hence $$\int \frac{x^3-2x^2}{x^2-2x+1}dx  = \int \left(x + \frac{-x}{x^2-2x+1}\right) dx =\int x \,dx + \int \frac{-x}{x^2-2x+1} dx \\ = \frac{x^2}{2} + C + \int \frac{-x}{x^2-2x+1} dx $$  Now using substitution $u:= x^2-2x+1$ and $du = (2x-2)\,dx $ we get $dx= \frac{du}{2x+2}$.
Substituting dx in the integral:
$$\frac{x^2}{2} + C + \int \frac{-x}{u} \frac{1}{2x-2} du =\frac{x^2}{2} + C + \int \frac{-x}{u(2x-2)}  du $$
I am stuck here. I do not see how using substitution has, or could have helped solve the problem. I am aware that there are other techniques for solving an integral, but I have been only taught substitution and would like to solve the problem accordingly.
Thanks
 A: With a shift, $t=x-1$,
$$\int \frac{(t+1)^2(t-1)}{t^2} dt=\int\left(t+1-\frac1t-\frac1{t^2}\right)dt\\
=\frac{(x-1)^2}2+(x-1)-\ln|x-1|+\frac1{x-1}+C.$$
A: HINT: write your Integrand in the form $$x- \left( x-1 \right) ^{-1}- \left( x-1 \right) ^{-2}$$
A: The most efficient method is probably to substitute $t := x - 1$, as I see Yves has done in his answer, as this rewrites the integrand as a sum of power functions. In you don't see this, proceeding the standard way goes as follows:
After writing the integrand as a 'proper polynomial fraction', rewrite the denominator in factored form:
$$\frac{x^3-2x^2}{x^2-2x+1} = x - \frac{x}{x^2-2x+1} = x - \frac{x}{(x - 1)^2}.$$
We know from the method of partial fractions that we can put the second term in the form
$$\frac{x}{(x - 1)^2} = \frac{A}{x - 1} + \frac{B}{(x - 1)^2} .$$
We can cross-multiply and compare like coefficients to solve for $A$ and $B$, but we can do this more quickly in this case by writing
$$\frac{x}{(x - 1)^2} = \frac{(x - 1) + 1}{(x - 1)^2} = \frac{1}{x - 1} + \frac{1}{(x - 1)^2} .$$
The integrals of the two terms on the right-hand side are elementary.
A: $\int \frac{x^2(x-2)}{(x-1)^2} dx$
$\int {x^2(x-1-1)\over(x-1)^2}dx$
$\int {x^2(x-1)-x^2\over(x-1)^2}dx$
$\int ({x^2\over(x-1)}-{x^2\over(x-1)^2})dx$
$\int {x^2\over(x-1)}dx-\int{x^2\over(x-1)^2}dx$
$t=x-1 => dt=dx$
$\int {(t+1)^2\over(t)}dt-\int{(t+1)^2\over(t)^2}dt$
$\int {(t^2+1+2t)\over(t)}dt-\int(1+{1\over t})^2dt$
$\int (t+{1\over t}+2)dt-\int(1+{1\over t})^2dt$
$\int t dt+\int{1\over t}dt+\int2dt-\int(1+{1\over t})^2dt$
${t^2\over2}+\ln t+2t-t+{1\over t}-2\ln t+C$
${(x-1)^2\over2}+(x-1)+{1\over x-1}-\ln |x-1|+C$
A: I would let $u=x-1$ which makes the integrand $(u+1)^2(u-1)/u^2.$  After you multiply out the top you have a sum of powers of $u$.
A: $$\int\frac{-x}{x^2-2x+1} dx=\int\frac{1-x}{(1-x)^2} dx+\int\frac{-1}{(1-x)^2} dx=-\ln(1-x)+\frac{1}{1-x}$$
A: Your last integral, $\int \frac{-x}{u(2x-2)}  du$, doesn't make me happy.
You have both $x$ and $u$ in the integral. The point of the substitution is to get rid of the $x$'s and leave the integral in terms of $u$.
I'll take it from the last integral in terms of $x$, everything looks fine before and it goes astray after that.
$\int \frac{-x}{x^2-2x+1} dx = \int \frac{-x}{(x-1)^2} dx$. Let $u=x-1$ therefore $du=dx$ and $-x=-1-u$, then $\int \frac{-x}{(x-1)^2} dx=\int \frac{-1-u}{u^2} du=\int \frac{-1}{u^2} du -\int \frac{1}{u} du= \frac{1}{u}-\ln u=\frac{1}{x-1} - \ln {(x-1)}$.
