Density of smooth functions in $C([0,1])$ How can I show that smooth functions are dense in the space of continuous function on $[0,1]$? I know that we can use mollifiers. I wiki-ed it but can someone give me a rigorous proof?
 A: The original proof of Weierstrass used the heat kernel to approximate continuous functions by smooth functions; Weierstrass then expanded the heat kernel in a power series to obtain a polynomial approximation.
Start with a continuous function $f$ on $[0,1]$. Extend your function from $[0,1]$ to be continuous on $\mathbb{R}$ and to vanish outside $[-\delta,1+\delta]$ for some $\delta > 0$. Consider
$$
           u(t,x)=\frac{1}{\sqrt{4\pi t}}\int_{-\infty}^{\infty}e^{-(x-y)^{2}/4t}f(y)dy.
$$
This function naturally arises in the solution of the heat equation $u_{t}=u_{xx}$ with initial heat distribution $u(0,x)=f(x)$. As $t\downarrow 0$, the function $u(t,x)$ converges uniformly to $f(x)$ on $\mathbb{R}$, and $u(t,x)$ is infinitely differentiable in $x$ for any fixed $t > 0$. The argument for this uses properties of the heat kernel
$$
               H(t,x) = \frac{1}{\sqrt{4\pi t}}e^{-x^{2}/4t}.
$$
For example,


*

*$H(t,x) \ge 0$ for all $t > 0$, $x\in\mathbb{R}$;

*$\int_{-\infty}^{\infty}H(t,x)dx = 1,\;\;\; t > 0$;

*$\lim_{t\downarrow 0}\int_{|x|\ge \delta}H(t,x)dx =0$ for fixed $\delta > 0$.


So, let $\epsilon > 0$ be given. By uniform continuity of $f$ on $\mathbb{R}$, there exists $\delta > 0$ such that $|f(x)-f(y)| < \epsilon/2$ whenever $|x-y| < \delta$. Therefore,
$$
    u(t,x)-f(x) = \int_{-\infty}^{\infty}H(t,x-y)(f(y)-f(x))dy.
$$
Hence, if $M$ is a bound for $f$ on $\mathbb{R}$,
$$
   |u(t,x)-f(x)| \le \int_{x-\delta/2}^{x+\delta/2}H(t,x-y)|f(y)-f(x)|dy
                     +2M\int_{\delta/2}^{\infty}H(t,y)dy \\
            \le \epsilon/2+2M\int_{\delta/2}^{\infty}H(t,y)dy.
$$
Therefore, there exists $t_0 > 0$ such that
$$
           |u(t,x)-f(x)| < \epsilon,\;\;\; 0 < t < t_0.
$$
Then, if you want a polynomial approximation, you can expand the heat kernel in a power series and approximate on a finite interval for some fixed $t \in (0,t_0)$:
$$
                 H(t,y-x) \approx \frac{1}{\sqrt{4\pi t}}\sum_{n=0}^{N}\frac{1}{n!}\left(\frac{(y-x)^{2}}{4t}\right)^{n}.
$$
Therefore, $u \approx f$ and
$$
             u(x,t) \approx \sum_{n=0}^{N}\int_{-\delta}^{1+\delta}f(y)\frac{(x-y)^{2n}}{\sqrt{\pi}(4t)^{n+1/2}}dy
       = a_0 +a_1 x +a_2 x^{2}+ \cdots +a_{2n} x^{2n}.
$$
A: Define the sequence of polynomials $(P_{n}(t))_{n=0}^{\infty}$ with $P_{n}(t)=t^{n}$, $\forall t \in [0,1], \forall n=0,1, \cdots$. The set $A=\{P_{n}: n=0,1, \cdots\}$ is countable. So we have to prove that $\overline{[A]}=C([0,1])$. 
Let $f \in C([0,1])$ and $\epsilon>0$. From the Stone-Weierstrass theorem we know that there exists a polynomial $P:[0,1] \rightarrow \mathbb{R}$ such that $$||f-P||_{\infty}<\epsilon$$
But this polynomial has to be of the following form
$$P(t)=a_{0}+a_{1}t+\cdots+ a_{m}t^{m}$$
which means that $P \in [A]$. So, we showed that the intersection of the open ball with center f and radius $\epsilon$ with $[A]$ is not the empty set. Therefore, f is a limit point of $[A]$ and that means that the closure of $[A]$ is equal to $C([0,1])$.
