Q:

Is $C_0^\infty$ dense in $L^p$?

I have a question concerning the Lebesgue spaces:
Is $C_0^\infty$ dense in $L^p$ ?
And if yes, why?
Thanks!

A:

Yes. First of all, it is enough to see that any function in $L^p$ with compact support can be approximated in the $L^p$ norm by $C_0^\infty$ functions.
Take $\phi\in C_0^\infty$, $\phi\ge0$ and $\int\phi(x)\,dx=1$, and define for $\epsilon>0$ $\phi_\epsilon(x)=\epsilon^{-1}\phi(x/\epsilon)$. If $f\in L^p$ with compact support, then $\phi_\epsilon\ast f$ has compact support, is of class $C^\infty$ and $\phi_\epsilon\ast f$ converges to $f$ in $L^p$.

