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
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityHow 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
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$