Solution (source code)

= Solution

The first <weak derivative> $D_ju=v$ is characterized by $\int_\Omega u\,\partial_j\phi=-\int_\Omega v\phi$ for every $\phi\in C_c^\infty(\Omega)$. The <fundamental lemma of the calculus of variations> in the locally integrable form says that a <function> pairing to zero with every such test is zero almost everywhere. Applied to the difference of two candidate derivatives, it proves uniqueness. The <Sobolev space> consists of $u\in L^p$ with all first <weak derivatives> in $L^p$, with <norm>
$$
\boxed{\|u\|_{W^{1,p}}=\left(\|u\|_p^p+\sum_{j=1}^n\|D_ju\|_p^p\right)^{1/p}.}
$$
For the one-dimensional tent, <integration by parts> on each side of one has cancelling junction terms because the <function> is continuous. Thus \b[$u'=1$ on $(0,1)$ and $u'=-1$ on $(1,2)$], almost everywhere. Both it and its derivative are bounded, so it belongs to every stated <Sobolev space>; its displayed <norm> to the power $p$ is $2/(p+1)+2$.

For $u=x_1/r$ in the punctured ball, ordinary differentiation gives
$$
\boxed{D_ju=\delta_{1j}/r-x_1x_j/r^3.}
$$
The <function> is bounded and $|D_ju|\leq2/r$, so polar integration gives finite derivative $L^p$ <norms> when $\int_0^1r^{n-1-p}dr<\infty$, namely $p<n$. To verify these are <weak derivatives> across the origin, integrate by parts outside a ball of radius $\varepsilon$ against a compactly supported smooth test. The inner boundary term is at most a fixed constant times $\varepsilon^{n-1}$, since $u$ is bounded. It tends to zero for $n>1$. The volume terms converge by local integrability of the displayed derivative. Thus \b[$u\in W^{1,p}(B)$ for $1\leq p<n$ with exactly these derivatives]. Its value at the origin can be chosen arbitrarily.