HP Forums

Full Version: How to expand (x-1.95)(x-4)(x+7.98) in the Prime?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I'm having a problem expanding expressions involving decimal numbers.

I type the expression (in CAS) then I put to simplify, but it doesn't. It returns the same expression, but if I do with natural numbers it does expand.

For example, for (x-1.95)(x-4)(x+7.98) it should return x^3+2.03 x^2-39.681 x+62.244, but it doesn't, it returns the same input expression.

But for example, if I type (x-1)(x-4)(x+7) and put to simlify, it does return the expanded form x^3+2 x^2-31 x+28

Does anyone know how to overcome this?

Thanks a lot!
Try:

normal((x-1.95)*(x-4)*(x+7.98)) --> x^3+2.03*x^2-39.681*x+62.244
normal((x-1)*(x-4)*(x+7)) --> x^3+2*x^2-31*x+28

-road
Did you try:

expand((x-1.95)*(x-4)*(x+7.98)) ==> x^3+2.03*x^2-39.681*x+62.244
expand((x-1)*(x-4)*(x+7)) ==> x^3+2*x^2-31*x+28

-Dale-
(04-24-2016 03:42 PM)bigjohnson Wrote: [ -> ]Hey guys, I'm having a problem expanding expressions involving decimal numbers.

I type the expression (in CAS) then I put to simplify, but it doesn't. It returns the same expression, but if I do with natural numbers it does expand.

For example, for (x-1.95)(x-4)(x+7.98) it should return x^3+2.03 x^2-39.681 x+62.244, but it doesn't, it returns the same input expression.

But for example, if I type (x-1)(x-4)(x+7) and put to simlify, it does return the expanded form x^3+2 x^2-31 x+28

Does anyone know how to overcome this?

Thanks a lot!

If you use expand() as per your subject line you get the result you want.
I.e. expand((x-1.95)*(x-4)*(x+7.98)) -> x^3+2.03 x^2-39.681 x+62.244

Cheers, Terje
Reference URL's