# The divergence of a piecewise constant vector field in the distributional sense

I am currently working on a question that I am having a hard time understanding, and would appreciate some help. The question reads:

Consider div $u=0$, where $u(x,y) = (u_1(x,y), u_2(x,y))$ Let $\Gamma = \{(x,y)|y=f(x)\}$ for some $f$ a smooth function. Let: $$u(x,y) = \begin{cases} a \text{ if } y\geq f(x)\\ b\text{ if } y<f(x) \end{cases}$$ Let $a\neq b$. 1) What does it mean for a 2D Vector Field $u$ to be a solution in the distributional sense? 2) Show in general that div $u\neq0$ in the sense of distributions 3) Find a condition on $a,b$ and the normal to the curve $\Gamma$ which ensures that div $u=0$ in the distributional sense.

Now, I tried to calculate div $u$ in the distributional sense: $$\langle \operatorname{div} u,\phi\rangle = -a\int_{-\infty}^\infty \int_{f(x)}^\infty \nabla \phi(\textbf x) d\textbf x-b\int_{-\infty}^\infty \int_{-\infty}^{f(x)}\nabla\phi(\textbf x) d\textbf x$$ Where $\phi\in C^{\infty}_c(\mathbb R^2)$, and $\textbf x\in\mathbb R^2$.

Where can I go from here? I still don't really know how to show that the above integral gives non-zero?

Let $G^+ = \{(x,y) : y > f(x)\}$ and $G^- = \{(x,y) : y < f(x)\}$. Observing that $a\cdot \nabla \phi = \operatorname{div}(a\phi)$ and using the divergence theorem, we get $$\iint_{G^+} a\cdot \nabla \phi = \iint_{G^+} \operatorname{div} (a\phi) = \int_{\partial G^+} (a\phi)\cdot n\, ds = \int_{\partial G^+} (a\cdot n)\phi\,ds \tag1$$ where $n$ is the unit exterior normal vector. Similarly, $$\iint_{G^-} b\cdot \nabla \phi = \int_{\partial G^-} (b\cdot n)\phi\,ds \tag2$$ where $n$ goes in the opposite direction to the previous one. So, if we pick $n$ to be the upward normal to $\Gamma$, the sum of two integrals becomes $$\int_{\Gamma} ((b-a)\cdot n)\phi\,ds \tag3$$ This vanishes for all $\phi$ if $b-a$ is orthogonal to $n$ everywhere (note this requires $\Gamma$ to be a straight line). For any other curve $\Gamma$, the distribution $\operatorname{div}u$ is nonzero, and is described as the functional $$\phi\mapsto \int_{\Gamma} ((a-b)\cdot n)\phi\,ds \tag4$$