Let $M$ be a compact Riemannian manifold and $d$ be the induced distance function. Suppose $\mu$ is a probability measure on $M$ with continuous density. The Fréchet function is defined as $$ F(x) = \int_{M}d^2(x,y)\mathrm{d}\mu(y). $$ In general I want to ask: What can we say about the differentiability of $F(x)$?
The differentiablity of $F(x)$ certainly depends on the squared distance function $d^2(x,y)$. It is known the distance function $d(x,y)$ is not a smooth function. There is a very nice post which summarizes the nonsmoothness of $d(x,y)$ at cut points. Since we assume the probability distribution has a continuous density, the cut locus is a set of measure zero and we can say the squared distance function $d^2(x,y)$ is almost surely (a.s.) smooth.
However, $d^2(x,y)$ being a.s. smooth does not imply $F(x)$ is an a.s. smooth function. From what I think, exchanging differentiation and integration is allowed only when the derivatives of $d^2(x,y)$ are integrable. It might happen that the derivatives of $d^2(x,y)$ are not integrable. For example, the hessian of $d^2(x,y)$ can have eigenvalue tending to $-\infty$ near the first conjugate point (see this post). If the hessian is not integrable, then $F(x)$ may not have second derivative.
To be precise, my question is: Is $F(x)$ necessarily (twice) differentiable? Under which condition is $F(x)$ a smooth function?