# Asymptotic expansion of a function

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!

• What do you do with Stirling approximation ? You use the asymptotics which are series. Don't you agree ? Mar 13, 2021 at 9:44
• In general a common tool to obtain the asymptotic of various integral (such as the error function) is to use the saddle point approximation. This has different names in different context but there is a big literature on it.
– lcv
Nov 22, 2022 at 12:51

$$f(x)=\frac{e^{-x^2}}{1-\text{erf}(x)}\implies \frac 1{f(x)}=e^{x^2} (1-\text{erf}(x))$$ The asymptotics of $$\text{erf}(x)$$ being $$\text{erf}(x)=1+e^{-x^2} \left(-\frac{1}{\sqrt{\pi } x}+\frac{1}{2 \sqrt{\pi } x^3}-\frac{3}{4 \sqrt{\pi } x^5}+O\left(\frac{1}{x^7}\right)\right)$$ $$\frac 1{f(x)}=\frac{1}{\sqrt{\pi } x}-\frac{1}{2 \sqrt{\pi } x^3}+\frac{3}{4 \sqrt{\pi } x^5}+O\left(\frac{1}{x^7}\right)$$ Now, long division $$f(x)=\sqrt{\pi } x+\frac{\sqrt{\pi }}{2 x}-\frac{\sqrt{\pi }}{2 x^3}+O\left(\frac{1}{x^5}\right)$$
• Just a supplement: the asymptotics (if unknown) of $$\frac1{f(x)}=\frac{2e^{x^2}}{\sqrt\pi}\int_x^\infty e^{-y^2}\,dy=\frac2{\sqrt\pi}\int_0^\infty e^{-z^2-2xz}\,dz$$ (as $x\to\infty$) is readily obtained using Watson's lemma. Mar 13, 2021 at 10:30
• Thank you @metamorphy , I upvoted your comment because you explained where the formula came from. I see that you did $1-erf(x) = erfc(x)$, and expressed the latter by its integral definition. Then you took $e^{x^2}$ into the integral, I have no idea how. When I match the final formula to Watson's lemma, I find $\phi (z) = e^{-xz-z^2}, \lambda = 0$, which by application of the formula still does not give me the correct answer, so I am probably still doing something wrong, but OK, at least there is a concept of how this might be done. Thanks! Mar 13, 2021 at 14:46