Originally Posted by
Failure You don't get a unique answer to this:
a)
where
So, basically you have the two answers
and
Therefore, writing an equality sign
seems rather problematic. Rather, we would want to say that the equation
has two solutions,
and
.
b) Just use
for the above two solutions
.
a)Almost every number has two distinct square roots. But conventionally denotes the positive solution to . So the usual convention for square roots of complex numbers is to say that is the square root with a positive real part. If x is real and negative then is the root with positive imaginary part. This means there is a branch cut along the negative real axis.
b) In fact you can find find square roots without resorting to trigonometry. The following pseudo-code, computes the square root (x,y) of the complex number (u,v)
Code:
if (u > 0) then
x = sqrt((u+sqrt(u*u+v*v))/2)
y = v/(2*x)
else if (u < 0) then
y = sign(v)*sqrt((-u+sqrt(u*u+v*v))/2)
x = v/(2*y)
else
x = sqrt(abs(v)/2)
if (v > 0)
y = x
else
y = -x
The point of testing the sign of u is to minimise round-off error.