The extended Euclidean algorithm also computes integers satisfying . When and are coprime, either coefficient gives the corresponding modular multiplicative inverse.
A linear Diophantine equation in two variables has the form with integer coefficients and seeks integer solutions.
If are nonzero integers, , and is one solution of the linear Diophantine equation , then all solutions areSubtract two solutions and use the fact that and are coprime integers. The linear Diophantine equation solvability criterion says that a particular solution exists exactly when divides ; the extended Euclidean algorithm constructs one. This parametrization separates existence from the complete family of answers.
The equation has an integer solution exactly when divides . Bézout's identity proves sufficiency, while every integer linear combination of is divisible by their greatest common divisor.