MathGroup Archive 2005

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

Search the Archive

Re: Re: Integrate vs Nintegrate for impulsive functions<> got it !!!!

  • To: mathgroup at
  • Subject: [mg61752] Re: [mg61728] Re: Integrate vs Nintegrate for impulsive functions<> got it !!!!
  • From: Pratik Desai <pdesai1 at>
  • Date: Fri, 28 Oct 2005 03:25:31 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

Bill Rowe wrote:

>On 10/26/05 at 2:44 AM, chris.chiasson at (Chris Chiasson)
>>My computer gives the same answer as yours for NIntegrate, but it
>>thought for a long while on Integrate and then spit out:
>>Complex[-4.4073414839228176`*^145,6.238877585945074`*^146] Bug??
>>Version Number: 
>>Platform: Windows
>Using version 5.2 on MacOS 10.4.2, for Integrate I get
>4.651767835491884*^136 + 1.162941958872971*^136*I
>and for NItegrate, I get the same result reported by Pratik Desai.
>The function being integrated is specified with machine precision coefficients. I strongly suspect this is the root of the problem.
>Integrate will first get a symbolic answer then compute the final answer by substituting the end points into the symbolic answer. 
This did the trick!!!!

 Sin[(3.173442724268721537583815006655640900135040283203125`40. + 
    (-0.40000000000000002220446049250313080847263336181640625`40. + x)^2] -
     (-0.40000000000000002220446049250313080847263336181640625`40. + x)^2])

s1 = Integrate[gss[x] // TrigToExp // Chop, x] /. {x -> 1}
s0 = Integrate[gss[x] // TrigToExp // Chop, x] /. {x -> 0}
s1 - s0
 >>-0.0199823194185132389104867187573191275 - \
0.0042568886863634818146396321781608061 \[ImaginaryI]
NIntegrate[gss[x], {x, 0, 1}]
 >>-0.0199823 - 0.00425689 \[ImaginaryI]



>It is entirely possible this leads to problems even when the orginal function being integrated has reasonable values over the range of integration.
>So, I would be inclined to accept the answer given by NIntegrate as valid and reject the answer given by Integrate. But I would not consider this to be a bug. Instead, I would chalk this up as one of the issues with doing machine precision computations.
>To reply via email subtract one hundred and four

Pratik Desai
Graduate Student
Department of Mechanical Engineering
Phone: 410 455 8134

  • Prev by Date: Still bug in Random
  • Next by Date: Re: Why aren't nested groups? XML again.
  • Previous by thread: Re: Integrate vs Nintegrate for impulsive functions
  • Next by thread: Re: Re: Integrate vs Nintegrate for impulsive functions