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

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

```Bill Rowe wrote:

>On 10/26/05 at 2:44 AM, chris.chiasson at gmail.com (Chris Chiasson)
>wrote:
>
>
>
>>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: 5.2.0.0
>>Platform: Windows
>>
>>
>
>Using version 5.2 on MacOS 10.4.2, for Integrate I get
>
>Out[2]=
>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!!!!

gss[x_]
=(-0.24982234345508192767999985675352186955264330379714847631`38.487710383706414
-

0.042973298321580602789058629777534550745591195188598656308`38.14780044850824*I)*
Sin[(3.173442724268721537583815006655640900135040283203125`40. +
0.329548078108167386002236298736534081399440765380859375`40.*
I)*x]*(Cosh[444.44444444444451391973416320979595184326171875`40.*
(-0.40000000000000002220446049250313080847263336181640625`40. + x)^2] -
1.`40.*Sinh[444.44444444444451391973416320979595184326171875`40.*
(-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]

Cheers!!!

Pratik

>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