MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Non-converging integral with linear transformation?!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101177] Re: Non-converging integral with linear transformation?!
  • From: antononcube <antononcube at gmail.com>
  • Date: Fri, 26 Jun 2009 06:48:32 -0400 (EDT)
  • References: <h1nf1f$933$1@smc.vnet.net>

On Jun 22, 4:23 am, mereandor <merean... at gmail.com> wrote:
> Hi!
>
> I have a question regarding the Integral over the product of the two func=
tions AiryAi and AiryAiPrime. Lets look at the following integrals:
>
> f[x_] = AiryAi[-1 + 10^5 x] AiryAiPrime[-500 + 10^5 x]
> NIntegrate[f[x], {x, 0, Infinity}]
> 10^-5*NIntegrate[f[x] /. x -> (10^-5 x), {x, 0, Infinity}]
>
> Mathematica 6 seems to be unable to evaluate the first one; the result is=
 0 and a warning about to slow convergence is issued.

Actually two messages are issued NIntegrate:slwcon and
NIntegrate::ncvb. The second message says that NIntegrate failed to
converge to prescribed accuracy because the maximum recursion depth is
reached. If we increase the value given to MaxRecursion convergence is
reached:

NIntegrate[f[x], {x, 0, Infinity}, MaxRecursion -> 20]

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. >>

-3.8906667557047874*^-7


> The second one is - as far as I know - the same as the first one but with=
 a linear variable transformation applied -> this time the result is given =
without any warning.
>
> So basically my question is: what is going on there?

The integrand oscillates around zero. We can see that with the
following plots:

1. First integrand

Plot[f[x], {x, 0, 0.0001}, PlotRange -> All]

2.  Second integrand

Plot[Evaluate[f[x] /. x -> (10^-5 x)], {x, 0, 10}, PlotRange -> All]


Note the plot ranges. (With your transformation the second integrand
is stretched.)

The oscillation of the integrand around 0 is some sort of singularity
which makes the integration harder. With your linear transformation
the singularity is stretched and flattened and the work for
NIntegrate's bisection adaptive algorithm is made easier. (Because
nothing interesting is happening at the infinity end.)

These plots might be instructive:

Needs["Integration`NIntegrateUtilities`"]
NIntegrateSamplingPoints[NIntegrate[f[x], {x, 0, 0.002}]]
NIntegrateSamplingPoints[NIntegrate[f[x] /. x -> (10^-5 x), {x, 0,
20}]]

Note that for the transformed integrand the work of the adaptive
algorithm is more spread out across the integration range. (And that
is why I said the integration is easier with it.)


> Am I doing something wrong?

The mistake not increase the maximum recursion seems to be common...

Anton Antonov





  • Prev by Date: Re: *slowing down* a Mathematica process (Dynamic/Refresh question)
  • Next by Date: Re: Re: Re: Putting an If in my function
  • Previous by thread: Non-converging integral with linear transformation?!
  • Next by thread: Ansatz?