<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 you want $\sqrt{7+4\sqrt{3}}=a+b\sqrt d$ (where $a$ and $b$ are rational numbers, and $d$ is a square-free integer) then $7+4\sqrt{3} = a^2+db^2+2ab\sqrt d$, which yields the natural choice $d=3$.
Then $a^2+3b^2=7$ and $2ab=4$ can be solved in the rational numbers, and you find $a=2,b=1$ (because $a^2+3 \cdot (2/a)^2=7$ has solutions $±2$ and $±\sqrt 3$).
</s>