I came across a funny formula for the arc length of an implicit curve in the paper here, given at the top of page 5. Let me set the context:
Consider a function $\phi: \mathbb{R}^2 \to \mathbb{R}$ with all the necessary partial derivatives. Suppose that the region $A = \{ (x,y) \; | \; \phi(x,y) > 0 \}$ is open, and its boundary, $\partial A = \{ (x,y) \; | \; \phi(x,y) = 0 \}$, implicitly defines a rectifiable curve.
Next, define the unit step function, $H(t) = \begin{cases} 1 & t > 0 \\ 0 & t < 0\end{cases}$
Finally, it is stated that:
$$ \text{length}\{\phi=0\} = \int_{\mathbb{R}^2} \left| \nabla H(\phi(x,y)) \right| \; dx \; dy \tag{1} $$
I cannot grasp where this formula arises.
I have tried using the divergence theorem,
$$ \text{length}\{\phi = 0 \} = \int_{\partial A} ds = \int_A \text{div}\left(\frac{\nabla \phi}{|\nabla \phi|}\right) \; dx \; dy = \int_{\mathbb{R}^2} H(\phi(x,y)) \;\text{div}\left(\frac{\nabla \phi}{|\nabla \phi|}\right) \; dx \; dy \tag{2} $$
but I can't seem to match this to $(1)$. My questions are:
- How can we show equation $(1)$?
- What is the potential advantage of $(1)$ over $(2)$?