MathGroup Archive 2011

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

Search the Archive

Re: Simplifying radicals

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122219] Re: Simplifying radicals
  • From: dimitris <dimmechan at yahoo.com>
  • Date: Fri, 21 Oct 2011 06:23:54 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j7p1s8$5ko$1@smc.vnet.net>

On Oct 20, 2:49 pm, Tom De Vries <tidetable... at gmail.com> 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?
>
> TOM

Hello.

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)
 N[%]

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,
1.618033988749895}

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

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.

In[1]:=Needs["Miscellaneous`RealOnly`"]

In[2]:=
(-729)^(1/3)

Out[2]=
-9

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:
http://library.wolfram.com/infocenter/MathSource/6771/

Regards
Dimitris



  • 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