Function 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 (-∞,∞), use the
first form. To integrate f(x)
over the interval (-∞,a
) or
(a
,∞) use the second form with inf=Infinite
or
inf=Infinite
, respectively.
Example
// 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);