# Square Root of Rational Number $\frac{A}{B}$

Let $$x=\frac{A}{B}$$ be a positive rational number in lowers terms (i.e., $$A, B\in\mathbb{N}$$ and $$hcf(A,B)=1$$). Prove that $$\sqrt{x}$$ is rational if and only if $$A$$ and $$B$$ are both perfect squares. (Remember that your proof should work for cases like $$A=40$$, where $$A$$ is not a perfect square but has a factor that is a perfect square.)

I know prime factorization is involved but that's basically it. Proving that $$\sqrt{y}$$ (for some number y) is rational if and only if $$y$$ is a perfect square I can do. Applying that that to the fraction mentioned above? Not so much.

Any and all help would be appreciated. Thank you.

• Write $\displaystyle\sqrt x = {p \over q}$. Then $\displaystyle{A \over B} = {p^2 \over q^2}$, and $Aq^2 = Bp^2$. Now use uniqueness of prime factorizations. Commented Mar 31, 2016 at 7:57

One of them should be trivial. If $A,B$ are perfect squares, then it shuold be easy to show that $\sqrt x$ is rational.
• Assume that $x$ is rational.
• Therefore, $x=\frac pq$ for some $p,q$ such that $hcf(p,q)=1$.
• Now, take a look at the equality $\frac AB = \frac{p^2}{q^2}$. Multiply the equality by $Bq^2$. What do you get?