Let $a,b$ be positive integers. Suppose that $x,y$ are the smallest positive integers such that $ax-by = 0$. Prove that \begin{align*} x = \dfrac{b}{gcd(a,b)} \quad \text{and} \quad y = \dfrac{a}{gcd(a,b)} \end{align*}
This is easy to prove when you set $x=1$ and $y=2$, but that is just an example. How would one prove this in a general sense?
Any tips would be appreciated!
From
$$ax - by = 0 \tag{1}\label{eq1}$$
you can get that
$$x = \frac{by}{a} \tag{2}\label{eq2}$$
$$y = \frac{ax}{b} \tag{3}\label{eq3}$$
First, since $x$ and $y$ are integers, \eqref{eq2} shows that
$$a \mid by \tag{4}\label{eq4}$$
Let
$$d = \gcd(a,b) \tag{5}\label{eq5}$$
$$a = de, \; e \in \mathbb{Z^{+}} \tag{6}\label{eq6}$$
$$b = df, \; f \in \mathbb{Z^{+}} \tag{7}\label{eq7}$$
Note \eqref{eq5}, \eqref{eq6} and \eqref{eq7} shows that
$$\gcd(e,f) = 1 \tag{8}\label{eq8}$$
Using \eqref{eq6} and \eqref{eq7} in \eqref{eq4} gives
$$de \mid dfy \implies e \mid fy \tag{9}\label{eq9}$$
Note \eqref{eq8} means $e \mid y$. Thus, the smallest positive integer $y$ is $y = e$. Using this and \eqref{eq6} in \eqref{eq2} gives
$$x = \frac{be}{de} = \frac{b}{d} = \frac{b}{\gcd(a,b)} \tag{10}\label{eq10}$$
Using a similar procedure, plus from substituting \eqref{eq10} in \eqref{eq3}, you can get that
$$y = \frac{a}{\gcd(a,b)} \tag{11}\label{eq11}$$