If $2xy$ divides $x^2+y^2-x$, prove that $x$ is a perfect square This problem is from  ( BMO Exam1991 ). I tried to solve but it was difficult.
The problem is: 

If $ x^{2} + y^{2} - x $ is a multiple of $ 2xy $ where $x$ & $y$ are integers, prove that $x $ is a perfect square.

Any help or hint please.

So we are given that $$x^2+y^2-x-2kxy=0.$$
Write $x=a^2b$ with $b$ square-free. Then 
$$a^4b^2+y^2-a^2b-2ka^2by=0,$$ so $a^2\mid y^2$ and $a\mid y$, say $y=ac$.
Then $$a^2b^2+c^2-b-2kabc=0,$$ so $b\mid c^2$ and as $b$ is square-fee in fact $b\mid c$, say $c=bd$.
Then 
$$a^2b+bd^2-1-2kabd=0,$$
so $b\mid 1$.
Assume $b=-1$. Then we have
$$ a^2+d^2=2kad-1.$$
As the right hand side is odd, exactly one of $a,d$ must be odd, the other even. But then the right hand side is $\equiv -1\pmod 4$ and the left is $\equiv +1\pmod 4$.
We conclude $b\ne -1$, hence $b=+1$ and $$x=a^2.$$
