Is it possible to write the function $f(x) = i \textrm{erf} (ix)$ (with $i$ imaginary unit) in a way that doesn't involve complex numbers? Studying a physical problem I crashed into this differential equation (condition: $\lim_{x \to 0} = 0$)
\begin{equation*}
y' + A x y + B x^4 = 0 
\end{equation*}
where $x,A,B \in \mathbb{R}^+$. With the help of a good book and of a good software I founded
\begin{equation*}
y(x) = \frac{3B}{A^2} \sqrt{\frac{\pi}{2A}} e^{-\frac{Ax^2}{2}} 
\textrm{erf} \left( i x \sqrt{\frac{A}{2}} \right) i - \frac{B}{A} x^3 + \frac{3B}{A^2} x
\end{equation*}
I checked that this is really the solution I was looking for, but I have a problem: I want to use this function into a spreadsheet, whose erf doesn't accept imaginary number. So I wonder if it is possible to write my $y(x)$ in a way that doesn't involve imaginary number. The problem is clearly in the odd function $ f(x) = i \textrm{erf} (ix)$  (despite the appearance, a $\mathbb{R} \to \mathbb{R}$ function). I sketch this function here near the origin (I'm interested to the right side $x \in \mathbb{R}^+$). Thanks a lot!


The imaginary error function ${\rm erfi}(z)$ is defined by
$${\rm erfi}(z)=-i{\rm erf}(iz)=\frac{2}{\sqrt{\pi}}\int_0^{iz}e^{-t^2}d(-it)=\frac{2}{\sqrt{\pi}}\int_0^z e^{u^2}du. $$
This follows from the substitution $u=-it$ (and complex analysis allows us to handle nonreal bounds on the integral; it becomes a path integral in the complex plane).
