integrateQAGI

Calculate the integral of f(x) over an infinite interval.

The infinite range is mapped onto a finite interval and subsequently the same strategy as in integrateQAGS() is applied.

To integrate f(x) over the interval (-$(INFTY),$(INFTY)), use the first form. To integrate f(x) over the interval (-$(INFTY),a) or (a,$(INFTY)) use the second form with inf=Infinite.lower or inf=Infinite.upper, respectively.

  1. Result!Real integrateQAGI(Func f, Real epsRel, Real epsAbs)
    Result!Real
    integrateQAGI
    (
    Func
    Real
    )
    (
    scope Func f
    ,
    Real epsRel = cast(Real)1e-6
    ,
    Real epsAbs = cast(Real)0
    )
  2. Result!Real integrateQAGI(Func f, Real a, Infinite inf, Real epsRel, Real epsAbs)

Examples

// Slowly convergent integral over infinite interval,
// integrand with endpoint singularity.
double f(double x) { return (1 + 10*x)^^(-2) / sqrt(x); }
auto i = integrateQAGI(&f, 0.0, Infinite.upper, 1e-8);

Meta