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


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

Re: Sqrt of complex number

From Erik Max Francis <max@alcyone.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Sqrt of complex number
Date 2012-05-28 09:13 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jpvfjv$q72$1@smc.vnet.net> (permalink)
References <jpspgr$hdj$1@smc.vnet.net>

Show all headers | View raw


On 05/27/2012 01:44 AM, Jacare Omoplata wrote:
> 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?

It's the principal square root.  Does this result surprise you, after 
all, even though -2 squared is also 4?

In[3]:= Sqrt[4]

Out[3]= 2

If you want to actually ask for _all_ the possible answers, use Solve:

In[1]:= Solve[x^2 == 3 - 4 I, x]

Out[1]= {{x -> -2 + I}, {x -> 2 - I}}

-- 
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Jabber erikmaxfrancis
   The side that stays within its fortifications is beaten.
    -- Napoleon Bonaparte

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