Disk-median curvature expansion (source code)

= Disk-median curvature expansion
{title2=$\operatorname{median}_{B_h(x)}u=u+\tfrac16h^2|\nabla u|\operatorname{div}(\nabla u/|\nabla u|)+o(h^2)$}

At a smooth point with nonzero <gradient>, rotate coordinates so $\nabla u=G e_2$. Write $u=u_0+Gy+\tfrac12(Ax^2+2Bxy+Cy^2)+O(|(x,y)|^3)$. A candidate <median> $u_0+dh^2$ has level boundary $y=(dh^2-Ax^2/2)/G+O(h^3)$ in the disk. The area imbalance is $(2d-A/3)h^3/G+o(h^3)$; equal half-areas force $d=A/6$. Here $A=\Delta u-\nabla u^T(D^2u)\nabla u/|\nabla u|^2$ is the tangential second <derivative>, giving the formula. The disk uses uniform area measure, not its boundary measure.