At first I thought $\sqrt a\cdot\sqrt b$ is rational only when both $a$ and $b$ are squares of rational numbers. But then the example of $\sqrt2$ comes in and if $a=b=\sqrt2$, $\sqrt a\cdot\sqrt b$ is a rational number.
So what's the full version? Is $\sqrt a\cdot\sqrt b$ rational only when a and b are squares of rational numbers and $a=b$?
thanks!
No, the numbers don't need to be squares of rational numbers. For example,
$$\sqrt{\frac{16}{e}}\cdot \sqrt{e}$$
is a rational number.
In fact, if $a\neq 0$, then $$\sqrt{a}\cdot\sqrt{\frac{q^2}{a}}$$ is a rational number if $q$ is a rational number.
And it goes the other way too, i.e. if $a\neq 0$ and $\sqrt{a}\sqrt{b}$ is a rational number, then $b=\frac{q^2}{a}$ for some rational number $q$, since
$$\sqrt a\sqrt b = q\in\mathbb Q\\ ab=q^2\\ b=\frac{a}{q^2}$$