If $M$ is a Riemannian manifold and $U$ a regular domain (i.e. $U$ is an open subset and $\partial U$ is a smooth submanifold of $M$), is the function $d( \cdot, \partial U)^2 : U \to \Bbb R$ smooth?
Without the square, I believe that it is smooth almost everywhere (it is Lipschitz, in fact), but is the square sufficient to iron out the singularities of $d( \cdot, \partial U)$?
No. Consider the case in which $U$ is the unit ball in $\mathbb R^n$. Then $d(x,\partial U)^2 = (1-|x|)^2$, which is not differentiable at the origin.