Hi I am trying to work on the following problem:
(a) $C_0^1(\Omega)$ is dense in $L_2(\Omega)$
(b) $C_0^1(\Omega)$ is dense in $H_0^1(\Omega)$.
(c) Explain why $C_0^1(\Omega)$ is not dense in $H^1(\Omega)$.
I know how to do (a) and (b) but I couldn't find how to solve (c). Any help would greatly appreciated. Thanks in advance.
So By following the comments given below I got
$$f_n(x)=\begin{cases}n^2x^2,\,\,\,\,\,\,\,0\le x\le\frac{1}{n}\\1,\,\,\,\,\,\,\,\frac{1}{n}\le x\le 1-\frac{1}{n}\\n^2x^2,\,\,\,\,\,\,\,1-\frac{1}{n}\le x\le 1\end{cases}$$
Clearly $f_n(x)\to 1$ but $f(x)=1\not\in C_0^1(\Omega)$ where as $f_n(x)\in C_0^1$, therefore $C_0^1(\Omega)$ is not dense in $H^1(\Omega)$.
I still have a doubt about the fact that is $f_n(x)$ in $C_0^1(\Omega)$, since the derivative is not continuous anymore.
Note: f(x) = 1 has compact support, so this entire example is invalid.