I came across this in my lecture notes:

This is using index notation, non-bold r is the modulus of r, and the partials are with respect to the components of r.
I understand most of the steps, but I don't understand how they get from $$\partial_i \sqrt{r_j r_j}$$ to $$\frac{(\partial_i r_j)r_j}{\sqrt{r_j r_j}}$$
Can anybody help?
It's just the chain rule, but the index notation used obscures it. A big thing to note is that the implied summation over $r_j$ is within the square root rather than not a sum over the square roots.
To make the algebra more familiar let $u=\sum_j r_j r_j$ and write everything explicitly:$$\frac{\partial}{\partial x_i} (u^{1/2})=\frac{\partial u}{\partial x_i}\frac{d}{du}(u^{1/2})=\frac{1}{2u^{1/2}}\frac{\partial u}{\partial x_i}=\frac{1}{2u^{1/2}}\frac{\partial }{\partial x_i}\sum_j r_j r_j=\frac{1}{2u^{1/2}}\cdot 2r_j\frac{\partial r_j}{\partial x_i}=\frac{r_j}{u^{1/2}}\frac{\partial r_j}{\partial x_i}$$ In index notation, this is rendered as $\partial_i \sqrt{r_j r_j}=\dfrac{\partial_i (r_j r_j)}{2\sqrt{r_j r_j}}=\dfrac{(\partial_i r_j) r_j}{\sqrt{r_j r_j}}$. The only difference in meaning is that I'm leaving a lot more things implicit in this version, including the use of $u$.