I'm trying to show that a function $u \in W^{1,p}(\Omega)$, where $p \ge 1, n \ge 1$ and $\Omega\subset \mathbb{R}^n$ a bounded open. Where $u$ can be written as $$\sum_{j=1}^m u_j \mathbb{1}_{A_j}$$ with $m \in \mathbb{N}^*$, $u_1,..,u_m \in W^{1,p}(\Omega)$ and $A_1,..,A_m$ measurable set which forms a partition of $\Omega$.
I would like to show that u admits weak derivatives of order one and that $$\partial_i u = \sum_{j=1}^m \partial_i u_j \mathbb{1}_{A_j}.$$ To do so, I would like to do an integration by part on domain $A_j$. Is it possible?