Description
When I run the following code:
from sympy import *
z = Symbol("z")
print(residue(exp(-1 / z), z, 0))
It prints
Proof:
This may also be written in the following manner.
Now, for
We know the residue would be the coefficient of the term containing the
Coefficent of
Clearly, the term we're looking for can be obtained at
So,
It seems that in sympy/series/residues.py
, the expansion only considers nseries
).
for n in (0, 1, 2, 4, 8, 16, 32):
s = expr.nseries(x, n=n)
if not s.has(Order) or s.getn() >= 0:
break
Taking the '-' direction into consideration may alleviate this problem. However, as the series is complex, it is still not rigorous:
for n in (0, 1, 2, 4, 8, 16, 32):
s = expr.nseries(x, n=n, dir="+-")
if not s.has(Order) or s.getn() >= 0:
break