Find a weak derivative of the function $u:(-1;2)\rightarrow \mathbb{R}$ defined as follows: $$u(x)=\begin{cases}|x|, & \text{if}\,\,\, x<1 \\ 1-x^2, & \text{if}\,\,\, x\ge1 \end{cases}$$
I know that a weak derivative of $|x|$ is equal to $2\chi_{(0,1)}(x)-1$ and a weak derivative of $1-x^2$ is equal to $-2x$.
Should I simply combine them? Can a weak derivative be not continous?
Thanks in advance.
Hint: a weak derivative of $u$ on $[-1,2]$ is a $v\in L^{1}([-1,2]) $ s.t.
$$\int_{-1}^{2}u(x)\varphi'(x)dx=\int_{-1}^{1}|x| \varphi'(x)dx+ \int_{1}^{2}(1-x^2) \varphi'(x)dx=-\int_{-1}^{2}v(x)\varphi(x)dx$$
for all diff. $\varphi$ s.t. $\varphi(-1)=\varphi(2)=0$.
If you write $\int_{-1}^{2}v(x)\varphi(x)dx=\int_{-1}^{1}v(x)\varphi(x)dx+\int_{1}^{2}v(x)\varphi(x)dx$, then you can arrive at the result, as you know the weak derivatives of $|x|$ and $1-x^2$. The weak derivative of $u$ must be $L^1$ integrable on $[-1,2]$; you can check that this is the case. Note that also $u$ is not continuous on $[-1,2]$ but $L^1$-integrable on $[-1,2]$.