ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 30 Oct 2012 10:01:15 +0100Restrict taylor() to only find genuine Taylor serieshttps://ask.sagemath.org/question/9415/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()`.
Sun, 28 Oct 2012 17:22:29 +0100https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/Answer by robert.marik for <p>In Maple, the Taylor series command produces an error if the expression does not have a Taylor series, such as <code>1/x</code> around <code>x = 0</code>. 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 <code>.taylor()</code>.</p>
https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?answer=14203#post-id-14203You 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)Sun, 28 Oct 2012 20:17:52 +0100https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?answer=14203#post-id-14203Comment by Doubtless Lee for <p>You may test if the minimum of the powers is nonnegative</p>
<pre><code>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)
</code></pre>
https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18792#post-id-18792Oh, how about a multivariate series?Sun, 28 Oct 2012 21:28:22 +0100https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18792#post-id-18792Comment by Doubtless Lee for <p>You may test if the minimum of the powers is nonnegative</p>
<pre><code>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)
</code></pre>
https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18783#post-id-18783Oh, you mean just evaluate at zero? Yeah, that would probably have been much simpler from the start. D'oh :-)Tue, 30 Oct 2012 10:01:15 +0100https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18783#post-id-18783Comment by Doubtless Lee for <p>You may test if the minimum of the powers is nonnegative</p>
<pre><code>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)
</code></pre>
https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18793#post-id-18793I guess that's a functional solution. Thanks.Sun, 28 Oct 2012 21:25:27 +0100https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18793#post-id-18793Comment by robert.marik for <p>You may test if the minimum of the powers is nonnegative</p>
<pre><code>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)
</code></pre>
https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18784#post-id-18784Maybe 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.Mon, 29 Oct 2012 18:46:44 +0100https://ask.sagemath.org/question/9415/restrict-taylor-to-only-find-genuine-taylor-series/?comment=18784#post-id-18784