This is related to my previous post, which didn't resolve. I want to calculate the principal value of the following two-dimensional integral

$$ \int_{0}^{\infty}dx\int_{0}^{\infty}dy\sqrt{xe^{-10x}}\sqrt{ye^{-10y}}\frac{1-e^{1000\imath(x+y)}}{(x+y)(y-0.01)} $$

The mathematica code is

NIntegrate[Sqrt[x E^{-x/a}]Sqrt[y E^{-y/a}](1-E^{1000I(x+y)})/((x+y)(y-b)),{x,0,∞},{y,0,∞}]

But it gives the slwcon 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

I searched all over the internet. I tried different numerical integration methods (GlobalAdaptive, LocalAdaptive, ...) with different options (AccuracyGoal,PrecisionGoal, ...) but none of them get rid of the error. The integral for very small values of a converges and gives the result without error. This means that the integral is convergent. But I need the result for the values specified in the code above. How should I resolve the error?

Edit: I plotted the integrand in terms of its variables x, y. As you can see the integrand converges, although it has a singularity point y=0.01 and a singularity line x+y=0.

enter image description here


After fixing several syntax errors one gets the following:

a = 0.1;
b = 0.01;
expr1 = Sqrt[x Exp[-x/a]] Sqrt[
   y Exp[-y/a]] (1 - Exp[1000 I (x + y)])/((x + y) (y - b))

(*  ((1 - E^(1000 I (x + y))) Sqrt[E^(-10. x) x] Sqrt[
 E^(-10. y) y])/((-0.01 + y) (x + y))  *)

Now we go to cylindrical coordinates:

expr2 = expr1 /. {x -> r*Cos[f], y -> r*Sin[f]} // 
  Simplify[#, {r >= 0, 0 < f < \[Pi]}] &

(*  -((1. (-1. + E^(1000 I r (Cos[f] + Sin[f]))) Sqrt[
  E^(-10. r Cos[f] - 10. r Sin[f]) r^2 Cos[f] Sin[f]])/(
 r (Cos[f] + Sin[f]) (-0.01 + r Sin[f])))   *)

Now let us integrate it over the angle first:

Integrate[f*r, {f, 0, \[Pi]}]

(*  (\[Pi]^2 r)/2   *)

It is clearly visible from here that the next integration (that is, over r from zero to infinity) will be infinite.

Thus your integral does not converge.

Have fun!

  • $\begingroup$ Thank you. I fixed the errors in the code. $\endgroup$ – New Developer Dec 20 '16 at 12:57
  • $\begingroup$ Regarding your response, the integrand is kind of the dynamics of a damped harmonic oscillator. It essentially contains an exponential decay term and a sinusoidal term. The decay term makes sure that the function converges at infinity. This can be easily checked by setting 'a = 0.000001' and introducing "AccuracyGoal -> 10, MaxRecursion -> 300". This gives a number without any error. So it seems that the integral converges. $\endgroup$ – New Developer Dec 20 '16 at 12:59
  • $\begingroup$ For 'a = 0.1' obviously the convergence should be slow, but it finally converges. $\endgroup$ – New Developer Dec 20 '16 at 13:01
  • $\begingroup$ I inserted the plot of the integrand in the original post. Apart from the singularities, according to the plot, the integral clearly converges. $\endgroup$ – New Developer Dec 20 '16 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.