Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5752

Re: Simplifying radicals

From dimitris <dimmechan@yahoo.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Simplifying radicals
Date 2011-10-21 10:29 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j7rhiq$hea$1@smc.vnet.net> (permalink)
References <j7p1s8$5ko$1@smc.vnet.net>

Show all headers | View raw


On Oct 20, 2:49 pm, Tom De Vries <tidetable...@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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Simplifying radicals Tom De Vries <tidetabletom@gmail.com> - 2011-10-20 11:49 +0000
  Re: Simplifying radicals "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-10-21 10:25 +0000
  Re: Simplifying radicals dimitris <dimmechan@yahoo.com> - 2011-10-21 10:29 +0000
  Re: Simplifying radicals dimitris <dimmechan@yahoo.com> - 2011-10-22 10:15 +0000
  Re: Simplifying radicals Ray Koopman <koopman@sfu.ca> - 2011-10-23 10:35 +0000
    Re: Simplifying radicals Tom <tidetabletom@gmail.com> - 2011-10-24 09:19 +0000

csiph-web