x^2 + 2y^2 - 2y - 2xy + 1 = (x^2 - 2xy + y^2) + (y^2 - 2y + 1) = (x - y)^2 + (y - 1)^2
\(x^2+2y^2-2y-2xy+1\)
\(=x^2-2xy+y^2+y^2-2y+1\)
\(=\left(x-y\right)^2+\left(y-1\right)^2\)
\(=\left(x-y\right)^2-\left(1-y\right)^2\)
\(=\left(x-y-1+y\right)\left(x-y+1-y\right)\)
\(=\left(x-1\right)\left(x-2y+1\right)\)