Re: Problem to evaluate cube root of a negative cube nember where a real value is expected
- To: mathgroup at smc.vnet.net
- Subject: [mg28093] Re: [mg28042] Problem to evaluate cube root of a negative cube nember where a real value is expected
- From: Tom De Vries <tdevries at shop.westworld.ca>
- Date: Fri, 30 Mar 2001 04:12:46 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Gary!!
The following function will calculate real solutions only..... hope it
helps...
cuberoot[x_] := Sign[x] Abs[x] ^ (1/3)
Tom De Vries
Alberta, Canada
> From: "Gary" <garylga at magix.com.sg>
To: mathgroup at smc.vnet.net
> Date: Thu, 29 Mar 2001 03:24:09 -0500 (EST)
> To: mathgroup at smc.vnet.net
> Subject: [mg28093] [mg28042] Problem to evaluate cube root of a negative cube nember
> where a real value is expected
>
> Hi,
>
> Does anyone know a simplier way to simplify (-8)^(1/3)=(-2) other than what
> I did below because no complex answer is expected in the solution.
>
> In[161]:=
> p=(-8)^(1/3)
> q=Abs[p]
> Level[p,3]
> r=Extract[Level[p,3],2]
> (* if p is real, then p should be as below *)
> q*r
>
> Out[161]=
> \!\(2\ \((\(-1\))\)\^\(1/3\)\)
>
> Out[162]=
> 2
>
> Out[163]=
> \!\({2, \(-1\), 1\/3, \((\(-1\))\)\^\(1/3\)}\)
>
> Out[164]=
> -1
>
> Out[165]=
> -2
>
>
> ______________________________________
> Gary Lee Guanan (garylga at magix.com.sg)
> Director - Business Development
> IQExplorers.com Pte Ltd
> Tel 874-1345/6
> ========================C/o Address============================
> Incubation Centre, School of Computing(SoC), NUS.
> S15 #01-09, 1 Science Drive 2 (along Lower Kent Ridge Road), S117543
> ===============================================================
>
>
>