Let $a,b$ be given integers and $gcd(a,b)|n$, which implies by a theorem that I have that there are some integers $x_0,y_0$ such that $n=ax_0+by_0$. Moreover, suppose that $x,y$ are two other integers such that $n=ax+by$.
I need to show that $x$ has the form $x_0+\frac{tb}{gcd(a,b)}$ and $y$ has the form $y_0-\frac{ta}{gcd(a,b)}$ for some appropriate choice of integer $t$. I was given the hint to prove this by contradiction but I saw absolutely no path forward using that.
Since $n=ax_0+by_0=ax+by$ I can infer $a(x-x_0)=-b(y-y_0)$. I can also see that my goal amounts to proving the existence of an integer $t$ such that
$$(x-x_0)\cdot gcd(a,b) = tb\\ (y-y_0)\cdot gcd(a,b)=-ta$$
This vaguely resembles the statement that $b$ divides the left-hand side of the first equation, and likewise for $a$, although it's a little more than that. One thing that comes to mind is that $|ab| = gcd(a,b)lcm(a,b)$ but I'm not seeing how I could use that. Thought about maybe arguing that since $a(x-x_0)=-b(y-y_0)$ then either $b|a$ or $b|x-x_0$ but that only holds for prime $b$.
Any help would be appreciated.
We know $a(x-x_0) = -b(y-y_0), a = gcd(a,b)\times c, b = gcd(a,b)\times d$, and $gcd(c,d) = 1$, so $$gcd(a,b)\times c (x-x_0)= -b(y-y_0) \Rightarrow x -x_0 = \frac{-(y-y_0)}{c}b \times \frac{1}{gcd(a,b)}$$
Therefore: $$x = x_0 + \frac{tb}{gcd(a,b)}$$ Which is $t = \frac{y_0 - y}{c}$. So we should show $\frac{y-y_0}{c}$ is an integer number. To show this:
$a(x-x_0) = -b(y-y_0) \Rightarrow gcd(a,b) \times c (x-x_0) = -gcd(a,b) \times d (y-y_0)\Rightarrow x-x_0 = d(y-y_0)/c$
as we know $x-x_0$ is integer, and $gcd(c,d) = 1$, so $\frac{y-y_0}{c}$ is an integer.