Diophantine Solver

Integer solutions of ax+by=c

About this calculator

The Diophantine Solver finds all integer solutions of the linear equation a·x + b·y = c. It uses the extended Euclidean algorithm to compute gcd(a, b) and Bézout coefficients, reports whether a solution exists, and gives the full one-parameter family x = x0 + (b/g)·t, y = y0 − (a/g)·t with sample solutions and a lattice-point visual.

Common examples

  • 3x + 5y = 11 → x = 2 + 5t, y = 1 − 3t
  • 6x + 9y = 15 → gcd 3 divides 15, x = 4 + 3t, y = −1 − 2t
  • 2x + 4y = 5 → gcd 2 does not divide 5, no integer solutions
  • 0x + 5y = 10 → y = 2, x is free (x = t)
  • 0x + 0y = 0 → every integer pair (x, y) is a solution