MathGroup Archive 2007

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

Search the Archive

Re: Numerical integration

On 1    , 12:04, chuck009 <dmili... at> wrote:
> Personally, I would suspect the symbolic result as well unless you know f=
rom independent means that the results returned by Integrate is indeed the =
correct result.  This I say in regards to another similar situation with:
> Log[1+1/(e^x Sqrt[x])]
> which returns an incorrect result symbolically.  When I use the Method->O=
scillatory I get:
> In[24]:=
> NIntegrate[f[x],{x,0,Infinity},Method->Oscillatory,WorkingPrecision\[Rule=
> Out[24]=
> 0.871

1)I don't have another source to check the integral. But based that
both Mathematica
and the other (very good!) CAS I used gave symbolic results which
their numerical
estimation agree I think that the symbolic result is ok.

2) Mathematica 6 as it shown by Bob Hanlon has problems both
and symbolically. Symbolically, that it returns an incorrect result is
of course
a bug. As regards numerically, the result itslef is quite incorrect
but I think that
"playing with" the options we can achieve better numerical estimation.
The problem is that Mathematica 6 does not return any warning message
indicating that the result might be wrong. For example something like
the following

"NIntegrate failed to converge" etc

3) You must be careful with the Method->Oscillatory.
The method cannot be used for integrands like the current one.

See here for a good reference

and in particular the section under the title

Extrapolating Oscillatory Strategy

Mathematica 6 is thousand of years advanced as regards
the numerical integration algorithms compare to 5.2.
A good example is the handling of oscillatory kernels
in version 6.

Anyway, below I use Mathematica 5.2.

Plot[Log[1 + z^2]*(BesselJ[1, z]^2/z), {z, 0, 10}]

This is not an oscillatory function.
There is not an alternation in the slope of the function
between the successive zeros.

On the contrary, compare

Plot[{Sin[x]/Sqrt[1 + x^2], 1.*BesselJ[0, x]}, {x, 0, 20}, PlotStyle -
> {Green, Orange}]
Integrate[{Sin[x]/Sqrt[1 + x^2], BesselJ[0, x]}, {x, 0, Infinity},
GenerateConditions -> True]
N[%, 10]
NIntegrate[{Sin[x]/Sqrt[1 + x^2], N[1, 20]*BesselJ[0, x]}, {x, 0,
Infinity}, Method -> Oscillatory, WorkingPrecision -> 20,
PrecisionGoal -> 10]


{(1/2)*Pi*(BesselI[0, 1] - StruveL[0, 1]), 1}

{0.8730842426508674934616911159`10., 1.`10.}



  • Prev by Date: Re: removing those annoying $$$$'s from local variables names?
  • Next by Date: Re: Multi-variable Integration
  • Previous by thread: Re: Numerical integration
  • Next by thread: Re: Dot or Inner ... but not quite