  In this paper, given any random variable $\xi$ defined over a probability
space $(\Omega,\mathcal{F},Q)$, we focus on the study of the derivative of
functions of the form $L\mapsto F_Q(L):=f\big((LQ)_{\xi}\big),$ defined over
the convex cone of densities $L\in\mathcal{L}^Q:=\{ L\in
L^1(\Omega,\mathcal{F},Q;\mathbb{R}_+):\ E^Q[L]=1\}$ in
$L^1(\Omega,\mathcal{F},Q).$ Here $f$ is a function over the space
$\mathcal{P}(\mathbb{R}^d)$ of probability laws over $\mathbb{R}^d$ endowed
with its Borel $\sigma$-field $\mathcal{B}(\mathbb{R}^d)$. The problem of the
differentiability of functions $F_Q$ of the above form has its origin in the
study of mean-field control problems for which the controlled dynamics admit
only weak solutions. Inspired by P.-L. Lions' results [18] we show that, if for
given $L\in\mathcal{L}^Q$, $L'\mapsto
F_{LQ}(L'):\mathcal{L}^{LQ}\rightarrow\mathbb{R}$ is differentiable at $L'=1$,
the derivative is of the form $g(\xi)$, where
$g:\mathbb{R}^d\rightarrow\mathbb{R}$ is a Borel function which depends on
$(Q,L,\xi)$ only through the law $(LQ)_\xi$. Denoting this derivative by
$\partial_1F((LQ)_\xi,x):=g(x),\, x\in\mathbb{R}^d$, we study its properties,
and we relate it to partial derivatives, recently investigated in [6], and,
moreover, in the case when $f$ restricted to the 2-Wasserstein space
$\mathcal{P}_2(\mathbb{R}^d)$ is differentiable in P.-L. Lions' sense and
$(LQ)_{\xi}\in\mathcal{P}_2(\mathbb{R}^d)$, we investigate the relation between
the derivative with respect to the density of $F_Q(L)=f\big((LQ)_{\xi}\big)$
and the derivative of $f$ with respect to the probability measure. Our main
result here shows that $\partial_x\partial_1F((LQ)_\xi,x)=\partial_\mu
f((LQ)_\xi,x),\ x\in \mathbb{R}^d,$ where $\partial_\mu f((LQ)_\xi,x)$ denotes
the derivative of $f:\mathcal{P}_2(\mathbb{R}^d)\rightarrow \mathbb{R}$ at
$(LQ)_\xi$.
