Post Reply 
Factoring polynomial returns numeric value
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
Post Reply 


Messages In This Thread
RE: Factoring polynomial returns numeric value - Joe Horn - 07-07-2017 07:02 PM



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