How can I prove that $\gcd(a,b) = \gcd(a,b,ax+by)$?
I know that $\gcd(a,b)$ can be written in linear equation like this: $$ \gcd(a,b) = ax + by $$ Does that mean that I can substitute it to $\gcd(a,b,ax+by)$? If yes, what's next?
How can I prove that $\gcd(a,b) = \gcd(a,b,ax+by)$?
I know that $\gcd(a,b)$ can be written in linear equation like this: $$ \gcd(a,b) = ax + by $$ Does that mean that I can substitute it to $\gcd(a,b,ax+by)$? If yes, what's next?
Hint:
You can use that $\gcd(a,b)$ is the positive generator $d$ of the ideal $I=(a,b)$. If this positive generator satisfies the Bézout's identity $d=ax+by$, what can you say of the ideal $J=(a,b, ax+by)$?
Every common divisor of the two numbers $a$ and $b$ is also a divisor of $ax + by$, so is a common divisor of the three numbers $a$, $b$ and $ax + by$. Of course also every common divisor of the three numbers $a$, $b$ and $ax + by$ is a common divisor of just the two numbers $a$ and $b$.
So the set of common divisors of $a$ and $b$ is the same set as the set of common divisors of $a$, $b$ and $ax + by$. Therefore, the greatest elements of these two sets are also equal.
It is special case $\,c = ax+by\,$ of the following more general
Lemma $\ \ (a,b)\mid c\,\Rightarrow\, (a,b,c) = (a,b)\ \ \ $ [here $\,(x,y,\ldots):=\gcd(x,y,\ldots)\,$]
Proof $\ \ (a,b,c) = ((a,b),c) = (a,b)(1,c/(a,b)) = (a,b)$
where we applied the gcd associative and distributive laws.
Remark $ $ More generally, as in the descent step in the Euclidean algorithm, it is easy to prove that a gcd is preserved if we mod out one argument by another, or by the gcd of some others, e.g. $$\bmod (a,b)\!:\ c\equiv \bar c\ \Rightarrow\ (a,b,c) = (a,b,\bar c)\qquad $$
The lemma is the special case $\,\bar c = 0,\,$ i.e. $\,c\equiv 0\pmod{(a,b)}$
Though you can prove the OP directly without using these laws (by essentially inlining their proofs, e.g. via Bezout), this method will soon lead to great difficulty in more complex problems without the simplification afforded by the abstracted basic laws. So you should strive to learn these fundamental properties sooner rather than later. The proofs of these laws are no more difficult than in the special cases, and the laws generalize to wider classes of rings (where Bezout-based proofs may fail).
If you know ideal theory then you will find it illuminating to compare the gcd proofs with the ideal proofs, using the view point of unimodular transformations of ideal generators (a generalization of Bezout-based proofs).
First you should look at the hints and try to do it yourself, believe me if will feel much better if you do it by yourself.
But if you can't figure it out here is the solution.
First thing you should notice is that $gcd(a,b,ax+by) \leq gcd(a,b)$
Let $gcd(a,b)=g$ then $g|a,g|b \Rightarrow g|(ax+by)$
Hence $gcd(a,b)=gcd(a,b,ax+by)$