Re: Mathematica strange behaviour finding a cubic root
- To: mathgroup at smc.vnet.net
- Subject: [mg129120] Re: Mathematica strange behaviour finding a cubic root
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Mon, 17 Dec 2012 02:53:26 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <20121216060645.D7C256924@smc.vnet.net>
The possibly unexpected results your seeing are because, by definition, Mathematica gives the _principal_ roots with such fractional powers. In particular, a power b^(m/n) with b < 0, m an even positive integer, and n an odd positive integer will be non-real complex. To force Mathematica to return the real cube-roots, etc., there are several approaches. The simplest, now with Mathematica 9, is to use Surd: Surd[-1/2, 3]^2 2^(-2/3) (where I'm showing the InputForm of the output). On Dec 16, 2012, at 1:06 AM, sergio_r at mail.com wrote: > > How can I make Mathematica provides the same answer for > (-1/2)^(2/3) = ((-1/2)^2)^(1/3) ? > > What follows is a Mathematica session: > > In[1]:= (-1/2)^(2/3) > > 1 2/3 > Out[1]= (-(-)) > 2 > > In[2]:= N[%] > > Out[2]= -0.31498 + 0.545562 I > > In[3]:= ((-1/2)^2)^(1/3) > > -(2/3) > Out[3]= 2 > > In[4]:= N[%] > > Out[4]= 0.629961 > > > Sergio --- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2838 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Mathematica strange behaviour finding a cubic root
- From: sergio_r@mail.com
- Mathematica strange behaviour finding a cubic root