10
$\begingroup$

Bug introduced between 5 and 8 and persisting through 12.0.


I think I may have found a bug, and want to verify is this reproducible in other versions and platforms and not a mistake of mine.

I submit for your consideration that this symbolic integration result is wrong:

Integrate[
 Exp[-z^2]/(z - p)^2*z^2/Sqrt[Pi]
 , {z, -Infinity, +Infinity}
 , Assumptions -> Im[p] > 0
 ]

0

The Mathematica result is 0, and the correct result should be the same as the following command result:

D[
 Integrate[
  Exp[-z^2]/(z - p)*z^2/Sqrt[Pi]
  , {z, -Infinity, +Infinity}
  , Assumptions -> Im[p] > 0]
 , p]
1 - 2 p^2 - 2 E^-p^2 p Sqrt[Pi] (-I + Erfi[p]) + 
 2 E^-p^2 p^3 Sqrt[Pi] (-I + Erfi[p])

For p = 2 + 2 I, the problem also exists.

The numerical integration result is correct, which leads me to believe this is a bug.

I think the problem exists with Version 10.0 & 11.1 in Windows.

Questions:

1. Is this a bug present in all platforms?

2. Can it be reproduced in other versions of Mathematica?

$\endgroup$
  • 2
    $\begingroup$ I have removed the bugs tag, because it is only to be used if the "bug" is verified by the community (as noted in the bugs tag description). I have verified your observations in V10.0.1, but I will leave it to someone else more knowledgeable to decide whether it is a bug or not (I tend to agree that it is). $\endgroup$ – march Sep 21 '17 at 2:59
  • 2
    $\begingroup$ There is precedent on bug "questions" where the only real question is to verify that the bug is reproducible, not a mistake of the user, and compare results to see if present in other platforms and versions. This question can be saved with an edit. $\endgroup$ – rhermans Sep 22 '17 at 14:23
  • 2
    $\begingroup$ @rhermans, please do so, if you think this can be saved. Nevertheless, we should rap the OP's knuckles a bit for forgetting that this is a question-and-answer site. $\endgroup$ – J. M. will be back soon Sep 22 '17 at 14:25
  • 3
    $\begingroup$ I think the intention counts too. In this case, the OP has clearly asserted that this is a bug, and came here to report it. I don't see any value in such posts, and not reporting it to Wolfram is actually a bad thing. We do have many posts about bugs, but most of those have a practical problem as a starting point. "I know that this is a bug, but how can I work around it?" "I am not sure that this is a bug, can you help me figure it out before I report it to Wolfram?" "I need to know which versions this bug is present in, to include the appropriate workaround in my published package." $\endgroup$ – Szabolcs Sep 22 '17 at 14:46
  • 2
    $\begingroup$ Ok, I edited the question and reported to Wolfram Technical Support [CASE:3945664]. Also verified the answer is 0 also in Mma 11.2. Now @J.M. can do the rap across the knuckles. $\endgroup$ – rhermans Sep 22 '17 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.