I am trying to calculate the divergence of a central electric field, namely the electric field due to a point charge and my book begins like this: https://i.stack.imgur.com/wLeOr.jpg
However in the last line I am unsure of how they get that $r\frac{df}{dr}$, I have been staring at the book for ages and cant seem to figure it out.
Thanks.
From vector calculus$$\nabla \cdot (f(r) \,\mathbf r)=f(r)\,(\nabla \cdot \mathbf r)+\nabla f(r) \cdot \mathbf r=$$$$3f(r)+\frac {f'(r)}r\,\mathbf r \cdot \mathbf r$$(see one of the properties in divergence)
Note that the second $\nabla$ in the sum is the gradient of $f$.
Now $$r=\sqrt {x_1^2+x_2^2+x_3^2}$$ so, by the chain rule $$\frac {\partial r}{\partial x_i}=\frac {x_i}{r}$$ hence, yet by the chain rule$$\frac {\partial f}{\partial x_i}=f'(r)\frac {\partial r}{\partial x_i}=\frac {f'(r)}r x_i$$ Done !