# Find the weak derivative

I want to find the weak derivative of $$f(x)=1$$ for $$x\in(0,1)$$ and $$f(x)=0$$ for $$x\in(1,2)$$. So basically it is constant ae.

I was expecting the weak derivative to be $$0$$. However, when calculating, I'm getting a different answer. Is the weak derivative of $$f$$ not $$0$$?

• What did you calculate? – Mars Plastic Feb 8 at 2:08
• It's not what I would think of as "constant ae". If the weak derivative were $0$ then it would be constant ae, meaning that there would exist $c$ such that $f=c$ ae. – David C. Ullrich Feb 8 at 2:46

Lemma: Let $$u'$$ be the weak derivative of $$u$$ on $$(a,b)$$. Then for all intervals $$(\alpha, \beta) \subset (a,b)$$ it holds that $$u'|_{(\alpha, \beta)}$$ is also the weak derivative of $$u|_{(\alpha, \beta)}$$ on $$(\alpha, \beta)$$.
Proof. Let $$(\alpha, \beta) \subset (a,b)$$ and $$\phi \in \mathcal{C}_{\text{c}}^{\infty}(\alpha, \beta)$$ and define the trivial extension of $$\phi$$ by $$\tilde{\phi} \in \mathcal{C}_{\text{c}}^{\infty}(a,b)$$. Then, we conclude $$\begin{equation*} \int_{\alpha}^{\beta} u(x) \phi'(x) dx = \int_{a}^{b} u(x) \tilde{\phi}'(x) dx = - \int_{a}^{b} u'(x) \tilde{\phi}(x) dx = - \int_{\alpha}^{\beta} u'(x) \phi(x) dx, \end{equation*}$$ which implies the proposition.$$\ \square$$
Back to your question: This implies, as you rightly point out, that the only candidate for the weak derivative of your function has to be $$\begin{equation*} v(x) = \begin{cases} 0, & \text{if } x \in (0,1), \\ 0, & \text{if } x \in (0,2) \end{cases} \end{equation*}$$ If $$v$$ is the weak derivative of $$u$$, for all test functions $$\phi \in \mathcal{C}_{\text{c}}^{\infty}(0,2)$$ the following has to hold: $$\begin{equation*} \int_{0}^{2} u(x) \phi'(x) dx = - \int_{0}^{2} v(x) \phi(x) dx. \end{equation*}$$ Now, $$\begin{equation*} \int_{0}^{2} f(x) \phi'(x) = \int_{0}^{1} \phi'(x) = \phi(1) - \phi(0) = \phi(1) \neq 0 = - \int_{0}^{2} v(x) \phi(x). \end{equation*}$$ for all test functions with $$\phi(1) \neq 0$$, which I'm sure you believe exist. Therefore, your function is not weakly differentiable.