Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I find the integer solutions for the diophantine equations $axy +bx + cy =d$ ?
the smallest particular solution ($x_0$,$y_0$) and a way to generate the rest.

share|cite|improve this question
up vote 11 down vote accepted

From $axy+bx+cy=d,$ multiplying through by $a$ and factoring gives $$(ax+c)(ay+b)=ad+bc.$$ So for particular $a,b,c,d$ there can only be finitely many solutions, and an admittedly unsatisfactory way to look for them is to factor $ad+bc$ in all possible ways and set the two factors equal to the two linear terms on the left and solve, to see if $x,y$ come out integers.

EDIT: There is the possibility that the right side $ad+bc=0$, for which there may be infinitely many solutions, however this is the degenerate case of the original equation in which it represents the union of two lines, and is not an interesting case.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.