IMSL_INTFCN:
Functions with Algebraic-logarithmic Singularities
Syntax | Return Value | Arguments | Keywords | Discussion | Example | Errors
This version of the IMSL_INTFCN function integrates functions with algebraic-logarithmic singularities.
Note
The Alpha and Beta arguments must be supplied to use this integration method.
Syntax
Result = IMSL_INTFCN(f, a, b, Alpha, Beta,
/ALGEBRAIC | /ALG_LEFT_LOG | /ALG_LOG | /ALG_RIGHT_LOG)
Return Value
The value of:
is returned, where w (x) is defined by one of the keywords below. 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.
Alpha
The strength of the singularity at a. Must be greater than –1.
Beta
Strength of the singularity at b. Must be greater than –1.
Keywords
In addition to the global IMSL_INTFCN keywords listed in the main section under Keywords, exactly one of the following keywords may be specified:
ALGEBRAIC
Set this keyword to use the weight function
. This is the default weight function for this method.
ALG_LEFT_LOG
Set this keyword to use the weight function
.
ALG_LOG
Set this keyword to use the weight function
.
ALG_RIGHT_LOG
Set this keyword to use the weight function
.
Discussion
This method is a special-purpose integrator that uses a globally adaptive scheme to reduce the absolute error. It computes integrals whose integrands have the special form w (x) f (x), where w (x) is a weight function. A combination of modified Clenshaw-Curtis and Gauss-Kronrod formulas is employed. This method is based on the subroutine QAWS, which is fully documented by Piessens et al. (1983).
If this method is used, the function should be coded to protect endpoint singularities if they exist.
Example
The value of:

is computed.
.RUN ; Define the function to be integrated. FUNCTION f, x RETURN, SQRT((1 + x)) END ans = $ IMSL_INTFCN('f', 0, 1, /Alg_Left_Log, 1.0, .5 ) ; Call IMSL_INTFCN with keyword Alg_Left_Log set and values for the ; method parameters alpha and beta. PM, 'Computed Answer:', ans ; Output the results. ; Computed Answer: -0.213395 exact = (3 * ALOG(2) - 4)/9 PM, 'Exact - Computed:', exact - ans ; Exact - Computed: 1.49012e-08
Errors
See Errors.