<s>[INST] calculating the divergence of a vector over a function I need to find the divergence of 
$$\frac{\vec{r}}{r^3}$$
I think this is the way to solve (but I would like someone to check)
r = {x,y,z}
r^3 = (x^2+y^2+z^2)^(3/2)

For r, let us says Ax = x/((x^2+y^2+z^2)^(3/2))

WLOG, y and z are the same. 
Can I just do a 
dAx/dx + dAy/dy + dAz/dz

to show that divergence = 0?
 [/INST] First, note that $\vec{r} = (x,y,z)$ and $r = \|\vec{r}\| = (x^2+y^2+z^2)^{1/2}$. 
Thus, the vector field is $\dfrac{\vec{r}}{r^3} = \left(\dfrac{x}{(x^2+y^2+z^2)^{3/2}},\dfrac{y}{(x^2+y^2+z^2)^{3/2}},\dfrac{z}{(x^2+y^2+z^2)^{3/2}}\right)$. 
So, the divergence of this vector field is: 
$\nabla \cdot \dfrac{\vec{r}}{r^3}  = \dfrac{\partial}{\partial x}\left[\dfrac{x}{(x^2+y^2+z^2)^{3/2}}\right]+\dfrac{\partial}{\partial y}\left[\dfrac{y}{(x^2+y^2+z^2)^{3/2}}\right]+\dfrac{\partial}{\partial z}\left[\dfrac{z}{(x^2+y^2+z^2)^{3/2}}\right]$ 
You need to show that this expression is $0$. This just involves using the quotient rule carefully. 
</s>