Let $n, a$ and $b$ be positive integers such that $ab = n^2$. If $\gcd(a, b) = 1$, prove that there exist positive integers $c$ and $d$ such that $a = c^2$ and $b = d^2$
So far I have tried this:
Since $n^2 = ab$ we have that $n = \sqrt{ab}$. Because $\gcd(a,b) = 1$, there exists integers $k$ and $l$ such that $ak + bl = 1$. This means that $\sqrt{a}(k\sqrt{}) + \sqrt{b}(l\sqrt{b}) = 1$. Hence $\sqrt{a}$ and $\sqrt{b}$ are both positive integers and we can set $\sqrt{a} = c$ for some arbitrary integer $c$ and $\sqrt{b} = d$ for some arbitrary integer $d$. Therefore, $a = c^2$ and $b = d^2$.