The Museum of HP Calculators

HP Forum Archive 18

 Cube root of negative number (HP 50G)Message #1 Posted by macky on 17 Sept 2008, 10:54 p.m. I have an interesting dilemma, my HP 50G doesn't seem to like to return the 'real' portion of negative cube roots when in exact mode. Exact mode is helpful since it returns fractions, so I'd like to not have to switch modes or jump through hoops just to get the cube root. In RPN mode, if I use the command 'XROOT(3,-125)' (with single quotes) and ->NUM, I get the answer I'm looking for, -5. If I write the equation in Equation Writer (3 radical -125), it evaluates properly both in the EQW and on the stack. However if I enter 125 +/- 3 XROOT , I get a complex equation, which simplifies to two roots. Neither of which are the answer I want. Can someone explain in detail what's going on here? Also how can I either fix this or make it more efficient to get the real odd root of a negative number?

 Re: Cube root of negative number (HP 50G)Message #2 Posted by V-PN on 18 Sept 2008, 2:56 a.m.,in response to message #1 by macky You remember your math, right You have just described the way your calc works to get all those answers: a complex conjucate and a ral root. May you want to try PROOT command? You'll get all the roots at once, try it: [1 0 0 -125] PROOT

 Re: Cube root of negative number (HP 50G)Message #3 Posted by Hal Bitton in Boise on 18 Sept 2008, 3:37 a.m.,in response to message #1 by macky Hi Macky, Of course you realize that according to DeMoivre's theorum, there are 3 cube roots of a negative number (or any number, for that matter), which can be nicely represented as complex numbers in polar form, spaced 120 degrees apart. If the original radicand was real, one of the cube roots will also be real, with that real root being positive (lying at 0 degrees) for a positive real radicand, and negative (lying at 180 degrees) for a negative real radicand. The three cube roots of -125 would therefor be: 5 at 60 degrees 5 at 180 degrees (or -5) 5 at 300 degrees If in rectangular mode, these results would display as: (2.5, 4.33) (-5, 0) (2.5, -4.33) It seems the calculator is under no obligation to return the real root when such a query is put to it, but rather, it returns the first root going CCW from the origin, which is 5 at 60 degrees for the above problem. All 4 of my HP's with complex number capability (50G, 48GX, 42S, 15C) gave me this result. Interestingly, I was unable to get -5 as a displayed result at any time. I wrote a short RPL program for my 50G a few months back that will return all the nth roots of any number (real or complex). I would be glad to post it if you think you may find it useful. Just let me know. Hope this helps, Best regards, Hal

 Re: Cube root of negative number (HP 50G)Message #4 Posted by Walter B on 18 Sept 2008, 6:06 a.m.,in response to message #3 by Hal Bitton in Boise Quote: All 4 of my HP's with complex number capability (50G, 48GX, 42S, 15C) gave me this result. Interestingly, I was unable to get -5 as a displayed result at any time. The same also holds for Free42. BTW, when inverting this cube root, the resulting imaginary part on Free42 is much (some E12) smaller than on the original 42S.

Go back to the main exhibit hall