How can I prove
$$\gcd(a,b) = \gcd(a, b +ax)$$
Thanks.
Note that if $d\mid a$ and $d \mid b$, then clearly $d \mid (b+ax)$. On the other hand, if $d \mid a$ and $d \mid (b+ax)$, then we have $d\mid(b+ax+a(-x))$ by the same argument. Since $b + ax + a(-x) = b$, this is the same as saying $d\mid b$.
Therefore $a$ and $b$ have all the same divisors in common as $a$ and $b+ax$. Specifically, the largest one must be the same for both pairs.
Suppose that $\gcd(a,b)=c$. Then $c$ certainly divides $b+a \cdot x$, since c divides both $a$ and $b$. So $\gcd(a,b+a \cdot x) \ge \gcd(a,b)$.
Now suppose $\gcd(a,b+a \cdot x)=d$. Then $d$ divides $a$, which means it divides $a*x$, so since it must divide $b+a*x$, it also has to divide $b$. Hence, $d$ divides both $a$ and $b$. So, $\gcd(a,b) \ge \gcd(a,b+a \cdot x)$.
From these two results, it follows that $\gcd(a,b)=\gcd(a,b+a \cdot x)$.