TITLE: Prove that $2xy\mid x^2+y^2-x$ implies $x$ is a perfect square.
QUESTION [14 upvotes]: Prove that $2xy\mid x^2+y^2-x$ implies $x$ is a perfect square.
My work:
$2xy\mid x^2+y^2-x \implies x^2+y^2-x=2xy\cdot k$
So,$x^2+y^2+2xy-x=(x+y)^2-x=2xy \cdot (k+1)$
And,$x^2+y^2-2xy-x=(x-y)^2-x=2xy \cdot (k-1)$
I found that for $x,y$ both odd, no solution exists. For $x$ even, and $y$ odd,no solution exists. Solution exists only for $x$ odd, $y$ even and $x$ even and $y$ even solution exists. Cannot do anything more. Please help!

REPLY [6 votes]: Observe that $\ x\mid y^2\,$ and $\ x  = (x\!-\!ky)^2+(1\!-\!k^2)y^2\ ( =\, x^2\!+y^2-2kxy,\ k\in\Bbb Z).\ $ Now apply
Theorem  $\quad\, n\mid y^2\,$ and $\ n =  z^2\!+ay^2\,\Rightarrow\, n\, =\, \pm (z,y)^2$
Proof $\ \pm n = (n,y^2) = (z^2\!+ay^2,y^2) = (z^2,y^2) = (z,y)^2\, $ by GCD Freshman's Dream $\  $ QED