Linear Diophantine Equation Calculator

Enter a, b and c to find every whole-number solution of ax + by = c.

The coefficient of x.

The coefficient of y.

The number on the right.

Try

Result

You entered6x+9y=76x + 9y = 7

No integer solutions\displaystyle \text{No integer solutions}

gcd

gcd⁡(6,9)=3\displaystyle \gcd(6, 9) = 3
Show the work
  1. When ax + by = c has integer solutions

    Every value of ax+byax + by with whole xx and yy is a multiple of gcd⁡(a,b)\gcd(a, b), so the equation can be solved only when gcd⁡(a,b)\gcd(a, b) divides cc.

    Using gcd⁡(a,b)∣c\gcd(a, b) \mid c

    gcd⁡(6,9)=3,  3∤7\gcd(6, 9) = 3,\ \ 3 \nmid 7
  2. Result

    Since 33 does not divide 77, there are no integer solutions.

Worked examples