This version of the IMSL_INTFCN function integrates functions over an infinite or semi-infinite interval. To use this integration method, supply one of the following keywords: INF_INF, INF_BOUND, or BOUND_INF.

This method is a special-purpose integrator that uses a globally adaptive scheme to reduce the absolute error. It initially transforms an infinite or semi-infinite interval into the finite interval [0, 1]. It then uses the same strategy that is used when integrating functions with singularity points given (see IMSL_INTFCN: Functions with Singular Points Given). This method is based on the subroutine QAGI 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:

`.RUN`
`; Define the function to be integrated.`
`FUNCTION f, x`
`  RETURN, ALOG(x)/(1 + (10 * x)^2)`
`END`
` `
`ans = IMSL_INTFCN('f', 0, /Bound_Inf)`
`; Call IMSL_INTFCN with keyword Bound_Inf set. Notice that`
`; only lower limit of integration is given.`
`PM, 'Computed Answer:', ans`

IDL prints:

`Computed Answer:`
`  -0.361689`
`exact = -!Pi * ALOG(10)/20`
` `
`PM, 'Exact - Computed:', exact - ans`

IDL prints:

`Exact - Computed:`
`  5.96046e-08`

Syntax

Result = IMSL_INTFCN(F, /INF_INF)

or

Result = IMSL_INTFCN(F, Bound, /INF_BOUND | /BOUND_INF )

Return Value

The value of:

is returned, where a and b are appropriate integration limits. 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.

Bound

A scalar value specifying the finite limit of integration. If either of the keywords INF_BOUND or BOUND_INF are specified, this argument is required.

Keywords

In addition to the global IMSL_INTFCN keywords, the following keywords are available:

INF_INF (optional)

Set this keyword to integrate f over the range ( –infinity, infinity).

INF_BOUND (optional)

Set this keyword to integrate F over the range ( –infinity, bound ).

BOUND_INF (optional)

Set this keyword to integrate F over the range ( bound, infinity).

Version History

 6.4 Introduced