HP Forums
Factoring in CAS - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Factoring in CAS (/thread-20851.html)



Factoring in CAS - ktate749 - 11-16-2023 07:08 PM

Just learning to use the calculator but I keep being disappointed with what the help button or the user's manual says should happen and what actually happens. The latest problem concerns simple factoring of a polynomial. Both the user manual and the help button say that in CAS mode for factor(x^4-1) I should get as an answer (x-1)*(x+2)*(x^2+1). What I actually get is a message that says "Run ifactor(-1) for integer factorization". Hitting Enter again shows the input function and an answer of -1. If I use the ifactor function from the Integer menu I get as an answer -1.
Using my own example x^2+5*x+6 knowing the factors are (x+2)*(x+3) I get the same message but with "ifactor(6)" in it and an answer of 6. If I run the ifactor function the answer is given as 2*3. This is very different from what I'm led to expect. Does anyone else have these same problems?


RE: Factoring in CAS - Valentin Albillo - 11-17-2023 03:21 AM

.
Hi,

Can't answer your question as I'd never consider buying a Prime, but there's an error in what you say, I quote:
    "for factor(x^4-1) I should get as an answer (x-1)*(x+2)*(x^2+1)."
which is wrong, that 2 should be 1.

V.


RE: Factoring in CAS - Brian Zilli - 11-17-2023 03:30 AM

It sounds like you may have a value stored in the x variable, so when you factor, the CAS plugs that in first and then complains that it isn't a polynomial.

If you press the [Vars] key, then the "CAS" soft-menu key at the bottom of the screen, Then "All", it will show a list of variables you've assigned.

You can either hit the backspace/delete key with x selected in that menu, or run the command purge(x) to remove the assignment.

Alternatively, if you want to keep what you have stored in x, you could run the factor command with another variable.


RE: Factoring in CAS - ktate749 - 11-17-2023 09:42 PM

Correct you are Valentin. That was a misprint.

Brian, there is no soft CAS key at the bottom of the screen when I hit the Vars key.


RE: Factoring in CAS - ktate749 - 11-17-2023 09:47 PM

Brian,
I used "b" as a variable and sure enough the correct answer appears. Thanks a million.
It looks like I do have a value stored in "x". All I have to do is find what I have stored in the various variables and clear them.

Thanks,
Kurt Tate


RE: Factoring in CAS - ktate749 - 11-17-2023 10:15 PM

When I try to "purge(x)" I get the message "No such variable x".
But if I try to use x as a variable in a function it acts as if x=0.


RE: Factoring in CAS - cdmackay - 11-17-2023 11:16 PM

see a similar answer of mine here, which might help:

https://www.hpmuseum.org/forum/thread-20761-post-180423.html#pid180423