# Erfi[z] expansion in Mathematica: is this a bug?

Looking at the expansion:

Series[Erfi[x], {x, Infinity, 1}]


I obtain

-I+E^x^2 (1/(Sqrt[\[Pi]] x)+O[1/x]^2)


(note the imaginary argument in front). This looks wrong as I don't think there should be an imaginary number out front; I had thought that this was due to some branch cut about the positive x axis, but this doesn't look like the case. Looking at the output of Mupad (in Matlab), I obtain the correct expansion listed in the response here.

Is this a bug?

-
The basis of the expansion about infinity can be found here: mathworld.wolfram.com/Erfi.html –  ubpdqn Jul 29 '13 at 10:03

The problem is subtle, and relies on the fact that Mathematica and Maple seem to define the erfi(z) function differently. Mathematica defines erfi(z) as

erfi(z) = -i erf(iz)


whereas Maple defines it according to

So I think what is happening is that Mathematica expands -i erf(iz). The expansion for erf(iz) is

1 + exp(z^2)/(sqrt(Pi)*z) + ...


so multiply by -i to obtain the strange answer in the original post. However, if you look at the integral definition, you see that the answer should be real if z is real. I believe Maple and Mupad are expanding the integral, and thus obtaining the 'correct' expansion at z real and infinity.

Mathematica is using an expansion for the erf(iz) function at z = infinity, and so making an expansion about the imaginary axis. Because of the way complex functions work, this may not be exactly the same thing.

-