<s>[INST] How do you simplify this square root of sum: $\sqrt{7+4\sqrt3}$? I came around this expression when solving a problem.
$$\sqrt{7+4\sqrt{3}}$$
WolframAlpha says it equals $2+\sqrt{3}$. We can confirm it like this
$$\left(2+\sqrt{3}\right)^2  \;=\;  4+4\sqrt{3} + 3  \;=\;  7 + 4\sqrt{3}.$$
However, the only way I can think of how to simplify that expression in hand is guessing. Is there a better way of calculating square root of a sum like that one?
 [/INST] If $7+4\sqrt{3}$ is a perfect square this means $7=a^2+3b^2$ is the sum of two squares in $\Bbb{Z}[\sqrt{3}]$ and $4\sqrt{3}=2ab\sqrt{3}$. So the possibilities are
$$a=\pm 1,b=\pm 2\\a=\pm 2,b=\pm 1$$
Only the latter gives $a^2+3b^2=7$
</s>