I need to evaluate the following integral numerically for different values of a
:
NIntegrate[w E^(-w/a)Sin[(w-0.001)100000]/((w-0.001)^2), {w, 0, ∞}]
If I define a small value for a
and use the MaxRecursion
and AccuracyGoal
options I got no error:
a=0.000001
NIntegrate[w E^(-w/a)Sin[(w-0.001)100000]/((w-0.001)^2),
{w, 0, ∞}, MaxRecursion -> 300, AccuracyGoal -> 10]
0.0000374967
But when I increase the value of a
with any value for MaxRecursion
and AccuracyGoal
:
a=0.001
NIntegrate[w E^(-w/a)Sin[(w-0.001)100000]/((w-0.001)^2),
{w, 0, ∞}, MaxRecursion -> 300, AccuracyGoal -> 10]
It gives the error:
Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small
It seems that a lot of questions arose regarding this problem in this community, but I didn't find any concrete solution. I really appropriate if anyone help me out with a solution?
w == 0.001
. The firstNIntegrate
, which returns an answer without complaint, is wrong. Now, do you want the Cauchy principal value? (There is also an extra parenthesis in front ofSin[]
.) $\endgroup$"PrincipalValue"
method. But maybe it was doing the PV behind the scenes anyway. By comparison, I get6.63412*10^-7
for your first integral by the method in my answer below. $\endgroup$