Derivative Approximation
Buildup
Let’s recall the idea of defining the differentiation of distributions. There exists a regular distribution $T_{u}$ for $u \in {L}_{\mathrm{loc}}^1(\Omega)$. If $u$ is differentiable, by applying the integration by parts, the following equation holds, and the derivative of $T_{u}$ is defined as $T_{u^{\prime}}$, which corresponds to the derivative of $u$, $u^{\prime}$.
$$ \begin{align*} T_{u}^{\prime}(\phi) &:= T_{u^{\prime}}(\phi) \\ &= \int u^{\prime}(x)\phi (x)dx \\ &= \left[ u(x) \phi (x) \right]_{-\infty}^{\infty} -\int u(x)\phi ^{\prime} (x) dx \\ &= -\int u(x)\phi ^{\prime} (x) dx \\ &= -T_{u}(\phi^{\prime}) \end{align*} $$
But, suppose $u(x)$ is not differentiable at $\Omega$. Nonetheless, the corresponding distribution $T_{u}$ to $u$ has the following derivative by definition.
$$ T_{u}^{\prime}(\phi) = T_{u}(\phi^{\prime}) $$
Therefore, if there exists $v(x)$ that satisfies the following equation, it can be treated as the derivative of $u(x)$.
$$ -T_{u}(\phi^{\prime}) = -\int u(x)\phi ^{\prime} (x) dx = \int v(x)\phi (x)dx = T_{v}(\phi) $$
Extending this idea to the multi-index $\alpha$ results in the following.
$$ (-1)^{|\alpha|} \int_{\Omega} u(x){D}^{\alpha}\phi (x)dx = \int_{\Omega}v_{\alpha}(x)\phi (x)dx, \quad \forall\ \phi \in \mathcal{D}(\Omega) $$
Definition1
Let’s denote by $u \in {L}_{\mathrm{loc}}^1(\Omega)$. If there exists $v_{\alpha}$ that satisfies the following equation, it is called the weak derivative or the distributional derivative of $u$.
$$ \begin{align*} T_{{v}_{\alpha}} &= {D}^{\alpha}T_{u} & \text{in } \mathcal{D}^{\ast}(\Omega) \\ \int_{\Omega}v_{\alpha}(x)\phi (x)dx &= (-1)^{|\alpha|} \int_{\Omega} u(x){D}^{\alpha}\phi (x)dx & \forall\ \phi \in \mathcal{D}(\Omega) \end{align*} $$
Explanation
For a simple explanation, refer to here.
Example
Let’s assume $u$ and $v$ are defined as follows in the interval $(-1, 1)$.
$$ u(x) = |x| \quad \text{and} \quad v(x) = \begin{cases} 1 & 0 \lt x \lt 1 \\ 0 & x=0 \\ -1 & -1 \lt x \lt 0 \end{cases} $$ Then, since $u$ is not differentiable at $x=0$, the derivative cannot be defined at $(-1,1)$, but $v$ becomes the weak derivative of $u$. It can be verified through the following process that $v$ is the weak derivative of $u$. Let’s denote by $\phi \in \mathcal{D}(\Omega)$. Then, the following equation holds.
$$ \begin{align*} -\int_{-1}^1 u(x) \phi^{\prime}(x)dx &= -\int_{-1}^{0} |x| \phi^{\prime}(x) dx -\int_{0}^{1} |x| \phi^{\prime}(x) dx \\ &= -\int_{-1}^{0} -x \phi^{\prime}(x) dx -\int_{0}^{1} x \phi^{\prime}(x) dx \\ &= -\left( [-x\phi (x)]_{-1}^{0} +\int_{-1}^{0}\phi (x)dx \right) - \left( [x\phi (x)]_{0}^1-\int_{0}^1 \phi (x)dx \right) \\ &= \int_{-1}^{0} -1 \cdot \phi (x) dx + \int_{0}^{1}\ 1 \cdot \phi (x) dx \\ &= \int_{-1}^1v(x)\phi (x) dx \end{align*} $$
In fact, the value of $v(x)$ is equal to $u^{\prime}(x)$ at places where $x \ne 0$, and in $x=0$, it takes the midpoint of the left and right derivatives of $u(x)$. Therefore, it can be seen that there is no problem treating $v(x)$ as the derivative of $u(x)$.
Robert A. Adams and John J. F. Foutnier, Sobolev Space (2nd Edition, 2003), p22 ↩︎