U-Substitution, can't figure out where the answer comes from?

Homework Statement

Simply enough, solve the following using U-Substitution.

dy/dx = y2-2y+1

y = 1+(x+C)-1

2. The attempt at a solution

I know how to do this, I thought. But i'm just spinning my wheels and need somebody to show me my error...

I tried moving around the dy/dx parts, so that I eventually ended up with
dx=dy/(y2-2y+1)
which simplified to
x=ln(y2)2y-ln(2y)2+y, but thats not right, unless I'm missing some kind of simplification?

Honestly, I have no idea where the textbook got the answer. Any tips? What am I doing wrong?