How to find divergence of $f(\vec{r})\vec{r}$ I have to find $$\mathrm{div}f(\vec{r})\vec{r}$$
I only know that $\mathrm{r}$ is a motion vector so it should be $\vec{r} = \{x;y;z\}$ and also that $\mathrm{div} = \left(\vec{\nabla},f(r)\vec{r}\right)$ but I do not know how to handle $f(r)\vec{r}$ there properly to substitute it into determinant.
 A: Here is a standard vector calculus identity: $$\nabla.(f \vec A) = (\nabla f). \vec A + f (\nabla . \vec A).$$
You can use this to get
$$ \nabla (f\vec r) = (\nabla f). \vec r + f (\nabla . \vec r).$$
But $\nabla . \vec r = 3$, so this reduces to
$$ \nabla (f \vec r) = (\nabla f) . \vec r + 3f.$$

It might be good to rederive the same result in spherical polar coordinates. First, you write $\vec r$ as $r \vec e_r$, where $r$ is the radial coordinate in your spherical coordinate system, and $\vec e_r$ is a unit vector pointing radially outwards. So $f(\vec r) \vec r = rf(r,\theta, \phi) \vec e_r$.
Using the formula for del in spherical polars, we have
$$ \nabla . (rf(r, \theta, \phi) \vec e_r) = \frac 1 {r^2} \frac{\partial (r^3 f(r,\theta, \phi))}{\partial r},$$
and you should be able to verify that this agrees with the earlier result.
In fact, since $f$ only depends on the radial coordinate $r$ in your example, you can change the partial derivative to an ordinary derivative:
$$ \nabla . (rf(r) \vec e_r) = \frac 1 {r^2} \frac{d(r^3 f(r))}{dr}.$$
A: Assumptions: 


*

*$\vec{r}=\{x,y,z\}$, in other words, $\vec{r}$ is a position vector.

*$f(\vec{r})$ is a real-valued function.

*$f(\vec{r})\vec{r}$ is a vector-valued function, where $\vec{r}$ is scaled by $f(\vec{r})$.  In other words, $f(\vec{r})\vec{r}=(f(\vec{r})x,f(\vec{r})y,f(\vec{r})z)$.

*The question asks for $\operatorname{div}(f(\vec{r})\vec{r})$ (there are no parentheses in the original post).
Since $f(\vec{r})\vec{r}=(f(\vec{r})x,f(\vec{r})y,f(\vec{r})z)$, 
\begin{align*}
\operatorname{div}(f(\vec{r})\vec{r})&=\frac{\partial}{\partial x}f(\vec{r})x+\frac{\partial}{\partial y}f(\vec{r})y+\frac{\partial}{\partial z}f(\vec{r})z\\
&=3f(\vec{r})+f_x(\vec{r})x+f_y(\vec{r})y+f_z(\vec{r})z
\end{align*}
