Why can’t mathematica find this residue?

I am trying to find the residue of the function $$f(z)=(z+1)^2e^{3/z^2}$$ at $z=0$. I tried the following in Mathematica

Residue[(z+1)^2*Exp[3/z^2],{z,0}]


which remains unevaluated. Computing this by hand gives the value of $6$. What is going on?

I’ve noticed that Mathematica has a problem with the Laurent series of $e^{3/z^2}$ at $z=0$.

• From the "Possible Issues" section of the documentation on Residue: "Residues are not defined at branch points". Isn't $0$ a branch point for your function? Commented Apr 30, 2018 at 21:31
• @MarcoB does not look like a branch point to me. Commented Apr 30, 2018 at 21:38
• It's an essential singularity. Commented Apr 30, 2018 at 21:42
• I don’t think it is a branch point Commented Apr 30, 2018 at 21:42

You could use SeriesCoefficient instead:

SeriesCoefficient[(z+1)^2 Exp[3/z^2], {z, 0, -1}]


6

Another possibility is to note that the residue at 0 and the residue at infinity must sum to zero, since they are the only singularities of the function. Hence we can do:

- Residue[(z + 1)^2 Exp[3/z^2], {z, Infinity}]


6

which is the same answer as before.

• First does not work on Exp[z - 1/z]. Instead you can use a package ContourIntegration.m by Robert Kragler. Commented May 26, 2022 at 19:29

Or integrate around zero

Integrate[(z + 1)^2 Exp[3/z^2], {z, 1, I, -1, -I,
1}]/(2 Pi I) // Simplify

(*   6   *)