MathGroup Archive 2011

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

Search the Archive

Re: Simplifying radicals

On Oct 20, 2:49 pm, Tom De Vries <tidetable... at> wrote:
> Hi,  I'm working with some introductory topics in radicals.
> I know that Mathematica assumes things about the domain used in
> problems,  so the principal cube root of a negative number will be
> complex... or something like that..
> I'm way down at the lower high school level simply working with cube
> roots of negative numbers and wanting a negative number result.
> I know there are ways of using assumptions and solving over the reals, etc.
> Is there any EASY way I can simply ask for the cube root of -729 and get -9?


In[1]:=mycuberoot[x_] := Block[{w}, w = w /. Solve[w^3 == 1][[3]]=
If[Re[x] < 0, w*x^(1/3), x^(1/3)]]

In[2]:= mycuberoot[-729]
Out[2]= -9

A more advanced example:

In[17]:= {2 - Sqrt[5], 2 + Sqrt[5]}^(1/3)

Out[17]= {(2 - Sqrt[5])^(1/3), (2 + Sqrt[5])^(1/3)}  (*Mathematica by
her defaults evaluates (2 - Sqrt[5])^(1/3) to be a complex number*)
Out[18]= {0.30901699437494756 + 0.535233134659635*I,

In[19]:= mycuberoot /@ {2 - Sqrt[5], 2 + Sqrt[5]}

Out[19]= {(-1)^(2/3)*(2 - Sqrt[5])^(1/3), (2 + Sqrt[5])^(1/3)}
Out[20]= {-0.618033988749895, 1.618033988749895}

For versions up to 5.2 you can also load the package RealOnly.




Keep in mind that perhaps will be some conflicts with built in
functions like Simplify.

For more recent versions the package is not available anymore.
Nevertheless you can still download it from the following link:


  • Prev by Date: Re: Problem with "Which"
  • Next by Date: Re: Problem with "Which"
  • Previous by thread: Re: Simplifying radicals
  • Next by thread: Re: Simplifying radicals