# Digital Integration – The graph of my 1-D function is wise, but NIntegrate gives impossible results and many errors

I have an integral to a dimension that should converge, but Mathematica does not seem to be able to use the options that I have tried. Here is the configuration:

The wave functions for a Morse oscillator are given by:

``````psi[v_, r_, m_, De_, a_, re_] = (((v! Sqrt[a (2 lambda - 2 v - 1)/
(Gamma[v + 1] Gamma[2 lambda - v])])
z ^ (lambda - v - 1/2) E ^ (- z / 2) LaguerreL[v, 2 lambda - 2 v - 1, z])
/. z -> (2 lambda E ^ (- a (r - re))))
/. lambda -> Sqrt[2 m De]/ (a hb);
``````

Right here:

• hb is a universal constant (a real positive number)
• m is an identical positive real constant for all states
• De, a and re are positive real numbers that are constant for a given state
• v is an integer specifying a particular state
• r is the variable to integrate on, from infinity to infinity

Typical values ​​are:

``````mass = 1.2 × 10 (-26);
hb = 2.37% (- 13);
De1 = 52000;
De2 = 12000;
a1 = 2.30;
a2 = 2.17;
re1 = 1.21;
re2 = 1.60;
``````

What I need to do is integrate the product from two versions of psi, one with the "1" parameters above and the other with the "2" parameters above; the first will have a series of different values ​​of v ranging from 0 to 32 (for this set of parameters), and the second will always have v = 0. We can look at the function graphs and their product in this way:

``````Manipulate[Grid[{{Plot[{psi[v, r, mass, De1, a1, re1],
psi[0, r, mass, De2, a2, re2]}
{r, 0, 3.5}, PlotRange -> Full, ImageSize -> Large],
Ground[psi[v, r, mass, De1, a1, re1] psi[0, r, mass, De2, a2, re2],
{r, 1, 2.2}, PlotRange -> Full, ImageSize -> Large]}}],
{v, 0, 32, 1}]
``````

Here is what it looks like for v = 32, the most oscillating of functions, and as you can see, the function is nevertheless well behaved.

I'm therefore trying to perform this for different v values:

``````l & # 39; Integration[v_] : = NIntegrate[psi[v, r, mass, De1, a1, re1]
psi[0, r, mass, De2, a2, re2],
{r, -Infinite, Infinite}]
``````

For this set of parameters, the integration works perfectly up to v = 14. On top of that, I start having a failure convergence of errors and later this integration converges too slowly. The result increases correctly from v = 0 to v = 13 up to a maximum of about 0.39, then decreases, but it should approach zero as v continues to dawn. increase. Instead, the result explodes, first negative (at -18) and then positive (at over 80,000).

After following the progress using Sow / Reap, I tried a lot of things that did not help. I've been trying to increase MaxRecursion to 30 and WorkingPrecision to 60, and most error messages have disappeared (ignoring the warning that the precision of the argument function it is not very high), but the answers provided are always false in the same way. . I've tried changing the integration method into LocalAdaptive, DoubleExponential, Trapezoidal, MonteCarlo, QuasiMonteCarlo, DoubleExponentialOscillatory and ExtrapolatingOscillatory.

The most striking is that I tried to limit the range of integration to -10 <r <10, and I still get this behavior. We can see visually, in the graph above, manipulate that for v = 32, the function is pretty well behaved on this region with a magnitude never exceeding ± 3, which means that it should not be possible that the integral is greater than 3 * 20 = 60. And yet, NIntegrate gives me more than 177,000.

I am running out of ideas. Help me?