I am asked to show that
$$\text{erf}(x) \approx 1 - \frac{1}{\sqrt{\pi}}\frac{1}{x}e^{-x^2}$$
in a computational project. Numerically it is really easy to show that this approximation makes sense. I want, however, to look for the process that allowed someone to come up with this approximation.
For that matter, I assumed maybe one could do something like a Taylor expansion "around infinity".
I typed
Series[Erf[x], {x, Infinity, 1}]
in mathematica and it gave me this exact approximation. I browsed online for how to "expand a function around $\infty$" and assuming everything works (i.e. without worrying about the details that let me write a given expression and whatnot)
I defined $$f(x) = \text{erf}\left(\frac{1}{x}\right) = \frac{2}{\sqrt{\pi}}\int_0^{\frac{1}{x}} e^{-\xi^2}d\xi$$
and then decided to expand $f$ around $\epsilon$ where we would have
$$f(\epsilon) \approx f(x) + (\epsilon - x)f'(x)$$
and then I computed $f'(x)$:
$$f'(x) = \frac{2}{\sqrt{\pi}} \left(\int_0^{\frac{1}{x}} e^{-\xi^2}d\xi \right)' = \frac{2}{\sqrt{\pi}}\left(\frac{1}{x} \right)' e^{-\frac{1}{x^2}} = -\frac{2}{\sqrt{\pi}}\frac{1}{x^2}e^{-\frac{1}{x^2}}$$
plugging that in the first expression and letting $\epsilon \to 0$ gives
$$1 \approx \text{erf}\left(\frac{1}{x}\right) + \frac{2}{\sqrt{\pi}}\frac{1}{x}e^{-\frac{1}{x^2}}$$
then writing $y = 1/x$ gives $$\text{erf}(y) \approx 1 - \frac{2}{\sqrt{\pi}}ye^{-y^2}$$ which is close, but not quite what I am looking for... Where did I make a mistake??
From the initial formula
$$(\text{erf}(x))'\approx\frac2{\sqrt\pi}e^{-x^2}+\frac1{\sqrt\pi x^2}e^{-x^2}.$$
The second term is tiny in front of the first.