<s>[INST] Solve $2(x+y)+xy=x^2+y^2$ where $x,y \in \mathbb{Z}$ Solve the equation: $$2(x+y)+xy=x^2+y^2$$
How should I go about solving this? Any guidance appreciated.
Thanks!
 [/INST] $$8(x+y)=4(x^2-xy+y^2)\\8(x+y)=3(x-y)^2+(x+y)^2\\8z=3w^2+z^2\\16=3w^2+(z-4)^2$$
where $w=x-y$ and $z=x+y$
</s>