MathGroup Archive 2003

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

Search the Archive

Re: nth roots of complex numbers


In article <b10ddh$mou$1 at smc.vnet.net>,
 "Zachary Turner" <_NOzturner0826SPAM_ at hotmail.com> wrote:

> Apparently Mathematica randomly returns roots a root of a complex number.
> Is there a way I can write my own function that will return a set consisting
> of all n roots of a given complex number.  For example, Root[z,n] = {a set
> consisting of n elements}

Actually Root is a built-in object -- and it can be used to do what you 
want. 

  In[1]:= root[n_][z_] := Table[Root[#1^n - z & , k], {k, n}]

  In[2]:= root[4][1]
  Out[2]= {-1, 1, -I, I}

  In[3]:= root[4][1 + I]
  Out[3]= {Root[#1^8 - 2*#1^4 + 2 &, 1], Root[#1^8 - 2*#1^4 + 2 &, 4], 
   Root[#1^8 - 2*#1^4 + 2 &, 5],   Root[#1^8 - 2*#1^4 + 2 &, 8]}

  In[4]:=N[%]
  Out[4]={-1.0695539323639858 - 0.21274750472674303*I,      
          -0.21274750472674303 + 1.0695539323639858*I,   
           0.21274750472674303 - 1.0695539323639858*I,   
           1.0695539323639858 + 0.21274750472674303*I}

Cheers,
Paul



  • Prev by Date: Re: Re: Getting rid of the symbol -> after finding the root
  • Next by Date: RE: Limits: Is there something I'm missing Here?
  • Previous by thread: Signals and Systems package
  • Next by thread: webMathematica: ClassNotFoundException: org.apache.tomcat.facade.HttpServletRequestFacade