TITLE: Show that $\gcd(a^2, b^2) = \gcd(a,b)^2$
QUESTION [10 upvotes]: Let $a$ and $b$ be two integers. Show that $\gcd(a^2, b^2) = \gcd(a,b)^2$.

This is what I have done so far:
Let $d = \gcd(a,b)$. Then $d=ax+by$ for some $x,y$. Then $d^2 =(ax+by)^2 = a^2x^2 + 2axby+b^2y^2$.
I am trying to create a linear combination of $a^2$ and $b^2$ but do not know what to do with the middle term.
EDIT: I would be interested in seeing a proof using the Fundamental Theorem of Arithmetic as well. I simply thought it would be easiest to use Bezout's Identity.

REPLY [6 votes]: Suppose that $(a,b)=d$. Then Bezout's Identity says that we have some $x,y$ so that $ax+by=d$, and therefore
$$
a^3x^3+3a^2bx^2y+3ab^2xy^2+b^3y^3=d^3\tag{1}
$$
Dividing $(1)$ by $d$, remembering that both $d\mid a$ and $d\mid b$, we get
$$
a^2\left(\frac adx^3+3\frac bdx^2y\right)+b^2\left(3\frac adxy^2+\frac bdy^3\right)=d^2\tag{2}
$$
$(2)$ says that $\left.\left(a^2,b^2\right)\middle|\,d^2\right.$. Since $d\mid a$ and $d\mid b$, we also have $\left.d^2\,\middle|\left(a^2,b^2\right)\right.$.
Therefore,
$$
\left(a^2,b^2\right)=d^2=(a,b)^2
$$