<s>[INST] If $x+y+2xy=83$, find the value of $x+y$. 
Let $x$ and $y$ be integers. If $x+y+2xy=83$, find the value of $x+y$.

I tried to multiply both sides by $x+y-2xy$ but I could never manage to simplify it. Is there a better way to solve this question?
 [/INST] Wolog assume $x \le y$ and $y-x = m\ge 0$ then
$2x + m + 2x(x+m) = 83$ and 
$2x^2 + (2+2m)x + (m-83) = 0$
$x = \frac {-(2+2m) \pm\sqrt{4m^2+8m + 4-4(m-83)*2}}4=$
$ \frac {-(2+2m) \pm\sqrt{4m^2 + 668}}4=$
$\frac {-1-m\pm \sqrt{m^2 +167}}2\in \mathbb Z$
So $m^2 + 167 = k^2$ for some non-negative integer, $k$, so 
$k^2 - m^2 = (k-m)(k+m) = 167$ but $167$ is prime so $k-m =1$ and $k+m=167$ so $m=83$ and $k = 84$
So $x = \frac {-1-83\pm84}2$
So $x = 0, -84$ and $y =83, -1$.  
So $x+y = 83$ or $-85$.
</s>