Is $\{f\in H^1;\;\int f=0\}$ dense in $\{f\in L^2;\;\int f=0\}$? Let $L_*^2=\left\{f\in L^2(a,b);\;\int_a^b f\;dx=0\right\}$ and $H_*^1=\left\{f\in H^1(a,b);\;\int_a^b f\;dx=0\right\}$, where  $-\infty<a<b<\infty$.
Is $H_*^1$ dense in $(L_*^2,\|\cdot\|_{L^2})$?
Thanks.
 A: The answer is YES. 
We know that every $f\in L^2(a,b)$ can be $L^2$-approximated by continuous functions in $[a,b]$. For example, this can be done with Fourier series - If $f\in L^2(a,b)$, then 
$$
f(x)=\sum_{k\in\mathbb Z}\hat f_{\!\!k}\,\mathrm{e}^{ik\frac{2\pi}{b-a}x},
$$
where $\hat f_{\!\!k}=\frac{1}{b-a}\int_a^b f(x)\,\mathrm{e}^{-ik\frac{2\pi}{b-a}x}\,dx$, and with
$$
\|f\|_{L^2(a,b)}^2=(b-a)\sum_{k\in\mathbb Z}|\,\hat f_{\!\!k}|^2.
$$ 
Then for any $\varepsilon>0$, there exists a sufficiently large $n$, such that
$$
\|f-f_n\|_{L^2(a,b)}<\varepsilon,
$$
where 
$$
f_n(x)=\sum_{|k|\le n}\hat {f_k}\,\mathrm{e}^{ik\frac{2\pi}{b-a}x}, \tag{1}
$$ 
and clearly $f_n\in C[a,b]$. In fact $f_n\in C^\infty[a,b]$ and in particular $f_n\in H^1(a,b)$.
If in particular $f\in L_*^2(a,b)$, then $\hat {f_0}=\frac{1}{b-a}\int_a^b f(x)\,dx=0$, and thus $f_n$, as defined by $(1)$ will also have a vanishing $\hat {f_0}$ term, and hence 
$$
\int_a^b f_n(x)\,dx=0,
$$
as well. In fact, this means that $f_n\in H^1_*(a,b)$.
