# How to fix slow covergence and highly oscillatory integrand issues?

I'm trying to numerically solve an integral in a specific region and then to visualize it as follows.

RegionPlot3D[
NIntegrate[1/Sqrt[r] - 1/Sqrt[l + r Sin[t]], {r, l, t} ∈
ImplicitRegion[r + l Sin[t] > 0 && l > 0 && r > 0, {r, l, t}]], {r,
0, 5}, {l, 0, 10}, {t, 0, pi/4}]


However, Mathematica complains that

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.

I basically tried to get rid of potential singularities by taking that specific integration region into account. Yet, I have no idea about the slow convergence of highly oscillatory integrand.

Edit 1: There is also another warning saying

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 27 recursive bisections in l near {r,l,t} = {0.184661,1.641681647898248*10^690538901,0.184661}. NIntegrate obtained 8.935806122974667*10^22717757165+31581.2 I and 2.09657839572837915.954589770191005*^22717757166 for the integral and error estimates.

How can I fix these issues?

Edit 2: What I am actually looking for is the 3D plot corresponding to the following integral function F(l,\theta) where r is a fixed number (say, 10, or whatever). I am particularly in trouble to get rid of singularities and divergent subsets of the variable's domains.

• Your formulation is unclear to me: after integration over {r,l,t} you obtain a number so what you plot in {r,l,t}? Jul 29, 2019 at 17:38
• @user64494: I actually doesn't want a single number, but the parametric plot of the result of the integration according to {r,l,t}. Jul 29, 2019 at 17:40
• Don't understand. The result of NIntegrate[1/Sqrt[r] - 1/Sqrt[l + r Sin[t]], {r, l, t} ∈ ImplicitRegion[r + l Sin[t] > 0 && l > 0 && r > 0, {r, l, t}]] is a complex number (maybe, with its imaginary part equal to zero). Jul 29, 2019 at 17:44
• (1) Why RegionPlot3D? The syntax is wrong. (2) NIntegrate::slwcon is a warning, not an error: If there are no other errors, then the integral evaluated fine. Are there other error messages? Jul 29, 2019 at 18:06
• @MichaelE2: My basic interest is in the variation of the integral result regarding different combinations of l and t (with a fixed r). Considering I am not interested in infinity, can you please show me how to plot that integral function in terms of l and t? Jul 29, 2019 at 18:24

ff[r_?NumericQ, t_?NumericQ, l_?NumericQ] :=

In the original code, there was a restriction, r + l Sin[t] > 0, but I'm not sure how you want to handle that. You might use Piecewise[] or multiply the integrand by Boole[r + ll Sin[tt] > 0]`, if appropriate.