IMSL_INTFCN:
Integrals in the Cauchy Principle Value Sense
Syntax | Return Value | Arguments | Keywords | Discussion | Example | Errors
This version of the IMSL_INTFCN function computes integrals of the form:

in the Cauchy principal value sense.
Note
The Singular_Pt argument and the CAUCHY keyword must be supplied to use this integration method.
Syntax
Result = IMSL_INTFCN(f, a, b, Singular_Pt, /CAUCHY)
Return Value
The value of:

is returned. If no value can be computed, the floating-point value NaN (Not a Number) is returned.
Arguments
f
A scalar string specifying the name of a user-supplied function to be integrated. The function f accepts one scalar parameter and returns a single scalar of the same type.
a
A scalar expression specifying the lower limit of integration.
b
A scalar expression specifying the upper limit of integration.
Singular_Pt
A scalar expression specifying the singular point. The singular point must not equal a or b.
Keywords
In addition to the global IMSL_INTFCN keywords listed in the main section under Keywords, the following keywords may be specified:
CAUCHY
Set this keyword to compute the specified integral in the Cauchy principal value sense.
Discussion
This method uses a globally adaptive scheme in an attempt to reduce the absolute error. It computes integrals whose integrands have the special form w (x) f (x), where w (x) = 1/(x – Singular_Pt). If Singular_Pt lies in the interval of integration, then the integral is interpreted as a Cauchy principal value. A combination of modified Clenshaw-Curtis and Gauss-Kronrod formulas is employed. The method is an implementation of the subroutine QAWC by Piessens et al. (1983).
If this method is used, the function should be coded to protect endpoint singularities if they exist.
Example
The Cauchy principal value of:

is computed.
.RUN ; Define the function to be integrated. FUNCTION f, x RETURN, 1/(5 * x^3 + 6) END ans = IMSL_INTFCN('f', -1, 5, 0, /Cauchy) ; Call IMSL_INTFCN with keyword Cauchy set. PM, 'Computed Answer:', ans ; Output the results. Computed Answer: -0.0899440 exact = ALOG(125/631.)/18 PM, 'Exact - Computed:', exact - ans Exact - Computed: 1.49012e-08
Errors
See Errors.