MathGroup Archive 2005

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

Search the Archive

The strange behaviour of NIntegrate

  • To: mathgroup at
  • Subject: [mg53508] The strange behaviour of NIntegrate
  • From: Zaeem Burq <Z.Burq at>
  • Date: Sat, 15 Jan 2005 01:44:07 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Dear all,

I'll describe the problem briefly first as follows:

I am trying to NIntegrate a nice function (which I know is integrable), of
the form

K[s] = h[s]/[(1-s)^1.5] from 0 to 1.

The function is real, but Mathematica spits out a COMPLEX answer!!
Admittedly, the complex part is very small, and if I truncate the integral
just below 1, the complex bit disappears and changes the real part very

It seems obvious that Math'ca is choosing the last s value just beyond 1,
producing the Sqrt of a negative number in the denominator.

If interested, here are the calculations and results. Read on if you think 
you can help. Thanx.

        x_] := \[ExponentialE]\^\(\(-x\^2\)/2\)\/\@\(2  \[Pi]\);\)\n
  \(K[s_] := \(\(\ \)\(\((1 - \@s)\)\ \[CurlyPhi][\(1 - \@s\)\/\@\(1 - 
\)\/\((1 - s)\)\^1.5`;\)\)

NIntegrate[K[s], {s, 0, 1}]

gives \!\(\(\(0.4206155890394436`\)\(\[InvisibleSpace]\)\) - 
    3.304807577181973`*^-49\ \[ImaginaryI]\)


NIntegrate[K[s], {s, 0, .999999}]

results in 


Any thoughts? 


Zaeem Burq
PhD Stochastic Processes,
Dept. of Mathematics and Statistics, 

Room 201, Richard Berry Building
University of Melbourne,
Parkville, VIC 3052.

ph: 8344 4248.

  • Prev by Date: Re: List element extraction
  • Next by Date: Re: Re: Indexing a notebook library
  • Previous by thread: Re: Mathematica 5.1 JLink problem (solved)
  • Next by thread: Re: The strange behaviour of NIntegrate