# Mathematica Integrate evaluates some integrals only with some specific scaling factor

Please consider the following integrals

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


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


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 b r, 1/b])


while the other integral

 Integrate[E^(-(r^2/2)) Sqrt[π/2] Erf[(b r  )/Sqrt], 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?

• The integration is prolly done by pattern-matching, and Mathematica fails to notice that they are more or less the same. – J. M. will be back soon Dec 15 '16 at 14:06
• Is the first function meant to be Erf[(b r/Sqrt] rather than Erf[(b r Sqrt].... If so is there a problem? – Ramble Dec 15 '16 at 19:03
• @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. – Sungmin Dec 15 '16 at 21:26