Proving if $a$ and $b$ are positive rational numbers and $\mathbb Q(\sqrt{a})=\mathbb Q(\sqrt{b})$ then $b=ac^2$ for some $c\in \mathbb Q$. Proving if $a$ and $b$ are positive rational numbers and $\mathbb Q(\sqrt{a})=\mathbb Q(\sqrt{b})$ then $b=ac^2$ for some $c\in \mathbb Q$.
I understand that $\mathbb Q(\sqrt{a})$ is the smallest field containing $\mathbb Q \cup \{\sqrt{a}\}$ (same for $b$). So, that would imply $a=b$, correct? 
For showing $a=b$:
If we let $\mathbb Q(\sqrt{a})=\alpha +\beta \sqrt{a}$ and $\mathbb Q(\sqrt{b})=\gamma +\delta \sqrt{b}$, how could we conclude $a=b$? Or, is there a easier way to represent $\mathbb Q(\sqrt{a})$ and $\mathbb Q(\sqrt{b})$?
After proving $a=b$, would it suffice to conclude:
$b=ac^2$. Because if $b=a$ then substitution yields $a=ac^2$ and $1=c^2$. Thus, $c=1\in \mathbb Q$. 
If this idea is correct, is there anything else that needs to be added to write it as a formal proof?
 A: The set $\mathbb{Q}(\sqrt{a})$ contains much more than $\mathbb{Q}\cup\{\sqrt{a}\}$: it consists of all the numbers of the form
$$
x+y\sqrt{a}\quad(x,y\in\mathbb{Q}).
$$
However, saying $\mathbb{Q}(\sqrt{a})=\mathbb{Q}(\sqrt{b})$ means just
$$
\sqrt{b}\in\mathbb{Q}(\sqrt{a})
\text{ and }
\sqrt{a}\in\mathbb{Q}(\sqrt{b})
$$
In other words, we know that there are $x,y,u,v\in\mathbb{Q}$ such that
$$
b=(x+y\sqrt{a})^2,\quad
a=(u+v\sqrt{b})^2
$$
Can you go on? 
You can assume that $\sqrt{a}$ and $\sqrt{b}$ are irrational (why?).
A: Note that $\sqrt{a}\in\mathbb{Q}\iff\sqrt{b}\in\mathbb{Q}$, and in this case the claim is trivial, so assume that $\sqrt{a},\sqrt{b}\notin\mathbb{Q}$ to avoid trivial cases. 
Since $\sqrt{b}\in\mathbb{Q}(\sqrt{a})$, you can write $\sqrt{b}=d+c\sqrt{a}$ for $d,c\in\mathbb{Q}$. This implies
$$
b=d^2+2dc\sqrt{a}+c^2a.
$$
Note that $c\neq 0$, else $b=d^2$, implying $\sqrt{b}=d\in\mathbb{Q}$. It suffices to show $d=0$. If not, solving for $\sqrt{a}$ shows $\sqrt{a}\in\mathbb{Q}$, a contradiction.
