It is known that the derivative of the sign function $\mathbf{sgn}$, defined as
$$ \mathrm{sgn}(x) = \frac{x}{|x|} $$
is given as
$$ \frac{\mathrm d}{\mathrm dx}\mathrm{sgn}(x) = 2\delta (x) $$
where $\delta(x)$ represents the Dirac delta function. Suppose now I have a sign function with 2 variables $x$, $y$ in its argument. Namely: $\mathrm{sgn}(x-y)$. How can I compute
$$ \frac{\mathrm d}{\mathrm dy}\mathrm{sgn}(x-y)\qquad? $$
Here's one way to compute it. We have for $\phi \in C^{\infty}_0$
$$\left<\frac{\partial}{\partial y}\text{sgn}(x-y),\phi\right> = -\left<\text{sgn}(x-y),\frac{\partial}{\partial y}\phi\right>$$ $$ = -\int_{-\infty}^\infty \text{sgn}(x-y)\frac{\partial \phi}{\partial y}dy$$ $$ = -\int_{-\infty}^x \frac{\partial \phi}{\partial y}dy + \int_{x}^\infty \frac{\partial \phi}{\partial y}dy$$ $$ = -2\phi(x).$$
Therefore, in the sense of distributions, we have that $\frac{\partial}{\partial y}\text{sgn}(x-y) = -2\delta(x-y)$.