HP Forums
Algebraic manipulation - 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: Algebraic manipulation (/thread-12378.html)



Algebraic manipulation - 47box - 02-07-2019 08:12 PM

Hi,

How can I manipulate a algebraic expression trying to extract a used defined term.

Exemple:

(4x-12) --> I know I can factor this term. Does exists any kind of control that I can specify a term?
I would like to specif "(x-3)" --> 4.(x-3)

Another Exemple:

(3-(4/5x)-(-5) --> I would like to specify a term "(x-10)" and see it´s possible.

Does the calculator can do that? Or any alternative?

Thanks


RE: Algebraic manipulation - BruceH - 02-08-2019 01:04 AM

I don't know of a way to use a specific factor.

Alternatives:
  • Use the factors() command to get a list of the factors. You can then inspect the list to see if the one you are expecting is present.
  • Or, do a test divide by your factor, e.g. simplify((4*x-12)/(x-3))? If your divisor remains unchanged then it isn't a factor.



RE: Algebraic manipulation - Aries - 02-08-2019 09:52 AM

I think "factor()" and "simplify" will do the trick Wink
Oh … and make sure you're in the CAS "ambient" !
Best,

Aries Smile


RE: Algebraic manipulation - 47box - 02-08-2019 05:37 PM

Usually , I ´ve been using the factor and simplify command as mentioned. But I would like to specify a factor if possible... Smile
Thanks

Best,

Mario


RE: Algebraic manipulation - Eddie W. Shore - 02-09-2019 10:48 PM

Bruce,

I like your strategy the best - use the simplify(p(x)/q(x)).

The CAS program specfactor uses this strategy to factor q(x) from p(x):

Code:

#cas
specfactor(p,q):=
BEGIN
LOCAL r;
r:=simplify(p/q);
IF numer(r)==p THEN
RETURN r;
ELSE
RETURN "("+STRING(r)+")"+"*("+STRING(q)+")";
END;
END;
#end

Successful factoring returns the result as strings (to preserve the format without automatic simplification):

specfactor(4x-12,x-3) returns "(4)*(x-3)" [ 4(x-3) ]

specfactor(8-4/5*x,x-10) returns "(-0.8)*(x-10)"

specfactor(x^3 -x^2+2*x-2,x^2+2) returns "(x-1)*(x^2+2)"

Eddie