From: Barton W. <wi...@un...> - 2025-08-13 12:27:23
|
I have been looking at the residue code (see residu.lisp). One idea I was trying was to use a non-default value for taylor_simplifer as a way to find residues somewhat symbolically; for example: (%i10) myresidue(1/(x^2+x+1),x,a); Is 0 equal to a^2+a+1? y; (%o10) 1/(2*a+1) (%i11) myresidue(1/(x^2+x+1),x,a); Is 0 equal to a^2+a+1? n; (%o11) 0 These answers are OK. But I'm mystified by the following: (%i1) (display2d : false, linel : 100)$ (%i2) taylor_simplifier : lambda([s], scsimp(s, a^2=-1))$ (%i3) taylor(1/(x^2+1),x,a,4); (%o3) -(a/(2*(x-a)))+1/4+(x-a)/(8*a^3)-(x-a)^2/16+(x-a)^3/(32*a^5)+(x-a)^4/64 It looks like the simply pole term is -a/2, which is correct, but coeff tells me something else (%i4) coeff(%,x-a,-1); (%o4) -((a^5-4*a^3+48*a)/64) (%i5) subst(a=%i,%); (%o5) -((53*%i)/64) But if I do ratdisrep before finding the simple pole term, all is well: (%i6) taylor(1/(x^2+1),x,a,4); (%o6) -(a/(2*(x-a)))+1/4+(x-a)/(8*a^3)-(x-a)^2/16+(x-a)^3/(32*a^5)+(x-a)^4/64 (%i7) coeff(ratdisrep(%),x-a,-1); (%o7) -(a/2) Question: How is the output in %o4 correct? It seems wrong to me—what is the story? |