Is $ f(x) = \left\{ \begin{array}{lr} 0 & : x = 0 \\ e^{-1/x^{2}} & : x \neq 0 \end{array} \right. $ infinitely differentiable on all of $\mathbb{R}$?
Solution 1:
For $x\neq 0$ you get: $$\begin{split} f^\prime (x) &= \frac{2}{x^3}\ f(x)\\ f^{\prime \prime} (x) &= 2\left( \frac{2}{x^6} - \frac{3}{x^4}\right)\ f(x)\\ f^{\prime \prime \prime} (x) &= 4\left( \frac{2}{x^9} - \frac{9}{x^7} +\frac{6}{x^5} \right)\ f(x) \end{split}$$ In the above equalities you can see a path, i.e.: $$\tag{1} f^{(n)} (x) = P_{3n}\left( \frac{1}{x}\right)\ f(x)$$ where $P_{3n}(t)$ is a polynomial of degree $3n$ in $t$.
Formula (1) can be proved by induction. You have three base case, hence you have only to prove the inductive step. So, assume (1) holds for $n$ and evaluate: $$\begin{split} f^{(n+1)} (x) &= \left( P_{3n}\left( \frac{1}{x}\right)\ f(x) \right)^\prime\\ &= -\frac{1}{x^2}\ \dot{P}_{3n} \left( \frac{1}{x}\right)\ f(x) + P_{3n} \left( \frac{1}{x}\right)\ f^\prime (x)\\ &= \left[ -\frac{1}{x^2}\ \dot{P}_{3n} \left( \frac{1}{x}\right) +\frac{2}{x^3}\ P_{3n} \left( \frac{1}{x}\right)\right]\ f(x)\\ &= \left[ -t^2\ \dot{P}_{3n}( t) +2t^3\ P_{3n}( t)\right]_{t=1/x}\ f(x) \end{split}$$ where the dot means derivative w.r.t. the dummy variable $t$; now the function $-t^2\ \dot{P}_{3n}( t) +2t^3\ P_{3n}( t)$ is a polynomial in $t$ of degree $3n+3=3(n+1)$, therefore: $$f^{(n+1)}(x) = P_{3(n+1)} \left( \frac{1}{x}\right)\ f(x)$$ as you wanted.
Formula (1) proves that $f\in C^\infty (\mathbb{R}\setminus \{0\})$.
Now, for each fixed $n$, you have: $$\lim_{x\to 0} f^{(n)}(x) = \lim_{x\to 0} P_{3n}\left( \frac{1}{x}\right)\ f(x) =0$$ for $f\in \text{o}(1/x^{3n})$ as $x\to 0$. Therefore, by an elementary consequence of Lagrange's Mean Value Theorem, any derivative of your functions is differentiable also in $0$. Thus $f\in C^\infty (\mathbb{R})$.