Re: Integration bug
- To: mathgroup at smc.vnet.net
- Subject: [mg38351] Re: Integration bug
- From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
- Date: Thu, 12 Dec 2002 01:37:31 -0500 (EST)
- References: <at4cv9$eta$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Thanks to Ray Gittings, I've investigated this bug a bit further, and have found another entirely separate "curious behavior" which I do not understand. First, if we ask Mathematica (version 4.1) to Integrate[Sin[x+d]/(x+d), {x, -Infinity, 0}] we get, incorrectly, -Pi/2 + SineIntegral[d]. A correct result would have been +Pi/2 + SineIntegral[d]. The incorrect behavior above presumably explains, in some sense, what I had noted in my previous post: Integrate[Sin[x+d]/(x+d), {x, -Infinity, Infinity}] incorrectly yields 0. Second, it seems that Mathematica does get correct answers for such integrals if d is given as a specific value. But sometimes the answer is quite needlessly complicated. For example, Integrate[Sin[x+Pi]/(x+Pi), {x, -Infinity, 0}] yields the messy result (Pi*(-2 + Sqrt[2]*BesselJ[1/2, Pi])*Log[2])/2 - (Pi*(-2 + Sqrt[2]*BesselJ[1/2, Pi])*Log[4])/4 + (I/2)*(I*Pi + 2*Pi^2 - (2*I)*Pi*Log[Pi]) - ((-2 + Sqrt[2]*BesselJ[1/2, Pi])*(EulerGamma*Pi^(3/2) - I*Pi^(5/2) - Pi^(3/2)*Log[Pi]))/(2*Sqrt[Pi]) + (Pi^(3/2)*(-(((-2 + Sqrt[2]*BesselJ[1/2, Pi])*Log[2])/ Sqrt[Pi]) - (EulerGamma*Pi - 2*SinIntegral[Pi] + SinIntegral[2*Pi])/Pi^(3/2) - (-4*Sqrt[Pi] + 2*EulerGamma*Sqrt[Pi] + 2*Sqrt[Pi]*Log[4] - Sqrt[2*Pi]* Derivative[1, 0][BesselJ][1/2, Pi])/(2*Pi)))/2 But Pi/2 + SineIntegral[Pi] is a much simpler correct answer! BTW, asking for a numerical approximation of the messy answer above, we get correctly 3.42273 + 1.77635*10^-15*I . (Of course, the precise answer is purely real. The very small imaginary component in the approximation is an understandable artifact.) Now here's the new behavior I can't understand: Suppose that we ask Mathematica to Simplify the messy result above, hoping that it will be smart enough to give us something like Pi/2 + SineIntegral[Pi] . Instead, we get Indeterminate preceded by the comment \!\(Power::"indet" \(\(:\)\(\ \)\) "Indeterminate expression \!\(0``68.9889\^0\) encountered."\) Now it's bad enough that Mathematica thinks the result is Indeterminate, but what I really can't grasp is how floating-point values could possibly be involved in this matter: The messy expression to be simplified was _precise_! Floating-point values should have nothing to do with its simplification. Curiously, David Cantrell -- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service New Rate! $9.95/Month 50GB