Bug fix: Residue returns 0
The function residue computes the residue of an analytic function at a pole of the function.
In some cases residue returns an incorrect answer of 0.
f:= x/(1+x^7): p:= cos(Pi/7)+I*sin(Pi/7):
This is usually due to the series command not recognizing that the denominator is 0 at the given point.
Sometimes this problem can be helped by using a different representation of the point . In this case using complex exponentials instead of sines and cosines would work.
Another possibility which sometimes works is to change the environment variable Testzero , whose value is the procedure used in series to determine when the leading coefficient is 0. By default this uses Normalizer , another environment variable whose default value is normal . Since residue and series have the remember option, we must use forget to remove results obtained using Normalizer from their remember tables.
Testzero:= proc(O) evalb(simplify(O)=0) end:
However, this does not work in the case of our .
Another way this problem can arise is when you have a floating-point approximation to a singularity rather than an actual singularity.
> pf:= evalf(p);
In this case it's arguably not Maple's fault: the given point is not actually a singularity of , but only an approximation of a singularity. At itself, has a finite (though large) value.
If you know that should have a simple pole at the given point, you may be able to calculate the residue "by hand". For example:
See also: convert[exp] , Exact vs floating-point computations , forget , Normalizer , residue , series , Testzero
Maple Advisor Database, R. Israel 2000