TITLE: Contradiction between Taylor's theorem and properties of the Taylor series of $f(x)=e^{-1/x^2}$?
QUESTION [5 upvotes]: It seems to me that there is a contradiction between the Taylor's theorem and the properties of the Taylor series of the function $f(x)=e^{-1/x^2}$ if $x\ne0$ and $f(x)=0$ if $x=0$.
On the one side, with the above extension $f$ is $C^\infty$ at $x=0$ and the Taylor series $TS[f]_0(x)$ of $f(x)$ at $x=0$ is identically null with a radius of convergence $R_c=\infty$, whereas $f(x)\ne 0$ for $x \ne 0$. As a consequence, $TS[f]_0(x)\ne f(x)$,  $\forall x\ne0$.
On the other side, Taylor's theorem states that an expansion at the order $n$ gives:
$f(x)=f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^2+...+\frac{f^{(n)}}{n!}x^n+h_n(x)x^n, \qquad$ with $\lim_{x\rightarrow0}h_n(x)=0$
So this means that we should get better approximations of $f(x)$ when $n$ increases. Which is then not the case in this particular example as increasing $n$ doesn't make a difference in the polynomial expansion.
Now, what is the problem here? Is it that we cannot apply Taylor's theorem in this particular case, and if so, why? Or is it that it is wrong to express the rest as $h_n(x)x^n$ with $\lim_{x\rightarrow0}h_n(x)=0$?
Alternatively, what special properties could have the functions $h_n(x)$ that doesn't make $h_n(x)x^n$ become smaller when $n$ increases?
Or am I missing something else?

REPLY [2 votes]: Taylor's theorem is perfectly true, even in this case. Simply, the value of the function is entirely in its complementary term. This is one case where the Taylor's series does not converge to the value of the function.
$\mathcal C^\infty$ functions with a Taylor's series which converge to the value of a function are called analytic functions.
Thus you see analytic functions and $\mathcal C^\infty$ *functions are different notions, for functions of a real variable.
For functions of a complex variable, the situations is quite different: a function which is differentiable is ipso facto $\mathcal C^\infty$  and analytic.