MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Sqrt of complex number

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126662] Re: Sqrt of complex number
  • From: Richard Fateman <fateman at cs.berkeley.edu>
  • Date: Tue, 29 May 2012 05:48:54 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jpspgr$hdj$1@smc.vnet.net>

On 5/27/2012 1:44 AM, Jacare Omoplata wrote:
> Hi,
>
> When I try to find the square root of of a complex number, I get only one answer.
>
> In[1]:= Sqrt[3-4 I]
> Out[1]= 2-I
>
> But -2+I is an answer as well.
>
> In[2]:= (-2+I)^2
> Out[2]= 3-4 I
>
> Why does Mathematica give the first answer and not the second?

Does it choose the answer with the positive real number?

Is there any way I can get both answers?

  Or do I just have to remember that the negative of the given answer is 
also an answer?
>
> Thanks.
>

................

You have been given a bunch of answers, each of which is correct but 
unresponsive to your concern.

Mathematica gives the answer it gives because it was programmed that 
way, a way that lacks generality, is incomplete and arguably incorrect. 
  I think it does this probably because it copied earlier systems that 
had similar errors.  If it was addressed specifically in the design, 
then the decision was made to provide a mathematically incomplete 
solution, in the hope that nobody would either not notice or not care.

However, you noticed and appear to care.

What you ask for is an expression that includes all answers: the 
algebraic solution to the equation x^2-(3-4 I)=0.

Notice that you can create the set of the 2 roots of a quadratic, that 
is, both square roots, by typing this.


Table[Root[#^2 - (3 - 4 I)&, n], {n, 1, 2}]

but this is a list, not "an algebraic number".

If you want to manipulate "an arbitrary root", that is -2+I OR 2-I
without specifying which one, it seems that Mathematica could provide 
this facility by allowing you to type, for a symbol n,

y = Root[#^2- (3-4I)&,n]

(actually,  Root[x^2-3+4I,n]  might do just a well and be less obscure).

For example,  we would know the unambiguous single value for y^2, and
we could perhaps compute  y*Conjugate[y].

Unfortunately, Mathematica's designers/programmers do not allow you to 
write Root[x^2-3+4I,n]  unless n is a specific integer, namely 1 or 2.

Conclusion: Mathematica has a notation for what you want, and it can in 
fact do a few things with Root[], but it is defective in handling 
Root[polynomial,n] for symbolic n.  I would call it a mis-feature. Maybe 
it will be fixed, which would not be easy. (while you are at it, 
consider Root[Exp[I x]-1,n] )

Doing it right would require considerable effort, both to figure out 
what the right features should be, and to implement them.

RJF








  • Prev by Date: Re: Print TraditionalForm
  • Next by Date: Parallelize and Array access
  • Previous by thread: Re: Sqrt of complex number
  • Next by thread: Re: Sqrt of complex number