[example: Weak Derivative of $|x|$]
Consider $u(x) = |x|$ on $\Omega = (-1, 1) \subset \mathbb{R}$. Define $v(x) = \operatorname{sgn}(x)$, i.e., $v(x) = 1$ for $x > 0$ and $v(x) = -1$ for $x < 0$. For any $\phi \in C_c^\infty(-1, 1)$,
\begin{align*}
\int_{-1}^1 |x| \, \phi'(x) \, d\mathcal{L}^1 &= \int_{-1}^0 (-x) \phi'(x) \, d\mathcal{L}^1 + \int_0^1 x \, \phi'(x) \, d\mathcal{L}^1.
\end{align*}
Integrating each piece by parts:
\begin{align*}
\int_{-1}^0 (-x) \phi'(x) \, d\mathcal{L}^1 &= \left[(-x)\phi(x)\right]_{-1}^0 + \int_{-1}^0 \phi(x) \, d\mathcal{L}^1 = 0 + \phi(-1)\cdot(-1)\cdot(-1) + \int_{-1}^0 \phi(x) \, d\mathcal{L}^1, \\
\int_0^1 x \, \phi'(x) \, d\mathcal{L}^1 &= \left[x\phi(x)\right]_0^1 - \int_0^1 \phi(x) \, d\mathcal{L}^1 = -\int_0^1 \phi(x) \, d\mathcal{L}^1.
\end{align*}
The boundary terms at $x = \pm 1$ vanish because $\phi$ has compact support in $(-1,1)$, so $\phi(\pm 1) = 0$. The boundary terms at $x = 0$ from the two integrations cancel: the left piece contributes $-\phi(0) \cdot (-1) = \phi(0)$ and the right piece contributes $-\phi(0) \cdot (+1) = -\phi(0)$; these are equal and opposite, so they sum to zero. Adding the remaining integrals: $\int_{-1}^1 |x| \phi'(x) \, d\mathcal{L}^1 = \int_{-1}^0 \phi \, d\mathcal{L}^1 - \int_0^1 \phi \, d\mathcal{L}^1 = -\int_{-1}^1 \operatorname{sgn}(x)\, \phi(x) \, d\mathcal{L}^1$. Thus $D^1 u = \operatorname{sgn}(x)$, and this weak derivative exists despite $u$ not being classically differentiable at $0$.
[/example]