Result
Select an equation type and click Solve
Solve linear, quadratic, and modular Diophantine equations with step-by-step solutions.
Integer Solutions Graph
Solve an equation to see integer solution points.
No recently used tools
Loading categories...
Solve Diophantine equations with step-by-step solutions: Linear (ax+by=c) via extended Euclidean algorithm, Systems of two linear Diophantine equations, Quadratic (sums of squares x²+y²=n, Pell equation x²−Dy²=1), and Modular congruences (ax≡b mod m) with Chinese Remainder Theorem. Interactive integer lattice graphs. Built-in Python compiler with SymPy.
Solve linear, quadratic, and modular Diophantine equations with step-by-step solutions.
Solve an equation to see integer solution points.
A Diophantine equation is a polynomial equation where only integer solutions are sought. Named after Diophantus of Alexandria (circa 250 AD), these equations are central to number theory. The simplest form is the linear Diophantine equation ax + by = c. A solution exists if and only if gcd(a,b) divides c. The extended Euclidean algorithm finds a particular solution, and the general solution is parameterized by an integer t.
Bezout's identity states that for any integers a, b (not both zero), there exist integers x, y such that ax + by = gcd(a,b). The extended Euclidean algorithm constructively finds these Bezout coefficients. Starting from the standard Euclidean algorithm divisions, it back-substitutes to express gcd(a,b) as a linear combination of a and b. This gives a particular solution (x0, y0), and the general solution is x = x0 + (b/d)t, y = y0 − (a/d)t, where d = gcd(a,b).
The Pell equation x² − Dy² = 1 (D positive, non-square) always has infinitely many solutions. The fundamental solution (smallest positive x1, y1) can be found via the continued fraction expansion of √D. All other solutions follow the recurrence xn+1 = x1xn + Dy1yn, yn+1 = x1yn + y1xn. Pell equations appear in approximating irrational numbers and in algebraic number theory.
A linear congruence ax ≡ b (mod m) has solutions when gcd(a,m) divides b. The solution is found via the modular inverse of a, computed using the extended Euclidean algorithm. The Chinese Remainder Theorem (CRT) solves systems of congruences x ≡ ai (mod mi) when the moduli are pairwise coprime, giving a unique solution modulo the product of all moduli. CRT is foundational in cryptography (RSA), coding theory, and distributed computing.
Fermat's theorem on sums of two squares states that an odd prime p can be expressed as x² + y² if and only if p ≡ 1 (mod 4). More generally, a positive integer n is a sum of two squares if and only if every prime factor of the form 4k+3 appears to an even power in the factorization of n. Finding all representations x² + y² = n is a classic algorithmic problem solved by brute-force search or Cornacchia's algorithm.