Relation between signs of imaginary parts of $(x+iy)$ and $\sqrt{x+iy}$

You have $$\begin{align} x^2+y^2 &= \sqrt{a^2+b^2} \tag{1}\\ x^2-y^2 &= a\tag{2} \end{align}$$ where (2) is one of the two original equations of the system, and (1) is the new one they arrived to.

Summing (1) and (2) and dividing by two, you get $$ x^2 = \frac{1}{2}\left(a+\sqrt{a^2+b^2}\right) $$ Substracting (2) from (1) and dividing by two, you get $$ y^2 = \frac{1}{2}\left(-a+\sqrt{a^2+b^2}\right). $$


Earlier it is written that $$x^2-y^2=a$$ So since $$x^2+y^2=\sqrt{a^2+b^2}$$ It follows that $$2x^2=a+\sqrt{a^2+b^2}$$ Hope that clears things up.


I didn't see where your question concerning the appearance of $\text{sgn}(b)$ was addressed.

The sign of the two solutions $x = +/-$ ... and $y = +/-$ ... can be chosen independently. BUT $2xy = b$, so you must choose either $(x>0, y<0)$ or $(x<0, y>0)$. The factor of $\text{sgn}(b)$ takes care of that. With it the two solutions are now properly given by the overall $+/-$ factor in front of the expression for $x+iy$.