# Proving $C_0^1(\Omega)$ is not dense in $H^1(\Omega)$.

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.

• Is there a sequence $f_n \in C_0^1(\Omega)$ converging to $f(x) =1$ in $H^1(\Omega)$ ? Apr 20, 2017 at 21:10
• So I repeat my hint : $f(x) = 1$ is in $H^1([0,1])$. Can you find a sequence $f_n \in C_0^1([0,1])$ such that $\|f-f_n\|_{H^1} \to 0$ ? Apr 20, 2017 at 23:26
• Let $g_n(x) = 1_{x \in [1/n,1-1/n]}$. Then $g_n \to 1$ in $L^2([0,1])$, right ? But it doesn't work in $H^1$ because $g_n$ is not differentiable. So we take $f_n(x) = 1_{x \in [1/n,1-1/n]}+ (1-n^2 x^2) \, 1_{x \in [0,1/n]}+ (1-n^2(1-x)^2)\, 1_{x \in [1-1/n,1]}$. But again we have a problem : $f_n'(x) = 2x n \, 1_{x \in [0,1/n]}- 2(1-x) n \, 1_{x \in [1-1/n,1]}$ and hence $\|f_n\|_{H^1} \to \infty$. Right ?? Apr 21, 2017 at 2:06
• Because of a typo. Of course I meant add a smooth transition to $1_{x \in [1/n,1-1/n]}$ such that it is in $C^1_0([0,1])$. As I said, the problem is that $\|f_n\|_{H^1} \to \infty$ Apr 21, 2017 at 3:45
• @user1952009: Are you sure about the convergence to infinity? Seems the $L^2$ norm of $f_n'$ is $O(1/\sqrt{n})$, as in $\sqrt{n^2·(1/n)^3}$. Apr 21, 2017 at 5:53

You can check that via looking at the trace. Let $D$ denote the closure of $C_0^1(0,1)$ in $H^1(0,1)$. By definition, the trace of $u \in C_0^1(0,1)$ is zero at both end points. Moreover, it is continuous. Hence, the trace of any function in $D$ is $0$. However, there are functions in $H^1(0,1)$ with non-zero trace, e.g., $x \mapsto 1$.
• What? No, it doesn't. ($\Omega$ is usually assumed open, and we mean "compact support inside $\Omega$"). The $[0,1]$ example in comments should have been $(0,1)$. Apr 22, 2017 at 3:23