Showing that $f \in C^{\infty}(\mathbb{R},\mathbb{R})$ Let $f(x)=\begin{cases}
e^{-(1/x)} & \text{for} \quad x > 0 \\
0 & \text{for} \quad x \leq 0
\end{cases}$
Show that $f \in C^{\infty}(\mathbb{R},\mathbb{R})$
I need to show that $f(x)$ has derivatives of all orders at all points in $\mathbb{R}$. It is trivial for $x\leq 0$, critical at $x=0$ and not clear for $x > 0$. This is the point I have a problem with. I fail to show that $e^{\frac{1}{x}}$ has got derivatives of all orders in $\mathbb{R}$.
I can't find a generalization for the derivatives, as the polynomes are getting out of hand. 


*

*$f'(x)=\frac{f(x)}{x^2}$

*$f''(x)=\frac{f(x)}{x^4}(-2x+1)$

*$f'''(x)=\frac{f(x)}{x^6}(6x^2-6x+1)$

*$f^{IV}(x)=\frac{f(x)}{x^8}(-24x^3+36x^2-12x+1)$

*$f^{V}(x)=\frac{f(x)}{x^{10}}(120x^4-240x^3+120x^2-20x+1)$

*...


Is there some sort of theorem that could help me prove this? Or a generalisation of the derivatives that I do not see?
 A: You should be able to show $f$ is smooth for $x > 0$ by hand - just use the chain rule (both $\exp(x)$ and $1/x$ are smooth for $x >0$ is the point).
$x = 0$ is the tricky part. Let's first show it's differentiable at $0$. $$\lim \limits_{h \to 0^+} \frac{f(h)}{h} = \lim\limits_{h \to 0^+} \frac{e^{-1/h}}{h} = \lim_{x \to \infty^+} \frac{x}{e^x} = 0$$
Clearly the other limit is also $0$ because $f$ is the zero function on the negative half of $\Bbb R$. So $f'(0) = 0$, which also settles that it's continuously differentiable at $0$. We need to show $f^{(n)}(0) = 0$ for all $n >1$ by that same logic, and we'd have shown that it's smooth.
Check by induction that for $x > 0$, $f^{(n)}(x) = P_n(1/x)\exp(-1/x)$ where $P_n$ is some polynomial. Indeed, this is exactly the pattern you are getting in your list.
That being said, assume $f^{(k)}(0) = 0$. Then $$\lim_{h \to 0^+} \frac{f^{(k)}(h)}{h}=\lim_{h \to 0^+} P_k\left (\frac1h\right) \frac{\exp(-1/h)}h = \lim_{x \to +\infty}\frac{x P_k(x)}{\exp(x)} = 0$$
because $\exp(x)$ grows way faster than any polynomial. Hence, because the other limit is also $0$, $f^{(k+1)}(0) = 0$. By induction you're done.

As a note, these sort of functions are the building-blocks for things known as "bump functions", which are functions on $\Bbb R$ (or in general $\Bbb R^n$) which are zero outside a compact subset. The fancy word for this is "compactly supported". These are all everywhere smooth, but not analytic at some points (e.g, the one above is not analytic at $0$ because if it was the Taylor series would have given that it's the zero function near a neighborhood of $0$ which is obviously garbage). This class of functions are immensely useful in both analysis and smooth manifold topology.
A: One can show by induction that
$$
f^{(k)}(x) = \begin{cases} 0 \quad  (x \le 0) \\
f(x) \frac{p_k(x)}{x^{2k}} \quad (x > 0) 
\end{cases}
$$
where $p_k$ is a polynomial of degree $k-1$. (The exact form of $p_k$ is not needed). This implies in particular that $f^{(k)}$ is continuous across $0$ for all $k$ and consequently $f \in C^{\infty}$. 
