How does $\sqrt{2+\sqrt{2}}+\sqrt{2-\sqrt{2}}$ become $\sqrt{2(2+\sqrt{2})}$? I'd like to know how can one simplify the following expression
$$\sqrt{2+\sqrt{2}}+\sqrt{2-\sqrt{2}}$$
into
$$\sqrt{2(2+\sqrt{2})}.$$
Wolfram alpha suggests it as an alternative form, and numerically it's easy to verify, but I can't find the right algebra to show they are indeed equivalent.
Note I ran into this problem, trying to do: $2\cos(\pi/8)+2\sin(\pi/8)$, where
$$2\cos(\pi/8)=\sqrt{2+\sqrt{2}},$$
$$2\sin(\pi/8)=\sqrt{2-\sqrt{2}}.$$
 A: Suggestions:

*

*Square both sides and see where that leads you.

*If you want to keep taking the trigonometric route, you could use a formula for $\cos(\pi/8)+\sin(\pi/8)$.

A: Alternatively
We want
$\sqrt{2+\sqrt 2} + \sqrt {2-\sqrt 2}=\sqrt{something}$ so
$\sqrt{2+\sqrt 2} + \sqrt {2-\sqrt 2}=$
$\sqrt{(\sqrt{2+\sqrt 2} + \sqrt {2-\sqrt 2})^2}=$
$\sqrt{(2+\sqrt 2) + (2-\sqrt 2) + 2\sqrt{2+\sqrt 2}\sqrt {2-\sqrt 2}}=$
$\sqrt{4 + 2\sqrt{(2+\sqrt 2)(2-\sqrt 2)}}=$
$\sqrt{4 + 2\sqrt{4 - 2}}=$
$\sqrt{4 + 2\sqrt 2}=$
$\sqrt {2(2+\sqrt 2)}$
Or we could go the other way
We want some to get $\sqrt{2(2+\sqrt 2)} = \sqrt{\sqrt{2+\sqrt 2} + \sqrt{2-\sqrt 2}}$ so we try to get it into expresions that look closer and closer to it.
$\sqrt{2(2+\sqrt 2)} = \sqrt{(2+\sqrt 2) + (2 + \sqrt 2)}=$
$\sqrt{(2+\sqrt 2) +2\sqrt 2 +(2-\sqrt 2)}=$
$\sqrt{\sqrt{2+\sqrt 2}^2 + 2\sqrt 2+ {\sqrt{2-\sqrt 2}}^2}$
Now if we can prove that $\sqrt 2 = {\sqrt{2+\sqrt 2}}{\sqrt{2-\sqrt 2}}$ we'd be golden.
So side track: $ {\sqrt{2+\sqrt 2}}{\sqrt{2-\sqrt 2}}=$
${\sqrt{(2+\sqrt 2)(2-\sqrt 2}}=$
${\sqrt{2^2 - \sqrt 2^2}}=$
${\sqrt{4-2}} = \sqrt 2$.
so.... back on track:
$\sqrt{\sqrt{2+\sqrt 2}^2 + 2\sqrt 2+{\sqrt{2-\sqrt 2}}^2}=$
$\sqrt{\sqrt{2+\sqrt 2}^2 + 2\sqrt{2+\sqrt 2}{\sqrt{2-\sqrt 2}+ {\sqrt{2-\sqrt 2}}^2}}=$
$\sqrt{(\sqrt{2+\sqrt 2} + \sqrt{2-\sqrt 2})^2}=$
$\sqrt{2+\sqrt 2} + \sqrt{2-\sqrt 2}$
A: 
$2\cos(\pi/8)=\sqrt{2+\sqrt{2}}$


$2\sin(\pi/8)=\sqrt{2-\sqrt{2}}$

Start from your work,
$$2\cos(\pi/8)=2\sin(\frac{\pi}2-\frac{\pi}8)=2\sin(\frac{3\pi}8)$$
So
$$S=2\cos(\pi/8)+2\sin(\pi/8)=2\sin(\frac{3\pi}8)+2\sin(\frac{\pi}8)$$
Use formula:
$$\sin(x)+\sin(y)=2\sin({\frac{x+y}{2}})\cos(\frac{x-y}2)$$
We have
$$S=4\sin(\frac{\pi}4)\cos(\frac{\pi}8)=2\sqrt{2}\cos(\frac{\pi}8)=\sqrt{4+2\sqrt{2}}$$
A: Use Vieta's formulas : 
Let, $$x_1=\sqrt{2+\sqrt 2},\,x_2=\sqrt{2-\sqrt 2}$$
We have,
$$x^2-px+\sqrt 2=0\\
\implies p=\frac{x^2+\sqrt 2}{x}$$
Putting $$x=\sqrt{2-\sqrt 2}$$
We obtain:
\begin{align}p&=\frac{2}{\sqrt{2
-\sqrt 2}}\\
&=\frac{2(\sqrt{2+\sqrt 2})}{\sqrt 2}\\
&=\sqrt{2(2+\sqrt 2)}.\end{align}
A: Following @Yousef's answer:

 \begin{align} \sqrt{2+\sqrt{2}}+\sqrt{2-\sqrt{2}} &= x \\ \left(\sqrt{2+\sqrt{2}}+\sqrt{2-\sqrt{2}} \right)^2 &= x^2 \\ 2+\sqrt{2}+2-\sqrt{2}+2\sqrt{4-2} &= x^2 \\ 4+2\sqrt{2} &= x^2 \implies x=\sqrt{4+2\sqrt{2}} \end{align} as $x>0$.

A: Still another method:
Let $a=\sqrt{2+\sqrt2}$. Then $\sqrt{2-\sqrt2}=\sqrt{2}/a$ using the difference of squares factorization.
Squaring both results and adding gives
$a^2+(2/a^2)=4.$
Now complete the square by adding a constant in the middle of the expression. If $a=u$ and $\sqrt{2}/a=v$ to give the squared terms as above, then the bilinear term $2uv$ is just $2\sqrt2$ and we have
$a^2+2\sqrt2+(2/a^2)=4[a+(\sqrt2/a)]^2=4+2\sqrt2.$
Since we previously rendered $\sqrt{2+\sqrt2}=a,\sqrt{2-\sqrt2}=\sqrt{2}/a$ the claimed result follows.
We can also use $-2\sqrt2$ to complete the square and thus obtain the conjugate relation
$\sqrt{2+\sqrt2}-\sqrt{2-\sqrt2}=\sqrt{2(2-\sqrt2)}.$
A: 
(This space intentionally left blank.)
A: Rather than focus on the specifics of this one question, let's try to figure out the general case that this is an instance of.
We are given an expression of the form $$\sqrt{a + b} + \sqrt{a - b}$$
and we would like to somehow write this as the square root of a single quantity.  So, let's give it a name:
$$X = \sqrt{a + b} + \sqrt{a - b}$$
Square both sides, carefully using the identity $(u + v)^2 = u^2 + 2uv + v^2$.  We get
$$X^2 = (a + b) + 2\sqrt{a+b}\sqrt{a-b} + (a-b)$$
which simplifies (slightly) as
$$X^2 = 2a + 2\sqrt{a+b}\sqrt{a-b}$$
Now let's focus on the product of those two square roots.  We know that
$$\begin{aligned} \sqrt{a+b}\sqrt{a-b} &= \sqrt{(a+b)(a-b)} \\ &= \sqrt{a^2 - b^2} \end{aligned}$$
which allows us to write our main result as
$$X^2 = 2a + 2\sqrt{a^2 - b^2}$$
and finally we obtain
$$X = \sqrt{2\left( a + \sqrt{a^2 - b^2} \right) }$$
So we have shown the identity
$$\sqrt{a+b} + \sqrt{a-b} = \sqrt{2\left( a + \sqrt{a^2 - b^2} \right) }$$
The question in the OP is a specific instance of this, in which $a = 2$ and $b = \sqrt{2}$; in this case, the identity just discovered reads
$$\sqrt{2 + \sqrt{2}} + \sqrt{2 - \sqrt{2}} = \sqrt{2\left(2 + \sqrt{4-2} \right)}$$
which is exactly what we were asked to show.
But there are other interesting applications of the general identity.  For example, let $a = 5$ and $b = 3$.  Then our identity reads
$$\sqrt{5+3} + \sqrt{5-3} = \sqrt{2\left( 5 + \sqrt{5^2 - 3^2} \right) }$$
or equivalently
$$\sqrt{8} + \sqrt{2} = \sqrt{2\left( 5 + \sqrt{25-9} \right)}$$
which can, of course, be simplified further as
$$\sqrt{8} + \sqrt{2} = \sqrt{2\left( 5 + 4 \right)}$$
which is easily seen to be true.
