TITLE: Schwartz functions dense?
QUESTION [8 upvotes]: I want to show that the Schwartz functions are dense in 
$$\left\{f \in L^2; \int |x|^2 \left|f(x)\right|^2 dx + \int |\xi|^2 \left|\hat{f}(\xi)\right|^2 d \xi < \infty\right\}$$
where the norm is given by $$\left\lVert f\right\rVert_{L^2}^2 = \int (1+|x|^2) |f(x)|^2 dx + \int \left(1+|\xi|^2\right) \left|\hat{f}(\xi)\right|^2 d \xi.$$
If we would only have one summand, then this would be a $H^1-$ Sobolev summand norm and for this space I know that this is true, but how can I show this for this more general norm?

REPLY [2 votes]: I am obviously two years late, but I was intrigued by the question and when it turned out that it has a fairly simple solution I realized that I might as well post it here.
Observe that for $d\in \mathbb N$ the norm 
$$
\|f\|^2 := \|(1+|\cdot|^2) f\|_{L^2(\mathbb R^d)}^2 + \|(1+|\cdot|^2) \hat{f}\|_{L^2(\mathbb R^d)}^2
$$
is equivalent to the norm 
$$
\|f\|_{H} := \|f\|_{H^1(\mathbb R^d)} + \|\hat{f}\|_{H^1(\mathbb R^d)},
$$
so we might as well show density of $S(\mathbb R^d)$ in $H := \{f\in L^2(\mathbb R^d): \|f\|_H <\infty\}$ with respect to $\|\cdot\|_{H}$. 
We define $g_n(x) := e^{-(x/n)^2}$ and $h_n(x) = n^{d}e^{-{(xn)^2}}$. Let $f\in H$ then we define $f_n = (f g_n) * h_n$. It is clear, from analyzing smoothness and decay that $f_n \in S(\mathbb R^d)$. Moreover, it is easily observed by standard properties of the Fourier transform that $\hat{f_n}= (\hat{f} * h_n) g_n$ (Up to constants depending on your favorite definition of the Fourier transform). As a consequence, we only need to show that 
$$
\|f - f_n\|_{H^1(\mathbb R^d)} \to 0 \text{ and } \|\hat{f} - \hat{f}_n\|_{H^1(\mathbb R^d)} \to 0,
$$
but by the symmetry of the problem it will be sufficient to show $\|f - f_n\|_{H^1(\mathbb R^d)} \to 0$ and claim that the second convergence follows similarly.
We have that
\begin{align}
\|f - f_n\|_{H^1(\mathbb R^d)} \leq& \|f - f * h_n\|_{H^1(\mathbb R^d)} + \|f * h_n - (fg_n) * h_n\|_{H^1(\mathbb R^d)}\\ \leq& \|f - f * h_n\|_{H^1(\mathbb R^d)} + \|f - (fg_n)\|_{H^1(\mathbb R^d)} \sup_{n\in \mathbb N} \|h_n\|_{L^1(\mathbb R^d)}, \label{eq:terms}
\end{align}
where the last estimate is by Young's inequality and the fact that $D_i((f - fg_n) * h_n) = D_i(f - fg_n) * h_n$ for all directional derivatives $D_i$. It is easily checked that $\|h_n\|_{L^1} = 1$ for all $n\in \mathbb N$. The first term in the estimate above converges to $0$ by standard arguments for mollifiers. To estimate the second term, observe that $\|g_n\|_{C^1}$ is uniformly bounded, $g_n \to 1$ pointwise and $D_i g_n \to 0$ pointwise for all directional derivatives $D_i$. Thus, by the Leibniz rule and the theorem of dominated convergence the second term above converges to $0$. 
It is not hard to see that a very similar but more technical argument works, if we alternatively define
$
\|f\|_{H}: = \|f\|_{H^m} + \|\hat{f}\|_{H^m}.
$