Differentiable approximation $f(x) = x$ for $x>0$ and $0$ otherwise. I would like to find a twice continuously differentiable approximation of 
$$f(x)= \begin{cases} 
      0 & x\leq 0 \\
      x & x>0. \\
   \end{cases}$$
Are there any approximations which are not defined piece-wise? Ideally, I'd like an approximation that will allow me to control the error given some norm.

For a general method of approximation, the convolution is really usefull. Take a positive function of $C^{\infty}_c([-1,1])$, as an exemple, 
$$g(x) = \exp\left({-\frac{2}{(x-1)(x+1)}}\right)$$
Let's normalise it :
$$g_{norm}(x) = \frac{g(x)}{\int_{-1}^1 g(t) dt}$$
Then we define
$$g_{\epsilon}(x) = \frac{1}{\epsilon} g_{norm}(\frac{x}{\epsilon})$$
Then, for every $f \in L^1_{loc}$ you have that $g_{\epsilon} \star f \to f$ uniformly and that $g_{\epsilon} \star f \in C^{\infty}$ 
You also have $g_{\epsilon} \star f \to f$ in all $L^p$.
But I don't remember the error estimate...
