# Find all integer solutions of equation $y = \frac{a+bx}{b-x}$ [duplicate]

How to find all integer solutions for the equation

$$y = \frac{a+bx}{b-x}$$, where a and b are known integer values?

P.S. x and y must be integer at the same time

• $$y=-\frac{b(b-x)}{b-x}+\frac{a+b^2}{b-x}$$ May 18, 2021 at 9:56
• Connected: this question/answers May 18, 2021 at 10:18
• Clear denom's then complete the product as explained in the linked dupes. May 18, 2021 at 10:19
• I don't agree to close this question on the basis that it is the same as the two cited questions which are very different: here, we have a (special) parametric equation... May 18, 2021 at 10:34
• @JeanMarie Exactly the same method(s) apply here, e.g. complete the product, as I said. We already have hundreds of questions showing how to solve such Diophantine equations (e.g. the linked dupes). Nothing is novel here - see abstract duplicates May 19, 2021 at 0:01

First multiply denominator to other side : $$0 = yx + bx - by + a = (x-b)(y+b) + a + b^2$$

$$(x-b)(y+b) = -(a+b^2)$$

Then all you need is to write RHS as multiplication of 2 integers: $$-(a+b^2) = mn$$ and then get 2 solutions $$(m+b, n-b)$$ and $$(n+b, m-b)$$ for all different $$(m, n)$$ pairs.

Corner case: $$a = -b^2$$, then all $$(x,-b)$$ is solution except $$x=b$$ since function is not defined at $$x=b$$

• @JeanMarie we are doing $xy +bx - by - b^2 + a + b^2 = (x-b)(y+b) + a + b^2 = 0$ May 18, 2021 at 10:26
• You are right. Sorry. I erase my remark. May 18, 2021 at 10:31
• Deserved to be the answer to this problem! May 18, 2021 at 12:41
• @Snowflake with your pseudo, are you completely objective towards Snowball :) ? May 18, 2021 at 14:51
• @JeanMarie I have never encountered this young man May 18, 2021 at 15:37