Re: branch of (-1)^(1/3)
- To: mathgroup at smc.vnet.net
- Subject: [mg94443] Re: branch of (-1)^(1/3)
- From: dimitris <dimmechan at yahoo.com>
- Date: Sun, 14 Dec 2008 07:33:06 -0500 (EST)
- References: <ghtjcj$r7f$1@smc.vnet.net>
On 12 =C4=E5=EA, 13:53, "slawek" <hu... at site.pl> wrote: > Is a simple way to choose the branch of (-1)^(1/3) ? > > Mathematica gives a (correct) non-real answer. It is ok, but I need the (= -1) > as the output when I input (1)^(1/3) because I know that it is a solut= ion > of real-valued problem. > > Is any "standard way" to pick up a correct (i.e. arbitrary) root of > (-1)^(1/n) instead the default? > > slawek Say that exp is one an expression wrt x then you could something like the following, Solve[x^3 == 1, x] exp /. %[[1]] For n instead of 3 just change the exponent 3 above. Another way is as follows, In[14]:= Unprotect[Power]; In[15]:= FullForm[(-1)^(Rational[1, n_])] := 1 In[16]:= Protect[Power]; In[17]:= (-1)^(1/3) Out[17]= 1 Note that in this way it might be side effects. In[18]:= Solve[x^3 == 1, x] Out[18]= {{x -> -1}, {x -> 1}, {x -> (-1)^(2/3)}} Instead of In[19]:= Quit[] In[1]:= Solve[x^3 == 1, x] Out[1]= {{x -> 1}, {x -> -(-1)^(1/3)}, {x -> (-1)^(2/3)}} which is the default. This may cause conflicts to some built in functions. Dimitris