Such questions are often discussed here, I can't attach all links.
Important:
I'm not interested in the exact values of the integrals, only the threefold test:
- The integral converges to some finite numerical value
- Integral clearly diverges
- Uncertain result
Functions are scalar in reals, continuous, well defined at $(0, \infty)$ and fairly simple.
BUT preliminary analytical methods and transformations are not considered, Mathematica utilities only (possibly using "SymbolicPreprocessing") because most of real examples I am interested in are not analytical.
Tools
I looked at the following possibilities of Mathematica:
- Integrate[f@x, x]/.x→ \[Infinity]
- Integrate[f@x, {x, 0, \[Infinity]}]
- AsymptoticIntegrate
- Some combinations of previous with Limit
- NIntegrate[f@x, {x, 0, \[Infinity]}]
- Undocumented IntegrationMonitor
Examples of difficulties
Symbolic Integrate produce "Integral of … does not converge on {0,\[Infinity]}" both for divergent (e.g. 1/Log[x + 2]) and undefined (e.g. Cos@x) cases.
But:
Input: Integrate[1/Log[x + 2], x] /. x -> \[Infinity]
Output: \[Infinity]
Nor Integrate nor AsymptoticIntegrate help with (Cos@x)^2/Log[x + 2].
NIntegrate[(Cos@x)^2/Log[x + 2], {x, 0, \[Infinity]}, MaxRecursion -> 100] produce 4.01583*10^10. Is it divergence?
NIntegrate[(x + 1)^-1/Log[x^2 + 2], {x, 0, \[Infinity]}] produce 7.48297 (with warnings). Maybe it convergates? No:
Input: AsymptoticIntegrate[(x + 1)^-1/Log[x^2 + 2], x, x -> \[Infinity]]/. x -> \[Infinity]
Output: \[Infinity] (*as ~Log@Log@x*)
Undocumented IntegrationMonitor seems to be useful for return result at some point in the calculations, but I don’t really understand how to do it.
I would like to make a module that uses these and other features, receives a simple scalar function at the input and determines a qualitative result $\int_{0}^{\infty} f(x) dx$.
I’m afraid this is too ambitious so any advices and ideas is warmly welcomed!