For which $1\le p\le\infty$ does $u$ belong to $W^{1,p}(\Omega)$? Hi could anyone help with a solution for problem 7 Evans PDE chapter 5?

I think it is basically about checking which $p$ allows
$$\int_{\Omega} |u|^p dx+\int_{\Omega}|Du|^p dx<\infty$$
?
But I tend to generate messy output as I always do...
Please help...
 A: You first have to check that $u$ has a weak derivative.
You have an obvious candidate for the weak gradient (just take the gradient separately in the four pieces), and you just have to check that it works.
You might also have a theorem that saves you from calculations at this point, having a weak derivative should still be checked somehow.
Then you have explicit formulas for $u$ and $\nabla u$.
Observe that $|u|$ and $|\nabla u|$ are bounded (actually they are both bounded by $1$).
You either find an upper bound for the integrals you have or just state that $u\in L^p(\Omega)$ and $|\nabla u|\in L^p(\Omega)$.
For $p=\infty$ the norm does not have an integral representation, so you have to resort to the second one.
If you do the integrals, you don't have to do them explicitly and messily; a very rough estimate will suffice.
Can you finish with these ideas?

Checking weak differentiability:
If you know that the pointwise minimum of two $W^{1,p}$ functions is again in $W^{1,p}$, you can use that.
You can also do it by hand.
In the four pieces (where $u$ is defined), it is easy to calculate the strong gradient $\nabla u$.
It takes the four values $(\pm1,0)$ and $(0,\pm1)$.
Now you have $\nabla u$ defined almost everywhere.
You will just have to check that for any $\eta\in C_0^\infty(U)$ you have
$$
\int_Uu\nabla\eta=\int_U\eta\nabla u.
$$
