This version of the IMSL_INTFCN function computes integrals of the form:

in the Cauchy principal value sense. To use this integration method, supply the Singular_Pt argument and the CAUCHY keyword.

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

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/(xSingular_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

IDL prints:

Computed Answer:
  -0.0899440
exact = ALOG(125/631.)/18
 
PM, 'Exact - Computed:', exact - ans

IDL prints:

Exact - Computed:
  1.49012e-08

Errors


See IMSL_INTFCN Errors.

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 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.

Omega

A scalar expression specifying the frequency of the trigonometric weighting function.

Keywords


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

CAUCHY (optional)

Set this keyword to compute the specified integral in the Cauchy principal value sense.

Version History


6.4

Introduced

See Also


IMSL_INTFCN