Post Reply 
Factoring polynomial returns numeric value
07-07-2017, 05:22 PM
Post: #1
Factoring polynomial returns numeric value
I'm in the process of re-familiarizing myself with my HP Prime. I've had one for a couple of years but stopped using it because it was too difficult to see. I just bought a new one with the high contrast keys (and it's great ... thanks HP!)

I'm going over some of Eddie Shore's examples and am having some problems. I'm sure the answer I need is simple but I can't figure it out.

Eddie's blog ... https://edspi31415.blogspot.com/2016/05/...mands.html

I am attempting this example:

factor(x^2 + 6*x + 5) returns (x + 1)*(x + 5)

What I'm getting is 10.44 rather than (x + 1)*(x + 5).

I know what's going on. My 'x' variable is set to 0.8 from some previous examples I did so it seems that the Prime is evaluating (x^2 + 6*x + 5) for 'x' rather than factoring it.

What do I have to do to get a return of (x + 1)*(x + 5)?

Thanks,
Jim
Find all posts by this user
Quote this message in a reply
07-07-2017, 07:02 PM
Post: #2
RE: Factoring polynomial returns numeric value
(07-07-2017 05:22 PM)Skyblues Wrote:  I am attempting this example:

factor(x^2 + 6*x + 5) returns (x + 1)*(x + 5)

What I'm getting is 10.44 rather than (x + 1)*(x + 5).

I know what's going on. My 'x' variable is set to 0.8 from some previous examples I did so it seems that the Prime is evaluating (x^2 + 6*x + 5) for 'x' rather than factoring it.

What do I have to do to get a return of (x + 1)*(x + 5)?

There are two ways to approach this.

(1) Put your expression in single quote marks, e.g. instead of typing factor(x^2+6*x+5), type factor('x^2+6*x+5'). The quote marks tell Prime not to evaluate any variables but to treat them all as symbolic variables.

(2) purge(x) ... this removes the value from 'x' so that it will behave as a symbolic variable again. You can also use the Vars key menu, or the Memory Manager browser, to purge x; just highlight x and press the backspace key. To purge ALL your CAS variables (and reset CAS settings to their defaults) in one step, use the restart command (don't worry; it doesn't purge or reset anything else). All the CAS vars can also be deleted by highlighting "CAS Vars" in the Memory Manager and pressing the backspace key.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
07-07-2017, 10:34 PM
Post: #3
RE: Factoring polynomial returns numeric value
Thanks Joe, I appreciate your help!

Jim
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)