Given the linear Diophantine equation:


$ a\_1 x\_1 + a\_2 x\_2 + ... + a\_n x\_n = b$


and its particular solution $(x\_1^\*, x\_2^\*, ..., x\_n^\*)$.


How to write down all the solutions of this equation?



All the solutions of linear Diophantine equation
First, complete the vector $(a\_1, \dotsc, a\_n)$ to a matrix $A$ with determinant $1.$ Then the solutions (of the homogeneous system) are all integer linear combinations of the second through $n$ *columns* of $A^{-1}.$ That you can complete the vector with gcd 1 to a unimodular matrix is basic to geometry of numbers, and can be proved fairly easily by induction (or see Morris Newman's book on "Integral Matrices", Thm II.1).


