Square Root of Number Plus or Minus Square Root

Theorem
Given any real numbers $a$ and $b$ such that $a > 0, b > 0, a^2-b > 0$:

$\sqrt{a+\sqrt{b}} = \sqrt{\dfrac{a+\sqrt{a^2-b}}{2}}+\sqrt{\dfrac{a-\sqrt{a^2-b}}{2}}$

$\sqrt{a-\sqrt{b}} = \sqrt{\dfrac{a+\sqrt{a^2-b}}{2}}-\sqrt{\dfrac{a-\sqrt{a^2-b}}{2}}$

Proof
Let $\sqrt{a+\sqrt{b}} = \sqrt{x}+\sqrt{y}$ where $x,y$ are positive real numbers.

Squaring both sides gives:


 * $\displaystyle a+\sqrt{b} = (\sqrt{x}+\sqrt{y})^2 = x + y + 2\sqrt{xy}$

Set $x + y = a$ and $\sqrt{b} = 2\sqrt{xy}$

From $\sqrt{b} = 2\sqrt{xy}$ we get:


 * $\displaystyle \sqrt{b} = 2\sqrt{xy} \iff b = 4xy \iff xy = \dfrac{b}{4}$

By Viète's Formulas, $x$ and $y$ are solutions to the quadratic equation

This equation has solutions:


 * $\displaystyle z_{1,2} = \dfrac {a \pm \sqrt{a^2-b}}{2}$ where $a^2-b > 0$ (which is a given)

Wlog, we have:


 * $\displaystyle x= z_1 =\dfrac {a + \sqrt{a^2-b}}{2}$


 * $\displaystyle y= z_2 = \dfrac {a - \sqrt{a^2-b}}{2}$

Therefore, subsituting into $\sqrt{a+\sqrt{b}} = \sqrt{x}+\sqrt{y}$ we get:


 * $\displaystyle \sqrt{a+\sqrt{b}} = \sqrt{x}+\sqrt{y} = \sqrt{\dfrac{a+\sqrt{a^2-b}}{2}}+\sqrt{\dfrac{a-\sqrt{a^2-b}}{2}}$

which completes the proof of the first part.

For the proof of the $\sqrt{a-\sqrt{b}}$ claim, follow the same style of proof and observe that $0 < \sqrt{a-\sqrt{b}} = \sqrt{x} - \sqrt{y} \implies x > y$.

Applications
The above formulas are helpful for simplifying expressions involving square roots.


 * $\displaystyle \sqrt{2-\sqrt{3}} = \sqrt{\dfrac{2+\sqrt{2^2-3}}{2}} + \sqrt{\dfrac{2-\sqrt{2^2-3}}{2}} = \sqrt{\dfrac{3}{2}} + \sqrt{\dfrac{1}{2}} = \dfrac{\sqrt{3} + 1}{\sqrt{2}}$


 * $\displaystyle \sqrt{3-\sqrt{8}} = \sqrt{\dfrac{3+\sqrt{3^2-8}}{2}} + \sqrt{\dfrac{3-\sqrt{3^2-8}}{2}} = \sqrt{\dfrac{4}{2}} + \sqrt{\dfrac{2}{2}} = \sqrt{2} + 1$