The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP Prime: CAS taylor
Message #1 Posted by Alberto Candel on 10 Dec 2013, 7:16 p.m.

Hi,

In CAS, for example, if I input

taylor(LN(1+x),x,3)
the output is
x -(1/2)*x^2+(1/3)*x^3+x^4*order_size(x)
as expected from the documentation. But
taylor((x+x^2+2*x^3)/(1+2*x-x^2+6*x^3), x,3)
outputs
x-x^2+5*x^3-17*x^4+x^5*order_size(x)
instead of
 
x-x^2+5*x^3+x^4*order_size(x)

Why the extra term?

      
Re: HP Prime: CAS taylor
Message #2 Posted by parisse on 11 Dec 2013, 4:42 a.m.,
in response to message #1 by Alberto Candel

The third parameter is the order used for series expansion, not necessarily the final order.

            
Re: HP Prime: CAS taylor
Message #3 Posted by Alberto Candel on 11 Dec 2013, 8:20 a.m.,
in response to message #2 by parisse

Thank you. So if I want to obtain the Taylor polynomial of degree n of a function f(x), what is the correct command to use? (I want the result to be a polynomial of degree less than or equal to n, and I do not want the extra "order_size" term)

                  
Re: HP Prime: CAS taylor
Message #4 Posted by parisse on 12 Dec 2013, 4:02 a.m.,
in response to message #3 by Alberto Candel

rem(convert(series(expression,x=limit_point,order),polynom),x^(order+1)) should do that: convert(.,polynom) will remove the order_size remainder term, and rem will remove all monomials of degree>=order+1. You have no warranty to get the full Taylor expansion however, since the remainder term has been erased...

                        
Re: HP Prime: CAS taylor
Message #5 Posted by Alberto Candel on 13 Dec 2013, 9:41 p.m.,
in response to message #4 by parisse

Thanks. But it looks that such command is not available in the HP prime. The example in page 157 of the "Symbolic algebra and Mathematics with Xcas"

convert(series(sin(x),x=0,6),polynom)
outputs
"Error: Unmatch control word"
                              
Re: HP Prime: CAS taylor
Message #6 Posted by Alberto Candel on 13 Dec 2013, 9:45 p.m.,
in response to message #5 by Alberto Candel

But it looks like "truncate" is in Prime, and does more or less the same.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall