Integer solutions to $ab=a+b$

If $ab=a+b$ is there only one possible solution,i.e. $a=b=2$? ($a$ and $b$ not equal to zero and are integers). If not what are the others?

I have proved that $a$ always needs to be equal to $b$. My proof is as follows- $ab=\cdot a\cdot a\cdot \cdots$ ($b$ times). Since the product is a factor of $a$ then clearly $b$ must be equal to $a$ for the equation to hold true. Please help me with all the possible solutions and is $2$ is the only possible solution please help me to prove it that it is the only possible solution. Thanks a lot in advance.


If $ab=a+b$, then $ab-a-b+1=1$, or $(a-1)(b-1)=1$. Then if $a$ and $b$ are integers, we have either $a-1=b-1=1$, and $a=b=2$, or $a-1=b-1=-1$ and $a=b=0$. If $a$ and $b$ are not necessarily integers, then choose a nonzero real number $r$, then $a=r+1$, $b=\frac{1}{r}+1$ is a solution to the equation.


It is not necessary to rely on jgon's clever trick of adding $1$ to both sides of an equation. $ab=a+b \Leftrightarrow ab-b=(a-1)b=a$. This means that $(a-1)$ is a factor of $a$. In the integers, that can only be true in two cases: $(a-1)=1$ or $a=0$. Simple substitution and arithmetic using those values gives the previously identified solutions, $a=b=2$ and $a=b=0$.