# Square root of complex numbers

This is a pretty simple issue with Mathematica but I could not find any previous discussion on this topic. The issue arises when we have fractions as indices of complex numbers. For e.g. Let's say we try to find the square root of the complex number $(8-x +6i)$.

Now, from basic complex number algebra, we know that the real part of the $\sqrt{(8-x +6i)}$ is aperiodic. In fact, Real part of the square root is $\pm\sqrt{0.5((8-P)+\sqrt{ {(8-P)}^2 + 6^2 })}$, which is aperiodic.

expr[x_] = ((8 - x) - 6 i)^(0.5)
expr1[x_] = expr[x] // Rationalize[#, 0] & // Re //
ComplexExpand[#, TargetFunctions -> {Re, Im}] & // FullSimplify


The output of the expr1[x] is given in this weird form: (36 + (-8 + x)^2)^(1/4) Cos[1/2 ArcTan[8 - x, -6]]. More importantly, this looks like a perioidic function.

This becomes an even bigger issue when the indices of the complex number is something like {1/4,1/3,7/3,etc..}.

As an example, I give a complex number raised to 19/3.

expr8[x_] = (0.0133707 -
0.053536 I)/((0.905625 - 0.375 I) + (0. + 1.5 I) x)^(19/3)
expr9[x_] =
expr8[x] // Rationalize[#, 0] & // Re //
ComplexExpand[#, TargetFunctions -> {Re, Im}] & // FullSimplify

(46976204800000 5^(
2/3) (19101 Cos[19/3 ArcTan[200/483 (-1 + 4 x)]] -
76480 Sin[19/3 ArcTan[200/483 (-1 + 4 x)]]))/(729 3^(
1/3) (273289 + 320000 x (-1 + 2 x))^(19/6))


Plotting the real part,i.e. expr9[x] gives me something like this.

I think this happens because when I want to compute the real part of ${(r e^{(i\theta)})^{1/k}}$, Mathematica gives me something like $r^{\frac{1}{k}}cos(\frac{\theta}{k})$. Clear this output is periodic and can have -ve values. Is there a way to specify to Mathematica give me only the positive roots at each $x$?

The ArcTan part is not weird. And the real part is aperiodic.

I am not giving a full answer, because I don't use Mathematica. but I will answer the "aperiodic or periodic formula" part.

A complex number can always be represented in the polar form: R*(cosθ+isinθ).

Let's say Z1 = (8-x) + 6i = R1*(cosθ+isinθ), where R1 = sqrt((8-x)^2+6^2)

Suppose your target number (the square root) is Z2 = R2*(cosα+isinα).

we have (R2*(cosα+isinα))^2 = R2^2*(cosα+isinα)^2

According to De Moivre's formula, (cosα+isinα)^2 = cos2α+isin2α

Because Z2 is the square root of Z1, now we have R2^2*(cos2α+isin2α) = R1*(cosθ+isinθ)

It's easy to get R1 = R2^2, and θ = 2α

So, how to solve this formula ?

R2 = sqrt(R1) = sqrt(sqrt((8-x)^2+6^2)) = ((8-x)^2+6^2)^(1/4)

θ = arctan(6/(8-x))

thus α = θ/2 = (1/2)*arctan(6/(8-x))

Finally, the real part of Z2 (the square root) is:

R2 * cosα = ((8-x)^2+6^2)^(1/4) * cos((1/2)*arctan(6/(8-x)))

TL;DR:

So, it is a result of an aperiodic function times a "looks like periodic" function (in fact, arctan is not periodic), therefore, it is aperiodic.

In fact, I think a link of De Moivre's formula is enough to explain the arctan part. And in that case, it would be better if I can give the link in the comments for brevity, instead of typing this long answer. But I don't have 50 reputation to do that.