If you take this function:
$f(x) = \frac {e^{-x^2}}{1-erf(x)}$
and ask software like Wolfram Alpha to give you a Taylor expansion at infinity, it will output this:
$f(x) \approx \sqrt \pi x + \frac {\sqrt \pi} {2 x} - \frac {\sqrt \pi} {2 x^3} + \frac {5 \sqrt \pi} {4 x^5} + O((\frac 1 x)^6)$
This is very nice, and in some systems it works even better than the function itself when one wants to calculate $f(x)$ for $x > 5$.
However, I would like to understand how such result is obtained, or more precisely, how one could do it without recurring to CAS.
I looked up 'Taylor expansion at infinity', and found several posts and resources describing the $x = \frac 1 y$ substitution trick to be able to do an expansion at $0$.
In most cases, however, the functions being handled could be manipulated into the product of some rational term not defined at $0$ (e.g. $\frac 1 y$ itself) and a function $h(y)$ that was defined and differentiable at $0$, so one could expand $h(y)$, multiply it by the left-out factor and do the back-substitution $y = \frac 1 x$.
I would say this is not possible with my $f(x)$, is it?
$h(y) = \frac {e^{-{\frac 1 {y^2}}}}{1-erf(\frac 1 y )}$
Where do I go from here? What do I factor out?
In this post it is suggested to differentiate the function (after the $x = \frac 1 y$ substitution), yielding an expression that can then be 'Taylored' to a polynomial and integrated to get the Taylor expansion of the original function.
But again, not only the expression one manipulates is rational, but also defined and differentiable at $0$...
This still does not work in my case, I think.
$h'(y) = \frac {2 e^{- \frac 1 {y^2}}} {y^3 (1-erf(\frac 1 y))} - \frac {2 e^{- \frac 2 {y^2}}} {\sqrt \pi y^2 (1-erf(\frac 1 y))^2}$
I really do not see how this expression takes me any further in solving the problem.
I also considered expanding separately the numerator and denominator of my $f(x)$.
It turns out that the numerator cannot be expanded at infinity (that's what Wolfram Alpha says), and for $erf(x)$, Wolfram Alpha yields this:
$erf(x) \approx e^{- x^2} (- \frac {1} {\sqrt \pi x} + \frac {1} {2 \sqrt \pi x^3} - \frac {3} {4 \sqrt \pi x^5} + O((\frac 1 x)^7) + 1$
Obviously I can see that if I use this expression, my $f(x)$ becomes:
$f(x) \approx \frac {e^{- x^2}} {1 - [e^{- x^2} (- \frac {1} {\sqrt \pi x} + \frac {1} {2 \sqrt \pi x^3} - \frac {3} {4 \sqrt \pi x^5} + O((\frac 1 x)^7) + 1]} = \frac {1} {\frac {1} {\sqrt \pi x} - \frac {1} {2 \sqrt \pi x^3} + \frac {3} {4 \sqrt \pi x^5} + O((\frac 1 x)^7}$
which is yet another expression yielding a pretty close approximation of my function for $x > 5$.
But again, I have no idea how that expression was obtained, or in fact why there is a $e^{- x^2}$ factor in it, as I assumed all Taylor expansions (or Laurent etc.) could only have powers of $x$.
Could anybody please tell me where I am going wrong / point me to posts or resources explaining how to do this without recurring to CAS?
Thanks!