Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find a numerical approximation of a residue of an expression around the specified point
ResourceFunction["NResidue"][expr,{z,z0}] numerically finds the residue of expr near the point z=z0.  | 
| "Radius" | 1/100 | radius of contour on which integral is evaluated | 
| Method | Trapezoidal | integration method to use | 
Residue of the function 
 about the origin:
| In[1]:= | 
| Out[1]= | 
NResidue can find residues of functions with essential singularities:
| In[2]:= | 
| Out[2]= | 
Since Series is unable to handle essential singularities, Residue returns unevaluated:
| In[3]:= | 
| Out[3]= | 
NResidue allows for some error in the location of the pole:
| In[4]:= | 
| Out[4]= | 
Due to machine-precision arithmetic, z→1 is not a pole:
| In[5]:= | 
| Out[5]= | 
With Residue, the error in the location of the pole yields a result of zero:
| In[6]:= | 
| Out[6]= | 
NResidue threads element-wise over lists:
| In[7]:= | 
| Out[7]= | 
Use "Radius" to shrink the radius of the contour of integration to isolate a single pole:
| In[8]:= | 
| Out[8]= | 
| In[9]:= | 
| Out[9]= | 
Increase the radius to improve convergence of the integration if no other poles are nearby:
| In[10]:= | 
| Out[10]= | 
| In[11]:= | 
| Out[11]= | 
NResidue accepts options for NIntegrate, which are sometimes necessary to get an accurate result:
| In[12]:= | ![]()  | 
| Out[12]= | 
Use NResidue to evaluate derivatives of a function evaluated at a point:
| In[13]:= | 
| Out[13]= | 
| In[14]:= | 
| Out[14]= | 
Residues of numerical functions:
| In[15]:= | 
| In[16]:= | 
| Out[16]= | 
NSeries can also compute residues of numerical functions:
| In[17]:= | 
| In[18]:= | 
| Out[18]= | 
Using NSeries:
| In[19]:= | 
| Out[19]= | 
NResidue will return an incorrect result when the integration contour contains branch cuts:
| In[20]:= | 
| Out[5]= | 
| In[21]:= | 
| Out[21]= | 
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License