For positive integers $$, $$ and $$ with $ = ^2$ and $\gcd(a,b)=1$, show that $a$ and $b$ are squares 
Let $$, $$ and $$ be positive integers such that $ = ^2$. If $gcd(, ) = 1$, prove that there exist positive integers $$ and $$ such that $ = ^2$ and $ = ^2$. 

I'm a bit lost. I know that $1 = ac + bd$, and I can simplify $ab = n^2$ to $a = \frac{n^2}{b}$ and $b = \frac{n^2}{a}$, but I don't know where to go from there. I try substituting $a$ and $b$ but cannot figure out how to get that $a = c^2$ and $b = d^2$. 
 A: For $n^2$ to be a perfect square, all the prime factors of $n^2$ must appear to even powers.  Another way to see this is that all the prime factors of $n$ appear with twice the power in $n^2$.  Since $\gcd(a,b)=1, a$ and $b$ have no prime factors in common, so all the prime factors in $a$ must appear to an even power, so $a$ is a square.
A: The prime factorization of $n^2$ will look like $p_1^{2\alpha_1} p_2^{2\alpha_2}p_3^{2\alpha_3}...p_k^{2\alpha_k}$ (a product of prime powers with even exponents).
If $ab = n^2$ and $\gcd(a, b) = 1$, then each one of these $p^{2\alpha}$ terms has to come from either $a$ or $b$ but not both (otherwise they wouldn't be coprime by definition). 
And so both $a$ and $b$ will have prime factorizations consisting entirely of primes with even powers. This means both $a$ and $b$ will be square numbers themselves.
A: $ab=n^2,\quad gcd(a,b)=1$
We can write in terms of the product of its prime factors:
$$n=\prod_{i=1}^{s}p_{i}^{m_{i}},\quad\text{ where $p_i$ are the prime factors of $n$.}$$
$$\implies n^2= \prod_{i=1}^{s}p_i^{2m_i}$$
Now since $gcd(a,b)=1$, they can not share any prime factors with each other. Therefore the prime factorisation of $a$ must all have even powers, and so must the prime factors of $b$ - if any of their factors are odd, then for $ab=n^2$, we would require $gc(a,b)\neq 1$ which is a contradiction. Therefore they are both square numbers.
