Learn R Programming

ComplexAnalysis (version 1.0)

line.integrate: Evaluate an integral along a straight on the complex plane

Description

Evaluate an integral along a straight on the complex plane. This can be used as an alternative to evaluating an integral in the presence of a branch cut or point.

Usage

line.integrate(f, a, b, complex = TRUE)

Arguments

f
The function whose integral to be evaluated.
a
The starting point of the straight line.
b
The end point of the straight line.
complex
If FALSE and the imaginary part of a and b are zero, R built-in function integrate is used.

Value

The evaluated value is returned.

Details

The function only evaluates an integral along a straight line.

Examples

Run this code
## 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) 

Run the code above in your browser using DataLab