# Sequence of smooth functions converging to the modulus function

Construct a set of functions $\{g_\epsilon(x) \}$, such that for every $\epsilon > 0, \; g_\epsilon(x)$ is infinitely differentiable and $$g_\epsilon \rightarrow f,$$ where $f(x) = |x|,$ in the sup norm as $\epsilon \downarrow 0$.

-

Try $f_\varepsilon(x):=\sqrt{x^2+\varepsilon}$.

-

Let the sequence $\{\phi_\epsilon\}$ be a mollifier. If $f$ is any continuous function, then the convolutions $g_\epsilon(x) := (f * \phi_\epsilon) (x) := \int f(y) \phi_\epsilon(x-y) dy$ converge uniformly on compact sets to $f$ as $\epsilon \rightarrow 0$.

In fact, we can choose $\phi_\epsilon=\epsilon^{-1} \phi(\epsilon^{-1}x)$, where $\phi$ has integral $\int_\mathbb{R} \phi(y)dy =1$. Then we have $$g_\epsilon (x) =\int_{-\epsilon}^\epsilon f(y) \phi_\epsilon(x-y) dy = \int_{-1}^1 f(x-\epsilon y) \phi(y) dy$$ and $$|g_\epsilon(x)-f(x)| \leq |\int_{-1}^1 f(x-\epsilon y) \phi(y) dy - f(x)| =\int_{-1}^1 \phi(y)|f(x-\epsilon y) - f(x)| dy$$ For $x \in K$, a compact set, $f$ is uniformly continuous, taking the limit as $\epsilon \rightarrow 0$ shows that $g_\epsilon \rightarrow f$ on $K$.

-
... but $\mathbb{R}$ is not compact (I assume the OP wants $\lim_{\epsilon \to 0} \sup |f(x) - g_\epsilon(x)| = 0$). In this case however we can explicitly choose a mollifier such that $g_\epsilon \equiv f$ outside $B_{\epsilon}$. – Willie Wong Nov 20 '12 at 12:47
@WillieWong, you are right. I guess the mollifier approach only gives convergence on compact sets. Am I right? – Cantor Nov 20 '12 at 13:15
Well... it allows you to directly conclude (without needing to argue it yourself) that we have convergence on compact sets. But in our case $f$ is much better than just continuous: it is globally Lipschitz... – Willie Wong Nov 20 '12 at 13:19
@WillieWong: If we take $g_epsilon = f$ outside $B_\epsilon$ will $g_\epsilon$ still be smooth? what happens at points $\{-\varepsilon, \varepsilon \}$? – Arunangshu Biswas Nov 22 '12 at 13:02
@ArunangshuBiswas There is nothing that prevents $g_\epsilon$ to be smooth even it it equals $f$ outside $B_\epsilon$, so long as $f$ itself is smooth outside $B_\epsilon$. For example, if you take the mollifier $\phi_\epsilon$ to be an even function, you can manifestly check that in this case ($f(x) = |x|$) outside of $B_\epsilon$ we do have $g_\epsilon \equiv f$. – Willie Wong Nov 22 '12 at 13:40