Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10257

Re: Sqrt of complex number

From Richard Fateman <fateman@cs.berkeley.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Sqrt of complex number
Date 2012-05-29 09:51 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jq267j$6k3$1@smc.vnet.net> (permalink)
References <jpspgr$hdj$1@smc.vnet.net>

Show all headers | View raw


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





Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sqrt of complex number Jacare Omoplata <walkeystalkey@gmail.com> - 2012-05-27 08:44 +0000
  Re: Sqrt of complex number Helen Read <readhpr@gmail.com> - 2012-05-28 09:12 +0000
  Re: Sqrt of complex number Erik Max Francis <max@alcyone.com> - 2012-05-28 09:13 +0000
  Re: Sqrt of complex number Richard Fateman <fateman@cs.berkeley.edu> - 2012-05-29 09:51 +0000
  Re: Sqrt of complex number Andrzej Kozlowski <akozlowski@gmail.com> - 2012-05-30 08:10 +0000
    Re: Sqrt of complex number Richard Fateman <fateman@cs.berkeley.edu> - 2012-05-31 06:50 +0000
    Re: Sqrt of complex number Andrzej Kozlowski <akozlowski@gmail.com> - 2012-05-31 06:51 +0000
  Re: Sqrt of complex number Murray Eisenberg <murray@math.umass.edu> - 2012-05-30 08:15 +0000
    Re: Sqrt of complex number Richard Fateman <fateman@cs.berkeley.edu> - 2012-05-31 06:49 +0000
  Re: Sqrt of complex number danl@wolfram.com - 2012-06-01 09:22 +0000
    Re: Sqrt of complex number Richard Fateman <fateman@cs.berkeley.edu> - 2012-06-02 09:43 +0000

csiph-web