## integral evaluated at a removable singularity
disc.integrate(function(z){sin(z)/z},0)
## evaluating an integral in the presence of a branch cut
disc.integrate(function(z){sqrt(z)},0,R=1) #still works
#evaluate the integral along the branch cut
-line.integrate(function(z){sqrt(z)},0,1)+line.integrate(function(z){sqrt(z)},1,0)
## Incorrect result: evaluating an integral at a pole on a branch cut
disc.integrate(function(z){log(z)/(1+z)},-1,R=1) #Incorrect
residue(function(z){log(z)/(1+z)},-1) #Correct (using residue)
Run the code above in your browser using DataLab