The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP Prime polynomial long division
Message #1 Posted by bluesun08 on 29 Oct 2013, 8:11 a.m.

If i calculate (x^3+x):(x^2+3) manually via polynomial long division the result is x-(2x)/(x^2+3)
How can i get this result with the HP Prime?

      
Re: HP Prime polynomial long division
Message #2 Posted by Eddie W. Shore on 29 Oct 2013, 9:02 a.m.,
in response to message #1 by bluesun08

Quote:
If i calculate (x^3+x):(x^2+3) manually via polynomial long division the result is x-(2x)/(x^2+3)
How can i get this result with the HP Prime?

In CAS mode, use partfrac. Access: Toolbox, CAS, 1. Algebra, 6. Partial Fraction

Hope that helps.

            
Re: HP Prime polynomial long division
Message #3 Posted by bluesun08 on 29 Oct 2013, 9:16 a.m.,
in response to message #2 by Eddie W. Shore

Great, thank you!

            
Re: HP Prime polynomial long division
Message #4 Posted by bluesun08 on 29 Oct 2013, 9:26 a.m.,
in response to message #2 by Eddie W. Shore

A further question: What is the difference between partfrac and cpartfrac?

                  
Re: HP Prime polynomial long division
Message #5 Posted by Eddie W. Shore on 29 Oct 2013, 9:30 a.m.,
in response to message #4 by bluesun08

Quote:
A further question: What is the difference between partfrac and cpartfrac?

cpartfrac is the complex counterpart of partfrac

Example:

cpartfrac((x^3+x)/(x^2+3)) returns x - 1/(x+i*sqrt(3)) - 1/(x-i*sqrt(3))

                        
Re: HP Prime polynomial long division
Message #6 Posted by bluesun08 on 29 Oct 2013, 9:33 a.m.,
in response to message #5 by Eddie W. Shore

o.k.

            
Re: HP Prime polynomial long division
Message #7 Posted by CR Haeger on 29 Oct 2013, 11:56 a.m.,
in response to message #2 by Eddie W. Shore

Thanks. Does CAS Settings / Simplify need to be set to NONE or MINIMUM for this result? Appears that MAXIMUM will show the rational being "recomposed" as x^3+x : x^2+3.

Best

                  
Re: HP Prime polynomial long division
Message #8 Posted by Tim Wessman on 29 Oct 2013, 12:18 p.m.,
in response to message #7 by CR Haeger

Yes, it will recombine them in your version unforuntately. Note that this will all work much better in the future. There is a reason we did not put it to anything but "none" by default in the initial release. :-)

TW

                        
Re: HP Prime polynomial long division
Message #9 Posted by Michael de Estrada on 29 Oct 2013, 1:49 p.m.,
in response to message #8 by Tim Wessman

Hi Tim,

A related issue. I want to expand and then recombine a symbolic polynomial to group the coefficients by powers, i.e.

(a-x)*(b-x) ---> a*b - (a+b)*x + x^2

If I enter this expression in CAS with simplify set to maximum in the settings the result I get is:

a*b - a*x - b*x + x^2

where the coefficients are not grouped for the power of x^1.

Is there some way to do this ?

                              
Re: HP Prime polynomial long division
Message #10 Posted by Michael de Estrada on 29 Oct 2013, 4:28 p.m.,
in response to message #9 by Michael de Estrada

I found a solution in the CAS function "symb2poly".

symb2poly ((a-x)*(b-x)) ---> [1 -a-b a*b]

                                    
Re: HP Prime polynomial long division
Message #11 Posted by CompSystems on 29 Oct 2013, 5:12 p.m.,
in response to message #10 by Michael de Estrada

real collect

Poly:= (a-x)*(b-x) Var:= x

sum( coeff( Poly, Var ) .* seq( Var^k, k, degree( Poly, Var ), 0, 1 )

            
Re: HP Prime polynomial long division
Message #12 Posted by Wes Loewer on 29 Oct 2013, 3:50 p.m.,
in response to message #2 by Eddie W. Shore

Quote:
In CAS mode, use partfrac.

To see the results of polynomial long division, propfrac is more what he was looking for.

partfrac(((x^3+2*x²+3*x+4)/(x²-9))) returns the partial fractions x+2+(29/3/(x-3))+7/3/(x+3)

while

propfrac(((x^3+2*x²+3*x+4)/(x²-9))) returns the proper fraction: x+2+(12*x+22)/(x²-9)

-wes

                  
Re: HP Prime polynomial long division
Message #13 Posted by bluesun08 on 29 Oct 2013, 5:14 p.m.,
in response to message #12 by Wes Loewer

"propfrac" is exactly the command i need. It's too bad that "propfrac" is not in CAS-Menü.

                        
Re: HP Prime polynomial long division
Message #14 Posted by parisse on 30 Oct 2013, 3:29 a.m.,
in response to message #13 by bluesun08

quo, rem and quorem are the CAS instructions to perform polynomial division.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall