Derivation Verification for an Algebraic Expression

The equation $$\sqrt{a \pm \sqrt b} = \sqrt{\frac{a + \sqrt{a^2-b}}{{2}}} \pm \sqrt{\frac{a - \sqrt{a^2-b}}{{2}}} \tag{1}$$

is really two equations with proper choice of signs. What we mean by that is that each square root of a positive real has two values, one positive and one negative.

There is one square root on the left side and on the right side is the sum/difference of two square roots. But given $\,0<b<a^2\,$ positive and the positive square root on the left, then the first square root on the right is greater than the second square root. Their sum must be the same as the left square root with the $+$ sign and the difference must be the same as with the $-$ sign.

When we replace $\,b\,$ with $\,-b,\,$ equation $(1)$ becomes

$$\sqrt{a \pm \sqrt -b} = \sqrt{\frac{a + \sqrt{a^2 +b}}{{2}}} \pm \sqrt{\frac{a - \sqrt{a^2+b}}{{2}}} \tag{2}$$

which is the well known formula for the square root of a complex number. In both cases, the equations can be verified by squaring both sides and simplifying and accounting for negative square roots as needed.