The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

HP 50G Cube Root of Negative
Message #1 Posted by Hal Bitton in Boise on 14 Oct 2008, 8:56 p.m.

Hi all,
Is there any way to make the 50G return the real cube root of a negative number? (As opposed to one of the conjugates). I.E., Key in -8 ENTER 3 1/X Y^X and 2 at angle 60 is returned. Is there any way to force it to return -2? I've deselected allow complex in the CAS settings to no avail. Thanks, Hal

      
Re: HP 50G Cube Root of Negative
Message #2 Posted by Karl Schneider on 15 Oct 2008, 12:51 a.m.,
in response to message #1 by Hal Bitton in Boise

Hal --

Jeremy Smith showed me the trick for this same problem on his HP-50g at HHC 2008 last month: To obtain the real-valued cube root of -8, turn on "Approx" mode under CAS ("Complex" mode can be on or off.)

How 'bout that convoluted answer the HP-49G and HP-50g give in exact mode? To wit:

(-8)^(1/3) = 2*exp((pi/3)*exp(i*pi/2))

Of course, this is simply

(-8)^(1/3) = 1 + i*sqrt(3)

-- KS

            
Re: HP 50G Cube Root of Negative
Message #3 Posted by Hal Bitton in Boise on 15 Oct 2008, 2:07 a.m.,
in response to message #2 by Karl Schneider

Hi Karl, thanks for your response,

Indeed, approx mode gives the real valued cube root when using the xth root of y key. If, however, I raise -8 to the 1/3 power using the y^x key, the complex root in quadrant 1 is returned (2 at angle 60). I suppose this is a non issue, as I don't mind using the xth root key. But this gets interesting now...
Graph the function cube root x, using the xth root key, and it graphs the real root for x values less than zero, as one would expect. If, however, I try to graph cube root x squared, (ie, x^(2/3) which should reflect the negative side of the graph about the x axis, I actually get a blank graph to the left of the y axis. This would lead me to beleive that the calculator is now using one of the complex cube roots, and squaring it, which of course will not graph on a real numbered y-axis. I did finally get this function to graph by forcing it to square the x value first, then take the cube root by composing the function algebraically and using parenthesis thusly; (x^2)^(2/3).
Again, no big deal, but it seems inconsistant to me that the real cube root would be used for cube root x, but not for cube root x squared when graphing.
Best regards, Hal

                  
Re: HP 50G Cube Root of Negative
Message #4 Posted by V-PN on 15 Oct 2008, 3:16 a.m.,
in response to message #3 by Hal Bitton in Boise

(x^2)^(2/3) => (x^2)^(1/3)

                        
Re: HP 50G Cube Root of Negative
Message #5 Posted by Hal Bitton in Boise on 15 Oct 2008, 10:57 a.m.,
in response to message #4 by V-PN

Quote:
(x^2)^(2/3) => (x^2)^(1/3)
You're right, thank you...I meant to type in (x^2)^(1/3)

sorry about that
hal

      
Re: HP 50G Cube Root of Negative
Message #6 Posted by C.Ret on 15 Oct 2008, 5:46 p.m.,
in response to message #1 by Hal Bitton in Boise

Quote:
Is there any way to make the 50G return the real cube root of a negative number?

Hi,

I have no HP-50G, only a HP-28S. As your 50g, my 28S returns one of the two conjugate solution when keying 8 CHS 3 INV ^ ---> (1.0000,1.7324)

A first way to get only the real root is to use the SOLVER menu or the ROOT function:

'y^3=-8' 'y' 0 ROOT ---> 2.000

A short program may spare same keystrokes:

\<< 'y' DUP 3 ^ ROT = SWAP 0 ROOT \>> 'RCRt' STO

Stack: 1: -8 [RCRt] ----> 1: -2.0000 1: -27 [RCRt] ----> 1: -3.0000 1: 125 [RCRt] ----> 1: 5.0000 1: -125 [RCRt] ----> 1: -5.0000

This little code determine the real cube root of any positive, null or negative real number at stack level 1:.

Any complex number may lead to an "Bad Guess(es)" error stop, as ROOT may only handle real number.

A second easy way to get the real cubic root may be using absolute value of the negative number to avoid switching to complex solutions domain : 8^(1/3) returns 2.000 which may be sign changed in -2.0000

\<< DUP SIGN SWAP ABS 3 INV ^ * \>> 'CRt' STO

Stacks: 1: -8 [CRt] ----> 1: -2.0000 1: -27 [CRt] ----> 1: -3.0000 1: 125 [CRt] ----> 1: 5.0000 1: -125 [CRt] ----> 1: -5.0000

This second version is faster than the first one. Giving a complex number as entry returns a complex number

Edited: 15 Oct 2008, 6:02 p.m.

      
Re: HP 50G Cube Root of Negative
Message #7 Posted by Antonio Maschio (Italy) on 16 Oct 2008, 5:51 a.m.,
in response to message #1 by Hal Bitton in Boise

Something curious.

Settings: DEC C= 'X' (but DEC R~ is the same)

If I type

8 
+/-
ENTER
3 
xRooty (RS Root) 

I get 2*(1+i*sqr(3))/2
[note: in Real Mode I'm asked to turn to complex mode)

If I type

8
. 
+/- 
ENTER
3 
xRooty 

I get -2
[Note: I only added a decimal point with no decimals after the number].

This works in all the viewing options (STD, FIX at least).

My 2c.

-- Antonio

            
Re: HP 50G Cube Root of Negative
Message #8 Posted by Hal Bitton in Boise on 16 Oct 2008, 3:53 p.m.,
in response to message #7 by Antonio Maschio (Italy)

Thanks Antonio and C.Ret for your inputs.

Putting a decimal point after the -8. forces a solution in approx mode which returns the real valued cube root (only if keyed in as -8.00 3 xrooty). If keyed in as 8.00 3 1/x y^x, it returns the cube root in quadrant 1 (2 at angle 60 degrees). This all started when I was grappling with the issue of plotting the function x^(2/3), and trying to figure out why there was no plot for negative x values. I have since arrived at the conclusion that the only way to get the calculator to plot an output for negative domain values of this function is to force (and I mean force!) the machine to execute the square first, then take the cube root by keying the function in as ((8^2)^1/3), which must be done algebraically (horrors!). Only then will this function plot for x values less than zero. It seems the TI89 returns the real valued cube root by default, so such draconian measures are not nessessary when plotting that function on that machine (it can simply be keyed in as -8^(2/3). My only consolation would be that if we wanted a complex cube root returned for a particular function, the roles would be reversed (maybe).
Thanks and best regards, Hal

                  
Re: HP 50G Cube Root of Negative
Message #9 Posted by V-PN on 16 Oct 2008, 6:52 p.m.,
in response to message #8 by Hal Bitton in Boise

[1 0 0 3] PROOT


[ Return to Index | Top of Index ]

Go back to the main exhibit hall