Is the function $|x|$ in $W^{1,p}$? I have the following question:
We consider in the segment $I=]-1,1[$, the function $f(x)=|x|.$ The question is: For each value $p \in [1,+\infty[$ do we have  $f \in W^{1,p}(I)$?
My purpose is: We know that
$$
W^{m,p}(I)=\{u \in L^p(I), D^{\alpha} u \in L^p(I) \forall |\alpha| \leq m\}
$$
where $D^{\alpha} u $ is derivative in a distribution sense. So, 
$$
W^{1,p}(I)= \{u \in L^p(I), u' \in L^p(I)\}
$$
First, we search all $p$ that $u \in L^p(I).$ We have
$$
\displaystyle\int_{-1}^1 |x|^p dx = \displaystyle\int_{-1}^0 (-x)^p dx + \displaystyle\int_0^1 x^p dx = -\dfrac{(1)^{p+1}}{p+1} + \dfrac{(1)^{p+1}}{p+1}= 0
$$
Can we conclude that $u \in L^p(I)$ for all $p$?
Second, we search all $p$ that $u' \in L^p(I)$. We have for all $\varphi \in D(I)$
$$
\langle u',\varphi\rangle=-\langle u,\varphi'\rangle = - \displaystyle\int_{-1}^0 (-x)^p \varphi'(x) dx + \displaystyle\int_0^1 x^p \varphi'(x) dx
$$
By integration by parts, we have:
$$
\displaystyle\int_{-1}^0 (-x)^p \varphi'(x)dx = [(-x)^p \varphi(x)]_{-1}^0 + p \displaystyle\int_{-1}^0 (-x)^{p-1} \varphi(x) dx
$$
and 
$$
\displaystyle\int_0^1 x^p \varphi'(x)dx = [x^p \varphi(x)]_0^1 - p \displaystyle\int_0^1 x^{p-1} \varphi(x) dx
$$
but I cannot conclude what $p$ is such that $u' \in L^p(I)$ and, therefore, what $p$ is such that $u \in W^{1,p}(I)$.
 A: Note that $|f(x)|^p=|x|^p=|-x|^p=|f(-x)|^p$ for all $x\in I$ and thus
$$\int_{-1}^1|f(x)|^p\;dx=2\int_{0}^1|f(x)|^p\;dx=2\int_{0}^1x^p\;dx=\frac{2}{p+1}$$
Since $\frac{2}{p+1}<\infty$ for all $p\in[0,\infty)$, we get

$$f\in L^p(I),\quad \forall \ p\in [1,\infty).$$

Now, the distributional derivative $f'$ of $f$ satisfies
\begin{align}
\langle f',\varphi\rangle&=-\int_{-1}^1|x|\varphi'(x)\;dx\\\\
&=-\int_{-1}^0|x|\varphi'(x)\;dx-\int_{0}^1|x|\varphi'(x)\;dx\\\\
&=\int_{-1}^0x\varphi'(x)\;dx-\int_{0}^1x\varphi'(x)\;dx\\\\
&=-\int_{-1}^0\varphi(x)\;dx+\int_{0}^1\varphi(x)\;dx\\\\
&=\int_{-1}^1\operatorname{sgn}(x)\varphi(x)\;dx
\end{align}
for all $\varphi\in\mathcal{D}(I)$, where $\operatorname{sgn}$ is the sign function which belongs to $L^p(I)$ for all $p\in[1,\infty)$. This shows that

$$f'\in L^p(I),\quad \forall \ p\in [1,\infty).$$

Conclusion: $f\in W^{1,p}(I)$ for all $p\in[1,\infty)$.
A: The measure of the space is finite, and $f$ is bounded, so $f\in L^p$ for all $p\ge 1$. And the distributional derivative of f is (check):
$$f'(x) = 1\text{ for }x>0,\qquad f'(x) =- 1\text{ for }x<0.$$
Is $f'\in L^p$?
