# Restrict taylor() to only find genuine Taylor series

In Maple, the Taylor series command produces an error if the expression does not have a Taylor series, such as 1/x around x = 0. Is it possible to achieve the same effect in Sage? I have some rather long expressions, and it's not always immediately obvious whether there are some singular terms hidden in the result of .taylor().

edit retag close merge delete

Sort by ยป oldest newest most voted

You may test if the minimum of the powers is nonnegative

f(x)=1/x^6*cos(x)
point, order = 0, 4
g=f.taylor(x,point,order)
powers=[i[1] for i in g.coefficients()]
min(powers)

more

I guess that's a functional solution. Thanks.

( 2012-10-28 15:25:27 -0500 )edit

Oh, how about a multivariate series?

( 2012-10-28 15:28:22 -0500 )edit

Maybe another suggestion: test, if the function is well defined at the point which is the center of the Taylor polynomial. This should work also for multivariable series. Or expand along each variable separately and test the smallest power.

( 2012-10-29 12:46:44 -0500 )edit

Oh, you mean just evaluate at zero? Yeah, that would probably have been much simpler from the start. D'oh :-)

( 2012-10-30 04:01:15 -0500 )edit