# Possible bug in ResidueSum

Trying a new command of version 13.1 ResidueSum, I obtain

FunctionMeromorphic[{(x^2 - x + 2)/x, Abs[x] > 5}, x]


True

ResidueSum[{(x^2 - x + 2)/x, Abs[x] > 5}, x]


0

which is in discordance with

Residue[(x^2-x+2)/x,{x,ComplexInfinity}]


-2

Is the above result of ResidueSum incorrect or I don't understand something?

• The documentation states "ResidueSum computes the sum of residues at all poles of f." That may not be what you want calculated, but that is what it says it is calculating. Commented Jul 1, 2022 at 13:37
• I believe the help files should be updated to remove this ambiguity: ResidueSum states it computes residues of ALL poles of f but pole at infinity is a legitimate pole of f. And FunctionPoles states it finds a pole at z if function has Laurent series in terms of powers of (x-z). But there is no Lorent series in terms of $(x-\infty)$; need to first transform function via Residue at infinity and then compute residue at zero.
– josh
Commented Jul 1, 2022 at 16:29
• I have to wonder why it would fall on a responder to submit this as a bug report. Commented Jul 1, 2022 at 18:16
• I think the second bullet item under Details makes clear that this will not consider poles at infinity. Which explains In[1]:= ResidueSum[x, x] Out[1]= 0. (Most people would be concerned if that gave anything other than zero.) Commented Jul 1, 2022 at 18:22
• Here is another way to view the behavior. If you want to get a nonzero result when you exclude all poles except at infinity, then what should you get when you include all poles (including at infinity)? That is, how do you avoid getting zero? Commented Jul 1, 2022 at 21:47