Exercise 8.13 - Brezis Let $1 \leq p < \infty$ and $u \in W^{1,p}(\mathbb{R}$). Set
$$
D_{h}u(x) = \frac{1}{h}(u(x+h) - u(x)), \ \ x \in \mathbb{R}, h> 0
$$
Show that $D_{h}u \to u'$ in  $L^{p}(\mathbb{R}$) as $h \to 0$.
I'm trying to use the fact that $C_{c}^{1}(\mathbb{R}$) is dense in $W^{1,p}(\mathbb{R}$)
 A: $\newcommand{\R}{\mathbb R}\newcommand{\ep}{\varepsilon}$Re-define, if needed, the function $u$ on a set of Lebesgue measure zero so that
\begin{equation}
    u(y)-u(x):=\int_x^y dt\, u'(t)
\end{equation}
for all real $x$ and $y$ such that $x\le y$.
Then we can write
\begin{equation}
    (D_hu)(x) =\frac{u(x+h)-u(x)}h
    =\int_0^1 ds\,u'(x+sh),
\end{equation}
so that
\begin{equation} 
\begin{aligned} 
\|D_hu-u'\|_p^p&=\int_\R dx\,\Big|\int_0^1 ds\,(u'(x+sh)-u'(x))\Big|^p \\ 
&\le\int_\R dx\,\int_0^1 ds\,|u'(x+sh)-u'(x)|^p \\ 
&=\int_0^1 ds\,\int_\R dx\,|u'(x+sh)-u'(x)|^p=:I_h(u'). 
\end{aligned}
\end{equation}
Take any real $\ep>0$. Since $C_c(\R)$ is dense in $L^p(\R)$, there is a function $v\in C_c(\R)$ such that $\|u'-v\|_p\le\ep$. Using the Jensen inequality
\begin{equation}
    \Big(\frac{a+b+c}3\Big)^p\le\frac{a^p+b^p+c^p}3
\end{equation}
for nonnegative $a,b,c$, we get
\begin{equation}
    |u'(x+sh)-u'(x)|^p\le3^{p-1}(|v(x+sh)-v(x)|^p+|u'(x+sh)-v(x+sh)|^p+|u'(x)-v(x)|^p),
\end{equation}
whence
\begin{equation} 
\begin{aligned} 
I_h(u')\le3^{p-1}(I_h(v)+2\ep^p). 
\end{aligned}
\end{equation}
It remains to show that $I_h(v)\to0$ as $h\to0$. But this follows because $v$ is in $C_c(\R)$, so that $v$ has a compact support and is uniformly continuous.
A: The proof is not short, because it is done from first principles, without using any theorems about Sobolev space except its definition.
By the definition of $W^{1,p}$, there exist $v_n \in  C_{c}^{1}(\mathbb{R})$
and $w \in  L^p(\mathbb{R})$ such that $v_n \to u$ in $L^p(\mathbb{R})$ and $v_n' \to w$ in $L^p(\mathbb{R})$. In this case we write $u'=w$.
Note that $v_n'$ is a classical derivative, so
$$D_h v_n(x)=\frac{v_n(x+h)-v_n}{h}= I_h(v_n')(x) \,, \tag{1}
$$
where for $f\in  L^p(\mathbb{R})$, we write
$$I_h(f)(x):=\int_0^h \frac{f(x+t)}{h} \,dx  \,.$$
By Jensen's inequality [1], for all $n \ge 1 $ and $x \in \mathbb{R}$, we have
$$|I_h(v_n')(x)-I_h(u')(x)|^p \le \frac{1}{h} \int_0^h |v_n'(x+t)-u'(x+t)|^p \,dt \,.
$$
Integrating both sides $\,dx$ and using Fubini on the right-hand side, we obtain
$$\|I_h(v_n') -I_h(u') \|^p \le \frac{1}{h}\int_0^h \|v_n'(\cdot+t)-u'(\cdot+t)\|_p^p \,dt=  \|v_n' -u' \|_p^p \,.\tag{2}
$$
Given $\epsilon>0$, find $k$ such that
$$ \|v_k'-u'\|_p<\epsilon \,. \tag{3}
$$
Let $M$ denote the Lebesgue measure of the support of $v_k$.
Since $v_k'$ is uniformly continuous, there exists $h_0\in(0,1)$ such that
$$\forall t\in [0, h_0], \quad \sup_{x \in \mathbb{R}} |v_k'(x+t)-v_k'(x)|<\epsilon/(M+1)  \,,$$
so for $h\in [0, h_0]$ and all $x$, we have
$|I_h (v_k')(x)-v_k'(x)|<\epsilon/(M+1)$, whence
$$\|I_h (v_k') -v_k'\|_p^p \le (M+h) (\epsilon/(M+1))^p <\epsilon^p \,.$$
In conjunction with $(2)$ and $(3)$, this gives
$$\|I_h(u')-u' \|_p \le \|I_h(u')-I_h(v_k') \|_p + \|I_h(v_k')-v_k' \|_p + \| v_k' -u'\|_p <3\epsilon \,. \tag{4}$$
Next, fix $h\in [0, h_0]$, and choose $m=m(h,\epsilon)$ such that
$$\|u-v_m  \|_p<\epsilon h \quad \text{and} \quad \|u'-v_m'\|_p<\epsilon \,.
$$
The first inequality implies that $\|D_h(u) -D_h(v_m) \|_p<2\epsilon$. Therefore, by $(1),\, (2)$ and $(4)$,
\begin{eqnarray}
\|D_h(u)-u'\|_p &\le& 
\|D_h(u) -D_h(v_m) \|_p+\|I_h(v_m')-I_h(u')\|_p+\|I_h(u')-u' \|_p \\
&<& 2\epsilon+\epsilon+3\epsilon=6\epsilon \,.
\end{eqnarray}
This completes the proof.
[1] https://en.wikipedia.org/wiki/Jensen%27s_inequality#Measure-theoretic_and_probabilistic_form
