Let R be a PID. Consider the Diophantine equation ax+by=N where a,b and N are integers and a,b are nonzero. Suppose x_0, y_0 is a solution: ax_0+by_0=N. Prove that the full set of solutions to this equation is given by
x = x_0 + (mb/gcd(a,b))
y = y_0 - (ma/gcd(a,b))
as m ranges over the integers.