How might I have anticipated that $\frac14(\sqrt{5+2\sqrt5}+\sqrt{10+2\sqrt{5}})$ simplifies to a single surd (namely, $\frac14\sqrt{25+10\sqrt{5}}$)? This is perhaps a silly question related to calculating with surds. I was working out the area of a regular pentagon ABCDE of side length 1 today and I ended up with the following expression :
$$\frac{\sqrt{5+2\sqrt5}+\sqrt{10+2\sqrt{5}}}{4}$$
obtained by summing the areas of the triangles ABC, ACD and ADE.
I checked my solution with Wolfram Alpha which gave me the following equivalent expression :
$$\frac{\sqrt{25+10\sqrt{5}}}{4}$$
I was able to show that these two expressions are equivalent by squaring the numerator in my expression, which gave me
$$15+4\sqrt5+2\sqrt{70+30\sqrt5},$$
and then "noticing" that
$$\sqrt{70+30\sqrt5}=\sqrt{25+30\sqrt5+45}=5+3\sqrt5.$$
My question is the following : how could I have known beforehand that my sum of surds could be expressed as a single surd, and is there a way to systematize this type of calculation ? I would have liked to find the final, simplest expression on my own without the help of a computer.
Thanks in advance !
 A: $10 + 2 \sqrt 5$   has norm $100 - 5 \cdot 4 = 80.$ $5 + 2 \sqrt 5$   has norm $25 - 5 \cdot 4 = 5.$   The ratio of the norms is $\frac{80}{5} = 16,$  which is an integer and a square, so the ratio might be very nice.
$$ \frac{10+2 \sqrt 5}{5 + 2 \sqrt 5} \cdot \frac{5-2 \sqrt 5}{5 - 2 \sqrt 5} 
=   \frac{30-10 \sqrt 5}{5 }  = 6 - 2 \sqrt 5  $$
Next, $36 - 5 \cdot 4 = 16$  so $ 6 - 2 \sqrt 5 $  might be a square.  Indeed, by inspection it is $\left( 1 - \sqrt 5  \right)^2 =  \left(  \sqrt 5  - 1  \right)^2$    So  $10 + 2 \sqrt 5  = \left(  \sqrt 5  - 1  \right)^2 \left( 5 + 2 \sqrt 5 \right) $   and
$  \sqrt{10 + 2 \sqrt 5}  =  \left(  \sqrt 5  - 1  \right) \sqrt { 5 + 2 \sqrt 5  } $   Thus
$$  \sqrt{10 + 2 \sqrt 5} + \sqrt { 5 + 2 \sqrt 5  } =  \left(  \sqrt 5    \right) \sqrt { 5 + 2 \sqrt 5  } =  \sqrt { 25 + 10 \sqrt 5  }$$
$$ \color{red}{ \sqrt{10 + 2 \sqrt 5} + \sqrt { 5 + 2 \sqrt 5  } =   \sqrt { 25 + 10 \sqrt 5  } } $$
A: Yes. There is a way to formalize this particular type of sum of square roots, similar to the way a determinant is developed for quadratic equations.
We can write the generic form of the expression in the first place as follows.
$\sqrt{a+b\sqrt{s}}+\sqrt{c+d\sqrt{s}}=\sqrt{x+y\sqrt{s}}$
Note that

*

*$a, b, c, d, s$ are given and rational. We aim to express $x,y$ in terms of them.

*The value in the double surds are identical, which are all $s$.

*Only square roots are considered.

Then,
$(\sqrt{a+b\sqrt{s}}+\sqrt{c+d\sqrt{s}})^2=(\sqrt{x+y\sqrt{s}})^2$
$(a+c)+(b+d)\sqrt{s}+2\sqrt{(a+b\sqrt{s})(c+d\sqrt{s})}=x+y\sqrt{s}$
$2\sqrt{(a+c+bds)+(ad+bc)\sqrt{s}}=(x-a-c)+(y-b-d)\sqrt{s}$
$4(a+c+bds)+4(ad+bc)\sqrt{s}=(x-a-c)^2+(y-b-d)^2s+2(x-a-c)(y-b-d)\sqrt{s}$
Let $p=x-a-c,\ q=y-b-d$.
By comparing the coefficients in the rational and irrational terms,
$\begin{cases}
p^2+q^2s=4(a+c+bds)\\
pq=2(ad+bc)
\end{cases}$
By substituting $q=\frac{2(ad+bc)}{p}$ and $p=\frac{2(ad+bc)}{q}$ from the second equation to the first equation, we can get a formula for each of $p$ and $q$.
$\begin{cases}
p^4-4(ac+bds)p^2+4(ad+bc)^2s=0\\
sq^4-4(ac+bds)q^2+4(ad+bc)^2=0
\end{cases}$
$\begin{cases}
p^2=2[ac+bds\pm\sqrt{(ac+bds)^2-(ad+bc)^2s}]\\
q^2=\frac{2}{s}[ac+bds\pm\sqrt{(ac+bds)^2-(ad+bc)^2s}]
\end{cases}$
$\begin{cases}
p=\pm\sqrt{2[ac+bds\pm\sqrt{(ac+bds)^2-(ad+bc)^2s}]}\\
q=\pm\sqrt{\frac{2}{s}[ac+bds\pm\sqrt{(ac+bds)^2-(ad+bc)^2s}]}
\end{cases}$
$\begin{cases}
x=\pm\sqrt{2[ac+bds\pm\sqrt{(ac+bds)^2-(ad+bc)^2s}]}+(a+c)\\
y=\pm\sqrt{\frac{2}{s}[ac+bds\pm\sqrt{(ac+bds)^2-(ad+bc)^2s}]}+(b+d)
\end{cases}$
As a result, there are three determinants to look at:

*

*$D_1=(ac+bds)^2-(ad+bc)^2s$ has a rational square root.

*$D_2=2(ac+bds\pm\sqrt{D_1})$ has a rational square root.

*$D_3=\dfrac{D_2}{s}$ has a rational square root.


We can use the two surds that you dealt with as an example.
$a=5, b=2, c=10, d=2, s=5$
$D_1=(ac+bds)^2-(ad+bc)^2s=400$, which is a perfect square.
$D_2=2(ac+bds\pm\sqrt{D_1})=100\text{ or }180$. 100 is a perfect square.
$D_3=\dfrac{D_2}{s}=36\text{ or }20$. 36 is a perfect square.
Therefore, the two surds can be summed to a single surd.
As seen above, the determinants are much more complex than the quadratic formula. I wonder if anyone would memorize them like $(b^2-4ac)$.
