Learn R Programming

ComplexAnalysis (version 1.0)

residue: Residue

Description

Calculate the residue of a complex-valued function using limits. Note that this function only works for simple poles.

Usage

residue(f, z0)

Arguments

f
A function whose residue to be calculated.
z0
A real or complex number at which the residue is evaluated.

Value

The calculated residue.

Details

This function calculates Res$(f,z_0)$ by taking the limit of $(z-z_0)f(z)$ as $z -> z_0$. Therefore, z0 should be a simple pole (including one on the branch cut; see Examples).

Examples

Run this code
#The following function has three poles (exp(1i*pi), exp(1i*pi/3) and exp(5i*pi/3)). 
# exp(1i*pi) is a pole on the branch cut thus the other function "disc.integrate" 
# should not be used.
residue(function(z){log(z)/(1+z^3)},exp(1i*pi))

Run the code above in your browser using DataLab