We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have the following behaviour:
sage: var('s') s sage: (x^s).series(x, 0) Order(1) sage: (x^s).series(x, 1) (0^s) + Order(x) sage: (x^s).series(x, 2) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-4-5abc79662303> in <module>() ----> 1 (x**s).series(x, Integer(2)) /usr/opt/sage-6.1.1/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.series (sage/symbolic/expression.cpp:17596)() ValueError: power::eval(): division by zero
This output is weird and definitely wrong (since the correct output depends strongly on s.).
s
CC: @mforets
Component: symbolics
Keywords: symbolic, series, exponent
Issue created by migration from https://trac.sagemath.org/ticket/15854
The text was updated successfully, but these errors were encountered:
Still there in 6.6
Sorry, something went wrong.
Could you please specify what output exactly to expect?
there is no error if you declare s as integer:
sage: s = SR.var('s', domain='integer') sage: (x^s).series(x, 2) # ok (?) or we expect x^s (0^s) + (0^(s - 1)*s)*x + Order(x^2)
to compare, W|A gives various series representations. in this case maybe it could answer just x^s?
x^s
however, there is this closely related issue:
sage: n = SR.var('n', domain='integer') sage: ((x+1/x)**n).series(x) # wrong (what happened with n?) 1 + Order(x^20)
one expects something like 1/x^n*(1 + n*x^2 + O(x^3)).
1/x^n*(1 + n*x^2 + O(x^3))
this behaviour has side effects for example if you want to compute the residue of this function:
sage: f = 1/x*((x^2+1)/(2*x))**(2*k) sage: f.residue(x==0) # wrong (1/2)^(2*k)
in fact:
sage: f(k=4) 1/256*(x^2 + 1)^8/x^9 sage: f(k=4).residue(x==0) 35/128 sage: f.residue(x==0).subs(k==4) 1/256 sage: res(k) = 1/2**(2*k)*binomial(2*k, k) # correct answer sage: res(k=4) 35/128
a bit unrelated, but let me mention that SymPy's residue gives wrong result for this one (0), and giac gives unevaluated expression.
residue
No branches or pull requests
We have the following behaviour:
This output is weird and definitely wrong (since the correct output depends strongly on
s
.).CC: @mforets
Component: symbolics
Keywords: symbolic, series, exponent
Issue created by migration from https://trac.sagemath.org/ticket/15854
The text was updated successfully, but these errors were encountered: