QUESTION: Let $x,y$ be positive integers such that the expression $\sqrt{\frac{x}{y}}$ is rational. Is it necessary that $x$ and $y$ have to be perfect squares?
So I've tried some numbers and the fraction is rational only when they are both perfect squares. Is there some kind of rule, law, or is there a proof that is needed?
If they are relatively prime, they have to be perfect squares--but not if they have a common factor! For example, $\sqrt{\frac{8}{2}}$ is rational.
To see that they need to be perfect squares if they are relatively prime, keep in mind that each positive rational can be uniquely factored into primes where some of the powers are negative and no prime is repeated. And when the numerator and denominator have no common factor, they are simply the products of the primes appearing with positive and negative exponents, respectively.