# Infinitely differentiable functions with compact support are dense in $L^p$

This problem is in Stein.

In $$L^p$$, $$1\leq p<\infty$$ on $$\mathbb{R}^d$$ with measure lebesgue.

(a) Continuous function with comppact support are dense in $$L^p$$. I have already proves this :) (b) Infinitely differentiable functions with compact support are dense in $$L^p$$.

How proves (b)? I read that this hard...

The argument I know depends on a few facts.

• Consider the convolution $$(f*g)(x)=\int_{\mathbb R^d} f(t)\,g(x-t)\, dt.$$

• One can show that if $$f\in L^p$$ and $$g\in L^1$$, then $$\|f*g\|_p\leq\|f\|_p\|g\|_1.$$ so $$f*g\in L^p$$.

• If $$f\in L^p$$, $$g\in C^r(\mathbb R^d)$$ with compact support and $$D$$ is a mixed partial derivative of order $$m$$, then $$D(f*g)(x)=(f*Dg)(x).$$ In particular, $$f*g\in C^r(\mathbb R^d)$$. So if $$g\in C^\infty$$, so does $$f*g$$.

• Let $$f\in L^p(\mathbb R^d)$$, $$g\in L^1(\mathbb R^d)$$ with $$\int_{\mathbb R^d} g=1$$. Let $$g_n(x)=n^d\,g(nx)$$. Then $$\lim_{n\to\infty}\|f-f*g_n\|_p=0.$$

• Since the compactly supported functions are dense in $$L^p$$, we may assume that $$f$$ is compactly supported. Then the functions $$f*g_n$$ from above are compactly supported.

• Take $$g$$ to be any compactly supported $$C^\infty$$ function with $$\int_{\mathbb R^d} g=1$$, we get that $$f$$ is a limit of compactly supported infinitely differentiable functions.

• Finally, it remains to construct a nonozero infinitely differentiable, compactly supported function. Start with $$h_1(t)=\begin{cases} e^{-1/x^2},&\ x>0\\ 0,&\ x\leq0\end{cases}$$ Then $$h_1\in C^\infty(\mathbb R)$$. Now, given any interval $$[a,b]$$, form $$h_{a,b}(x)=h_1(x-a)h_1(b-x).$$ Then $$h_{a,b}\in C^\infty(\mathbb R)$$ with support in $$[a,b]$$. Now given any box $$B=\prod_{j=1}^d[a_j,b_j]\subset \mathbb R^d$$, the function $$g_B(x)=h_{a_1,b_1}(x_1)\cdots h_{a_d,b_d}(x_d)$$ is nonzero, $$C^\infty$$, and with support in $$B$$.