I have a simple numerical integral with a highly oscillatory integrand:
In[256]:= Integrate[Exp[-x^2] Cos[100 x], {x, -10, 10}] // N
Out[256]= 5.11136*10^-46 + 0. I
Using numerical integration, I used the method "LevinRule"
and increased the WorkingPrecision
to 50
. I got the right result, but it came with an error message:
In[273]:= NIntegrate[Exp[-x^2] Cos[100 x], {x, -10, 10},
Method -> {"LevinRule"}, WorkingPrecision -> 50]
Out[273]= 5.1113608752199056046419863980883842786372578322323*10^-46
The error message says that the integral failed to converge, which makes me worry if I don't know the exact answer in advance.
During evaluation of In[273]:= NIntegrate::slwcon: Numerical integration converging too
slowly; suspect one of the following: singularity, value of the integration is 0,
highly oscillatory integrand, or WorkingPrecision too small. >>
During evaluation of In[273]:= NIntegrate::ncvb: NIntegrate failed to converge to
prescribed accuracy after 9 recursive bisections in x near
{x} = {0.06347548783822353791148881980667872878998059126103862089665838701205185579592695769871303841009927124}.
NIntegrate obtained 5.111360875219905604641986398088384278637257832232254321100441868877978318265582017097113446297596528`100.*^-46
and 2.115650450746176575259758050321352748848126918694539847444939975975907083592875723586821709970659407`100.*^-59
for the integral and error estimates. >>
How do I get rid of this error message, without suppressing it?
Quiet
? $\endgroup$