Please consider the following integrals

G1[b_, q_] := NIntegrate[ E^(-(r^2/2)) Sqrt[π/2] Erf[(b r Sqrt[2]], {r, 0, q}]
G2[b_, q_] := NIntegrate[E^-r^2 Sqrt[π] Erf[b r  ], {r, 0, q/Sqrt[2]}]

These two integrals are related by a simple substitution $r \to \sqrt 2 r$. Therefore, the answer should be the same. For example,

(G1[1.5, 0.5]/G2[1.5, 0.5]) - 1 
 -1.11022*10^-16 (*answer*)

However, if I try to find the indefinite integrals, only one of them returns a non-trivial result, i.e.,

 Integrate[E^-r^2 Sqrt[π] Erf[b r  ], r]

is evaluated to

 1/2 π (1 - Erf[b r] (-1 + Erfc[r]) + 4 OwenT[Sqrt[2] b r, 1/b])

while the other integral

 Integrate[E^(-(r^2/2)) Sqrt[π/2] Erf[(b r  )/Sqrt[2]], r]

returns the unevaluated input.

I am aware that the built-in Integrate is a complicated beast to be understood. However, still it looks a bit strange to see Mathematica fails to notice such a simple substitution.

Additionally, is there any way to force Integrate to consider such substitution?

  • $\begingroup$ The integration is prolly done by pattern-matching, and Mathematica fails to notice that they are more or less the same. $\endgroup$ – J. M. will be back soon Dec 15 '16 at 14:06
  • $\begingroup$ Is the first function meant to be Erf[(b r/Sqrt[2]] rather than Erf[(b r Sqrt[2]].... If so is there a problem? $\endgroup$ – Ramble Dec 15 '16 at 19:03
  • $\begingroup$ @Ramble No, the equation given in the question is correct. Basically they are equivalent integrals by a simple substitution $r \to r \sqrt{2}$. However, Mathematica only evaluates one of the indefinite integrals. I am wondering why Mathematica fails to notice such a simple relation. $\endgroup$ – Sungmin Dec 15 '16 at 21:26

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.