First note that if (x0,y0) and (x1,y1) are solutions to the equation ax + yb = c, then their difference (x0 - x1,y0 - y1) is a solution to the homogeneous equation ax + yb = 0.
Hence all solutions of ax + yb = c, if there are any, are of the form (x0,y0) plus a solution to the homogeneous equation ax + yb = 0.
Correctness of the algorithm is now a direct consequence of the
previous lemma
and theorem.