# Smoothing continuous functions

Asked the wrong question. Try again.

Let $f$ be continuous on [a,b] and suppose f is differentiable at all but a finite number of points. Given an $\epsilon$ can we find a g differentiable on all of [a, b] such that

1. f(x) = g(x) except on a set of measure < $\epsilon$
2. would it be true with countable number of points not differentiable
-
This is true from uniform convergence theorem in Fourier series except countable case. – HK Lee Oct 13 '13 at 2:22
By Weierstraß' approximation theorem, you can uniformly approximate every continuous function on a compact interval by polynomials. – Daniel Fischer Oct 13 '13 at 2:25
@DanielFischer so true -- why am I so dense? – Betty Mock Oct 13 '13 at 3:21
@DanielFischer asked the wrong question -- no wonder the answer was easy. Would you look at it again? – Betty Mock Oct 13 '13 at 3:34
For finitely many points, you can. Pick a small interval around each problematic point, and do some smoothing there, leaving the other parts unchanged. For infinitely many points, I'm not sure. If you have only finitely many accumulation points of the non-differentiabilities, it works again, but if the set is dense, for example, I doubt it (but I'm not sure that you can't). – Daniel Fischer Oct 13 '13 at 12:03

The answer is yes. It suffices to assume that the set $E$ of non-differentiability has Lebesgue measure zero. Indeed, such $E$ is contained in an open set $U$ of measure less than $\epsilon$. (When $E$ is countable, $U$ can be constructed as countable union of intervals of length $\epsilon/2^n$.) Being open, $U$ is the union of disjoint intervals $(a_n,b_n)$. On each such interval, construct a smooth function $g_n$ such that
1. $g_n(a_n)=f(a_n)$, $g_n(b_n)=f(b_n)$, $g_n'(a_n)=f'(a_n)$, $g_n'(b_n)=f'(b_n)$.
2. $|g_n(x)-f(x)|\le C\min(x-a,b-x)^2$ where $C$ is independent of $n$
Define $g= g_n$ on $(a_n,b_n)$ and $g=f$ on $U^c$. Using properties (1)-(2), check that the new function is differentiable at every point of $\partial U$. Property (2) will help to handle the points $y\in \partial U$ such that every neighborhood of $y$ contains infinitely many intervals $(a_n,b_n)$.