I'm trying to numerically evaluate the integral $$\int_{a}^{b}\mathop{\mathrm{d}x}\int_{x}^{b}\frac{\sin(x-y)}{xy}\mathop{\mathrm{d}y}$$ using Mathematica. To do that, I the function
Si2[a_, b_] := NIntegrate[Sin[x - y]/(x y), {x, a, b}, {y, x, b},
AccuracyGoal -> 25, PrecisionGoal -> 25, WorkingPrecision -> 40,
MaxRecursion -> 1000000, Method -> "InterpolationPointsSubdivision"];
However, running Si2[.1,1] gives the error
NIntegrate::inumr: The integrand Sin[x-y]/(x y) has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,1},{0,1}}.
However, I'm not integrating over $x=y=0$ (which is an obvious singularity).
Two notes:
- This is an example of usage. In practice, I need to evaluate this function for parameters much closer to $a=0$ (e.g. $\log_{10}(a)\sim-6$).
- Note that I use the
InterpolationPointsSubdivisionmethod because I saw in various answers that it is a good method to evaluate numerically a highly-oscillatory integrand. I tried to use few other methods, but got the same error.
Any advice? Thanks!
InterpolationPointsSubdivisionis only intended for integrands that involve anInterpolatingFunctionobject, so no surprise that it failed here. – J. M.'s missing motivation Oct 13 '18 at 12:11Method->"OscillatorySelection", for example, returns the same error. – EZLearner Oct 13 '18 at 12:28With[{a = 1*^-6, b = 1}, NIntegrate[(CosIntegral[b] - CosIntegral[x]) Sinc[x] - Cos[x] (SinIntegral[b] - SinIntegral[x])/x, {x, a, b}]]– J. M.'s missing motivation Oct 13 '18 at 12:34