This version of the IMSL_INTFCN function integrates functions with algebraic-logarithmic singularities. To use this integration method, supply the Alpha and Beta arguments.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

This method is a special-purpose integrator that uses a globally adaptive scheme to reduce the absolute error. It subdivides the interval [a, b] into N+1 user-supplied subintervals, where N is the number of singular points, and uses a 21-point Gauss-Kronrod rule to estimate the integral over each subinterval. The error for each subinterval is estimated by comparison with the 10-point Gauss quadrature rule. The subinterval with the largest estimated error is then bisected, and the same procedure is applied to both halves. The bisection process is continued until either the error criterion is satisfied, the roundoff error is detected, the subintervals become too small, or the maximum number of subintervals allowed is reached. This method uses an extrapolation procedure known as the ε-algorithm. This method is based on the subroutine QAGP by Piessens et al. (1983).

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
 

IDL prints:

Computed Answer: -0.213395
exact = (3 * ALOG(2) - 4)/9
 
PM, ';Exact - Computed:', exact - ans

IDL prints:

Exact - Computed: 1.49012e-08

Errors


See IMSL_INTFCN Errors.

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 argument 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, the following keywords are available:

ALGEBRAIC (optional)

Set this keyword to use the weight function ( x – a )α( b – x)β . This is the default weight function for this method.

ALG_LEFT_LOG (optional)

Set this keyword to use the weight function (x – a)α(b – x)β log (x – a) .

ALG_LOG (optional)

Set this keyword to use the weight function (x – a)α(b – x)β log (x – a)log (x – b) .

ALG_RIGHT_LOG (optional)

Set this keyword to use the weight function (x – a)α(b – x)β log (x – b).

Version History


6.4

Introduced

See Also


IMSL_INTFCN