Diophantine Equation Calculator

Find integer solutions to Ax + By = C with step-by-step insights and verification notes from number theory.

Equation Inputs

Provide integer coefficients for A, B, and the constant C to see a representative solution and the general parameterized family.

How to Use This Calculator

This calculator finds integer solutions to linear Diophantine equations of the form Ax + By = C. Enter integer values for A, B, and C, then click Calculate to view one particular solution along with the generalized formula for every integer pair that satisfies the equation.

Methodology

The engine relies on the Extended Euclidean Algorithm to compute a base solution where A times x plus B times y equals the greatest common divisor of A and B. The base solution is then scaled by C divided by that gcd, which yields one valid integer solution. Because any solution can be shifted by multiples of (B/d, -A/d), the tool also displays the general solution family.

Source and interpretation

All calculations are based on standard number theory techniques. For deeper background on linear Diophantine equations and the extended Euclidean approach, this source is a helpful guide.

Glossary of terms

  • Coefficient A and B: The integers multiplying variables x and y.
  • Constant C: The value on the right-hand side of the equation that the combination must equal.
  • Solutions: Integer values for x and y that satisfy the equality.

Example

For 3x + 4y = 5, the calculator returns one solution (such as x = 3, y = -1) plus the general form x = 3 + 4t, y = -1 - 3t that generates every integer pair satisfying the equation.

Frequently Asked Questions

What are Diophantine equations?

Polynomial equations for which only integer solutions are of interest.

Why are they important?

Number theorists, cryptographers, and algorithm designers use Diophantine techniques to reason about integer constraints.

Can all Diophantine equations be solved?

No; some forms are undecidable or require specialized methods. Linear Diophantine equations like Ax + By = C always have solutions when gcd(A, B) divides C.

What is an example of a Diophantine equation?

Fermat's Last Theorem is a famous historical example of a Diophantine problem with deep complexity.

Where can I learn more?

Explore academic notes, textbooks, and educational websites for number theory, especially resources that cover the Euclidean and Extended Euclidean algorithms.

Formulas

Linear Diophantine equation: Ax + By = C. The equation has solutions if and only if gcd(A, B) divides C.

The Extended Euclidean Algorithm returns integers (x0, y0) such that A·x0 + B·y0 = gcd(A, B). Scaling the base solution by C / gcd yields a particular solution.

The general solution family is x = x0 + (B / gcd)·t and y = y0 − (A / gcd)·t for every integer t.

Citations

this source — math.uwaterloo.ca · Accessed 2026-01-19

https://www.math.uwaterloo.ca/~snburris/htdocs/linear.html

Changelog
  • 0.1.0-draft — 2026-01-19: Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido Last Updated: 2026-01-19 Version 0.1.0-draft
Version 1.5.0