Wrong:
(%i1) residue(1/(x^8+1),x,exp(%i*%pi/8));
(%o1) 0
The correct result is:
(%i2) exp(-(7*%i*%pi)/8)/8;
(%o2) %e^(-(7*%i*%pi)/8)/8
(%i3) rectform(%);
(%o3) cos((7*%pi)/8)/8-(%i*sin((7*%pi)/8))/8
(%i4) float(%), numer;
(%o4) -0.047835429045636*%i-0.11548494156391
or
(%i5) -exp(%i*%pi/8)/8;
(%o5) -%e^((%i*%pi)/8)/8
(%i6) rectform(%);
(%o6) -(%i*sin(%pi/8))/8-cos(%pi/8)/8
(%i7) float(%), numer;
(%o7) -0.047835429045636*%i-0.11548494156391
build_info("5.27.0","2012-04-24 08:52:03","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8")
Aleksas D
Raymond Toy
2012-07-23
This appears to be a bug in the function coeff, called from resm1 in src/residu.lisp. AFAICT, the taylor series returns the correct value, but coeff is unable to get the coefficient of 1/(x-p).
A workaround is the remove the call ($ratsimp ($rectform pole)). This fixes both this bug and bug 3541292, without causing a regression in bug 1504505.
But coeff should really be fixed to return the correct value.
Raymond Toy
2012-07-24
I'm mistaken. The problem appears to be in taylor. taylor(1/(x^8+1),x,rectform(exp(%i*%pi/8)),1) appears to return an expression that does not have 1/(x-rectform(exp(%i*%pi/8)) in it.
But taylor(1/(x^8+1),x,exp(%i*%pi/8),1) does have 1/(x-exp(%i*%pi/8)).