Linear Diophantine Equation Calculator

Solve linear Diophantine equations of the form ax + by = c and find all integer solutions.

Equation: ax + by = c

Solution Condition

The equation ax + by = c has integer solutions if and only if:

gcd(a, b) divides c

General Solution

If (xβ‚€, yβ‚€) is a particular solution, then all solutions are:

x = xβ‚€ + (b/d)t

y = yβ‚€ - (a/d)t

where d = gcd(a,b) and t is any integer

Equation

12x + 8y = 28

GCD(a, b)
4
Solutions Exist
Yes

Particular Solution

xβ‚€

7

yβ‚€

-7

General Solution

x = 7 + 2t

y = -7 - 3t

where t is any integer

Sample Solutions

txyVerify
-5-38OK
-4-15OK
-312OK
-23-1OK
-15-4OK
07-7OK
19-10OK
211-13OK
313-16OK
415-19OK
517-22OK