How to solve the diophantine equation $2(x+y)=xy+9$?

We need to solve $$xy-2(x+y)+4=-5$$ or $$(x-2)(y-2)=-5$$ and it remains to solve the following systems.

$x-2=1$ and $y-2=-5$;

$x-2=-1$ and $y-2=5$;

$x-2=5$ and $y-2=-1$ and

$x-2=-5$ and $y-2=1$,

which gives the answer: $\{(1,7),(7,1), (3,-3),(-3,3)\}$.


$2(x+y) = xy +9 \implies 2x - xy = 9 - 2y \implies x = \frac{9-2y}{2-y} = \frac{2y-9}{y-2} = 2 - \frac{5}{y-2}$.

If $x$ is an integer, then $\frac{5}{y-2}$ is also an integer. This will tell you what $y$ can be, then what $x$ can be. Trying these out will give you the solution $y=7, x=1$ and the solution $y=3,x=-3$, which then will give you four solutions, since you can switch $x,y$ (it doesn't change the equation) and get more solutions.