<s>[INST] If $\gcd(a, b) = 1$ and if $ab = x^2$, prove that $a, b$ must also be perfect squares; where $a,b,x$ are in the set of natural numbers Problem:
If $\gcd(a, b) = 1$ and If $ab = x^2$ ,prove that $a$, $b$ must also be perfect squares; where $a$,$b$,$x$ are in the set of natural numbers
I've come to the conclusion that $a \ne b$ and $a \ne x$ and $b \ne x$ but I guess that won't really help me.. I understand that if the $\gcd$ between two numbers if $1$ then they obviously have no common divisors but where do I go from this point?
Any tips at tackling this would be great. It looks quite easy though I'm still trying to get my hand around these proofs! Any pointers in the right direction would be great.
Thank you in advance, 
 [/INST] Here is a proof using Bezout's Identity.
Let $x^2=ab$ and $\gcd(a,b)=1$, where $a,b\gt0$.
There are $u,v$ so that
$$
au+bv=1\tag{1}
$$
Let $s_a=\gcd(x,a)$. Rewriting $(1)$, we have
$$
\begin{align}
s_a\left(\dfrac{a}{s_a}\right)u+bv=1
&\implies s_a^2\left(\dfrac{a}{s_a}\right)^2u^2=1-b(2v-bv^2)\tag{2}\\
&\implies s_a^2\left(\dfrac{a}{s_a}\right)^2u^2a+ab(2v-bv^2)=a\tag{3}\\
&\implies s_a^2\left(\dfrac{a}{s_a}\right)^2u^2a+s_a^2\left(\dfrac{x}{s_a}\right)^2(2v-bv^2)=a\tag{4}\\[8pt]
&\implies s_a^2\mid a\tag{5}
\end{align}
$$
Justification:
$(2)$: Move $bv$ to the right side and square
$(3)$: Move $b(2v-bv^2)$ to the left side and multiply by $a$
$(4)$: $x^2=ab$
$(5)$: $s_a^2$ divides each term on the left side
There are $u_a,v_a$ so that
$$
\begin{align}
xu_a+av_a=s_a
&\implies\frac{x}{s_a}u_a+\frac{a}{s_a}v_a=1\tag{6}\\
&\implies\frac{x^2}{s_a^2}u_a^2=1-\frac{a}{s_a}\left(2v_a-\frac{a}{s_a}v_a^2\right)\tag{7}\\
&\implies\frac{ab}{s_a^2}u_a^2+\frac{a}{s_a}\left(2v_a-\frac{a}{s_a}v_a^2\right)=1\tag{8}\\
&\implies abu_a^2+as_a\left(2v_a-\frac{a}{s_a}v_a^2\right)=s_a^2\tag{9}\\[7pt]
&\implies a\mid s_a^2\tag{10}
\end{align}
$$
Justification:
$\ \:(6)$: Divide by $s_a$
$\ \:(7)$: Move $\frac{a}{s_a}v_a$ to the right side and square
$\ \:(8)$: Move $\frac{a}{s_a}\left(2v_a-\frac{a}{s_a}v_a^2\right)$ to the left side, $x^2=ab$
$\ \:(9)$: Multiply by $s_a^2$
$(10)$: $a$ divides each term on the left side
Combining $(5)$ and $(10)$ yields $a=\gcd(x,a)^2$. Symmetry yields, $b=\gcd(x,b)^2$.
</s>