= Layer cake representation
{wiki}
For a nonnegative measurable function $g$,
$$
\int g=\int_0^\infty\mu\{g>t\}\,dt.
$$
On a graph, applying this identity to $|g(x)-g(y)|$ expresses its total variation as the integral of the edge boundaries of the superlevel sets.
More generally, if $\varphi:[0,\infty)\to[0,\infty)$ is differentiable, increasing, and satisfies $\varphi(0)=0$, then <Tonelli theorem> and the fundamental theorem of calculus give
$$
\int\varphi(g)\,d\mu
=\int_0^\infty\varphi'(s)\mu\{g>s\}\,ds.
$$
Back to article page