# Finding square root of $-5-12i$ by formula and by De Moivre's Theorem

I was trying to obtain the square root of $-5-12i$ by the formula for square root (given below) and also by De Moivre's theorem and verify that both give the same result. But the two results are somehow not matching for this complex number. I am writing my solution below in two cases for each method:

Case - I:

As given on pg - 3 of Complex Analysis - Newman and Bak, the equation $(x+iy)^2 = a+ib$ has the solution: $x=\pm\sqrt{\frac{a+\sqrt{a^2+b^2}}{2}}$ and $y=\pm\sqrt{\frac{-a+\sqrt{a^2+b^2}}{2}}.($sign $b)$

Putting $a=-5, b=-12$ & $($sign $b) = -ve$ in the above formula for $x$ & $y$, we get that the square roots of $-5-12i$ are $2-3i$ & $-2+3i$

Case - II:

By De Moivre's theorem, we know that given $z = r(cos \theta + i sin \theta)$; its $n$th root $z_k$ is given by $z_k = r^{1/n}(cos (\frac{\theta + 2k \pi}{n}) + i sin (\frac{\theta + 2k \pi}{n}))$, where $k=0,1,...,n-1$

Here, $z=-5-12 i = r(cos \theta + i sin \theta)$. Thus, $r=13$ and $\theta = atan(\frac{-12}{-5}) = 1.176005207$ (in radian)

Hence, $z_k = \sqrt{13}(cos (\frac{\theta + 2k \pi}{2}) + i sin (\frac{\theta + 2k \pi}{2}))$, where $k=0,1$

For $k=0$, $z_0 = \sqrt{13} (cos (\frac{\theta}{2}) + i sin (\frac{\theta}{2})) = \sqrt{13} (0.8320502943 + i 0.5547001962) = 3 + 2i$

For $k=1$, $z_1=\sqrt{13} (cos (\frac{\theta + 2 \pi}{2}) + i sin (\frac{\theta + 2 \pi}{2})) = \sqrt{13} (cos (\pi + \frac{\theta}{2}) + i sin (\pi + \frac{\theta}{2})) = - \sqrt{13} (cos (\frac{\theta}{2}) + i sin (\frac{\theta}{2})) = - \sqrt{13} (0.8320502943 + i 0.5547001962) = -3 - 2i$

Here, the square roots of $-5-12i$ are $3+2i$ and $-3-2i$

I think there must be some error in the solution because the square roots are coming out to be different. Thanks...

• You need to use atan2 when computing $\theta$. You should have $\theta \approx -1.9656$. Note the quadrant that $-5-12i$ is in. – copper.hat Mar 2 '15 at 6:48
• Did you try to verify which solutions are correct? – Martin R Mar 2 '15 at 6:48
• the first solution is correct – Ritu Mar 2 '15 at 6:49
• @copper.hat I am sorry, I did not get your point. Can you explain a little... – Ritu Mar 2 '15 at 6:50
• atan is insensitive to the fact that you are in the $x<0, y<0$ quadrant, so the angle it gives is off by $\pi$. If you compute with the $\theta$ I gave above you will get the desired answer... – copper.hat Mar 2 '15 at 6:51

Toby's answer has a minor miscue. Also, in the first chapter of Bruce Palka's "An Introduction To Complex Function Theory", an easier algorithm is given.

Let $$\;z = -5 - 12i,\;$$ and let $$\alpha = \text{Arg}(z).$$ This means that $$\;\alpha \,\in (-\pi,\pi]\;$$ and $$\;z = |z|[\cos(\alpha) + i\sin(\alpha)].$$

Further, let $$\beta = \alpha/2 \Rightarrow \cos(\beta) \geq 0 \;\text{and}\; \sin(\beta) < 0 \Leftrightarrow \sin(\alpha) < 0.$$

Then the principal $$\sqrt{z} = +\sqrt{|z|}[\cos(\beta) + i\sin(\beta)],\;$$ while the other square root will be $$-1 \times \;$$ the principal square root.

In this case, $$|z| = 13, \cos(\alpha) = -5/13, \;\text{and}\; \sin(\alpha) < 0.\;$$ Therefore, by a half-angle formula, $$\cos\beta = \sqrt{\frac{1 - 5/13}{2}} = \frac{2}{\sqrt{13}}.\;$$ Further, $$\;\sin(\beta) < 0 \Rightarrow \sin(\beta) = \frac{-3}{\sqrt{13}}.$$

Thus, the principal sqrt is $$\;\sqrt{13}[\frac{2}{\sqrt{13}} + i\frac{-3}{\sqrt{13}}] \;=\; (2 - 3i).$$

There is a way without using $\arctan$.

Let the square root be $a+bi$. Then, $a^2+2abi-b^2 = -5-12i$, so $a^2-b^2 = -5 \text{(eq. 1)}$ and $2abi = -12i \ \text{(eq. 2)}; ab = -6 \ \text{(eq. 3)}$.

From equation $3$, $a = -\frac{6}{b}$. Substituting into equation $1$, $(-\frac{6}{b})^2-b^2+5=0$, and so:

$$\frac{36}{b^2} - b^2 + 5 = 0$$ $$\Rightarrow b^4 - 5b^2 - 36 = 0$$ $$\Rightarrow (b^2-9)(b^2+4) = 0$$ $$b^2 = 9; b^2 = -4$$ $$b = ±3$$

Substiuting $b = 3$ into equation $1$, we have $a = 2$; and substituting $b = -3$ we also get $a = 2$. Therefore, the two solutions are $2 + 3i$ and $2 - 3i$.