Function Repository Resource:

# NResidue

Find a numerical approximation of a residue of an expression around the specified point

Contributed by: Wolfram Research
 ResourceFunction["NResidue"][expr,{z,z0}] numerically finds the residue of expr near the point z=z0.

## Details and Options

The expression expr must be numeric when its argument x is numeric.
The residue is defined as the coefficient of (z-z0)-1 in the Laurent expansion of expr.
ResourceFunction["NResidue"] numerically integrates around a small circle centered at the point z0 in the complex plane. ResourceFunction["NResidue"] will return an incorrect result when the punctured disk is not analytic.
ResourceFunction["NResidue"] is unable to recognize small numbers that should in fact be zero. Chop is often needed to eliminate these spurious residuals.
Although Residue usually needs to be able to evaluate power series at a point, ResourceFunction["NResidue"] can find residues even if the power series cannot be computed.
ResourceFunction["NResidue"] has the same options as NIntegrate, with the following additions and changes:
 "Radius" 1/100 radius of contour on which integral is evaluated Method Trapezoidal integration method to use

## Examples

### Basic Examples

Residue of the function about the origin:

 In[1]:=
 Out[1]=

### Scope

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]=

### Generalizations & Extensions

 In[7]:=
 Out[7]=

### Options

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]=

#### WorkingPrecision

NResidue accepts options for NIntegrate, which are sometimes necessary to get an accurate result:

 In[12]:=
 Out[12]=

### Applications

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]=

### Properties & Relations

NSeries can also compute residues of numerical functions:

 In[17]:=
 In[18]:=
 Out[18]=

Using NSeries:

 In[19]:=
 Out[19]=

### Possible Issues

NResidue will return an incorrect result when the integration contour contains branch cuts:

 In[20]:=
 Out[5]=
 In[21]:=
 Out[21]=

## Requirements

Wolfram Language 11.3 (March 2018) or above