Let gcd(x,y)=d and x=ad, y=bd. Then the equation can be written as a2b2d2a2+249ab+b2=20121 or
a2b2d2=2012(a2+249ab+b2).
As a and b are relatively prime, a2 and b2 are both relatively prime to a2+249ab+b2 and therefore both they must be divisors of 2012. As 2012=22⋅503 and 503 is a prime, the possible cases are (a,b)=(1,1), (a,b)=(1,2), (a,b)=(2,1). If we substitute (a,b)=(1,1) into the last equation, we get d2=2012⋅251, which is not solvable in integers. The other two cases give 4d2=2012⋅503, from which d=503. This leads to the solutions (x,y)=(503,1006) and (x,y)=(1006,503).
2012x2+249⋅2012xy+2012y2=x2y2.
From the left-hand side we see that both sides of the equation must be divisible by 503. As 503 is a prime, one of the numbers x and y must be divisible by 503. So x2 or y2 is divisible by 5032, giving that both sides of the equation are divisible by 5032. If x is divisible by 503, the summands 2012x2 and 249⋅2012xy on the left-hand side are divisible by 5032, meaning that 2012y2 is divisible by 5032. Therefore y is divisible by 503. Analogously, we get that if y is divisible by 503, then x is also divisible by 503. Consequently, both x and y are divisible by 503. Denote x=503a, y=503b. Then the equation, after dividing both sides by 5033, simplifies to 4a2+996ab+4b2=503a2b2. Assume a≥b. If b≥2, then 503a2b2≥503a2⋅2b=1006a2b=4a2b+4a2b+998a2b>4a2+4b2+996ab, so the last equation cannot hold. Therefore b=1. Now we get a quadratic equation 499a2−996a−4=0 with respect to a, whose only positive solution is a=2. From here we obtain the solution (1006,503) to our original equation. The case b≥a is symmetrical and gives the solution (503,1006).