Diophantine Equation Calculator

Solve linear Diophantine equations ax + by = c for integer solutions using the Extended Euclidean Algorithm.

Equation: ax + by = c

12x + 8y = 20

General Solution

x = 5 + 2t

y = -5 + -3t

where t is any integer

gcd(12, 8)

4

Particular Solution

(5, -5)

Smallest Positive Solution

x = 1, y = 1

Sample Solutions

txyCheck
-3-1420
-21120
-13-220
05-520
17-820
29-1120
311-1420

Linear Diophantine Equations

Existence Condition

ax + by = c has integer solutions if and only if gcd(a, b) divides c.

General Solution

If (x₀, y₀) is a particular solution, all solutions are: x = x₀ + (b/d)t, y = y₀ - (a/d)t

💡

Help us improve!

How would you rate the Diophantine Equation Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

📚

Formula Source: Handbook of Mathematical Functions

by Abramowitz & Stegun

🔄Last reviewed: May 2026
✓Formula checks are based on standard references and internal QA review.