\(\left(x^2-2x-y^2+1\right)=\left(x^2-2x+1\right)-y^2=\left(x-1\right)^2-y^2=\left(x-1-y\right).\left(x-1+y\right)=\left(x-y-1\right).\left(x+y-1\right)\)
\(\left(x-y-1\right).\left(x-1+y\right):\left(x-y-1\right)=x-1+y\)
\(\Rightarrow\left(x^2-2x-y^2+1\right):\left(x-y-1\right)=x-1+y\)