Solution (source code)

= Solution

For $u\in L^1_{\mathrm{loc}}(\mathbb R)$, a function $g\in L^1_{\mathrm{loc}}(\mathbb R)$ is its <weak derivative> when
$$
\int_{\mathbb R}u(x)\varphi'(x)\,dx
=-\int_{\mathbb R}g(x)\varphi(x)\,dx
$$
for every <test function> $\varphi\in C_c^\infty(\mathbb R)$. Equivalently, the <distributional derivative> of $u$ is represented by the locally integrable function $g$.