Derivative in the mean of a density and statistical applications