# Taylor series, the n-term calculation

Good afternoon. I need to claculate the general n-term Taylor's expansion at zero of 2 functions:

1. $$e^{-x^2}$$
2. $$e^{-\frac{1}{x^2}}$$ if $$x \ne 0$$ and $$0$$ otherwise

For the first function everything seems easy.

First derivative is $$-2x e^{-x^2}$$, which is $$0$$

Second derivative is $$-2 e^{-x^2} + 4x^2 e^{-x^2}$$, which is $$-2$$

Third derivative is zero again

4th is $$12 e^{-x^2} - 48x^2 e^{-x^2} + 16x^4 e^{-x^2}$$ which is $$12$$

In the end after a few more calculation I realised that odd derivatives are equal to zero and then the form of th answer is something like $$\frac{(-x^2)^n}{n!}$$

Now, for the second function I instantly ran into a problem of derivative being undefined at zero. How do I deal with that?

• All the derivatives at $0$ for the second function are $0$. – Kavi Rama Murthy Apr 15 at 8:42
• Thank you for your reply, but correct me if I'm wrong: the first derivative is $e^{-\frac{1}{x^2}}*\frac{2}{x^3}$ which is kinda not $0$ at $x = 0$, right? – Makina Apr 15 at 8:45

The function $$e^{-1/x^2}$$ is a pathological one. All its derivatives are zero, so that all its Taylor polynomials are identically zero. This does not invalidate Taylor's theorem: the whole function is supplied by the remainder of the expansion.
Sometimes it is easier to work directly with known series rather than applying Taylor's Theorem. For your first problem, for example, note that $$e^t = \sum_{n=0}^{\infty} \frac{1}{n!} t^n$$ so substituting $$t=-x^2$$, $$e^{-x^2} = \sum_{n=0}^{\infty} (-1)^n \frac{1}{n!} x^{2n}$$
• You should complete the argument by saying that this is the Taylor series of $e^{-x^2}$, and not just some entire series. – Yves Daoust Apr 15 at 12:40