k = 100;
\[Delta]pz = 0;
ks = 1.18;
int[x0_?NumericQ, X_?NumericQ] := NIntegrate[ 2 Sqrt[\[Pi]] E^(-x^2/2) E^(-(x - X)^2/2) r/Sqrt[(x - x0)^2 + r^2]E^(-ks Sqrt[r^2 + (x - x0 )^2])BesselJ[0, Sqrt[(X + 2*k)^2 + \[Delta]pz^2] r], {x, -10, 10}, {r, 0, 10}, PrecisionGoal -> 3, AccuracyGoal -> 8, MinRecursion -> 1]
The evaluation of int[0,0] takes around 6 seconds. I would like to considerably reduce this time. Here is the plot of the integrand
(*plot*)
Plot3D[Evaluate[2 N[Sqrt[\[Pi]], 30] E^(-x^2/2) E^(-(x - X)^2/2) r/Sqrt[(x - x0)^2 + r^2]E^(-ks Sqrt[r^2 + (x - x0 )^2])BesselJ[0, Sqrt[(X + 2*k)^2 + \[Delta]pz^2] r] /. {x0 -> 0, X -> 0}], {x, -5, 5}, {r, 0, 10}, PlotRange -> All]
which has a series of oscillating peaks. What is the best method to integrate this kind of function?
k
,ks
and\[Delta]pz
? For instance, this takes less than a second to evaluate:NIntegrate[2 Sqrt[\[Pi]] E^(-x^2/2) E^(-(x - X)^2/2) r/Sqrt[(x - x0)^2 + r^2] E^(-ks Sqrt[r^2 + (x - x0)^2]) BesselJ[0, Sqrt[(X + 2*k)^2 + \[Delta]pz^2] r] /. {k -> 1, ks -> 1, \[Delta]pz -> 1, x0 -> 0, X -> 0}, {x, -10, 10}, {r, 0, 10}]
$\endgroup$