# How to calculate this imaginary part of a complex square root?

The calculation of the square root of a complex number $a + ib$ involves solving the equation

$$(x + iy)^2 = a + ib$$

So far so good. One obtains the equations

$$4x^4 -4ax^2 - b^2 = 0, y = b/2x$$

and using the quadratic formula for $x^2$ one gets

$$x = \pm \sqrt{{a + \sqrt{a^2 + b^2} \over 2}}$$

I am supposed to get

$$y = \pm \sqrt{- a + \sqrt{a^2 + b^2} \over 2} \cdot \text{sgn}(b)$$

but if I substitute $x$ into $y$ I get

$$y = {b\over 2x} = \pm {b \sqrt{2} \over 2\sqrt{a + \sqrt{a^2 + b^2}}}$$

What am I doing wrong?

• Possible Duplicate of THIS and THIS. – Mark Viola Aug 31 '16 at 19:55

First off, up to a sign (reflected by that $\mbox{sgn }(b)$ factor), the two expressions are equal. You can see this if you multiply the expression you got by $$\frac{\sqrt{\sqrt{a^2+b^2}-a}}{\sqrt{\sqrt{a^2+b^2}-a}}$$ to get $$y = \pm \frac{b}{\sqrt{b^2}} \frac{\sqrt{\sqrt{a^2+b^2}-a}}{\sqrt{2}}$$ And of course, since all use of the square root symbol implies the positive square root, $$\frac{b}{\sqrt{b^2}} = \mbox{sgn }(b)$$

1. When $\text{a}\space\wedge\space\text{b}\in\mathbb{C}$: $$\text{a}=\text{b}^2=\left(\Re[\text{b}]+\Im[\text{b}]i\right)^2=\Re^2[\text{b}]-\Im^2[\text{b}]+2\Re[\text{b}]\Im[\text{b}i]$$
2. Solving $x$: $$y=\frac{\text{b}}{2x}\Longleftrightarrow\text{b}=2xy\Longleftrightarrow x=\frac{\text{b}}{2y}$$
3. Solving $x$ by substituting $y=x^2$: $$4x^4-4\text{a}x^2-\text{b}^2=0\Longleftrightarrow y=\frac{\text{a}\pm\sqrt{\text{a}^2+\text{b}^2}}{2}\Longleftrightarrow x=\color{red}{\pm}\frac{\sqrt{\text{a}\color{red}{\pm}\sqrt{\text{a}^2+\text{b}^2}}}{\sqrt{2}}$$
And for $\text{sgn}(\text{z})$, when $\text{z}\in\mathbb{C}$ (and $\text{z}\ne0$):
$$\text{sgn}(\text{z})=\frac{\text{z}}{\sqrt{\text{z}\cdot\overline{\text{z}}}}=\frac{\text{z}}{\sqrt{|\text{z}|^2}}=\frac{\text{z}}{|\text{z}|}$$