# What is the divergence of $\frac{\vec{r} (\vec{r}.\vec{a})}{r^3}$?

I'm trying to calculate the divergence of $\frac{\vec{r} (\vec{r}.\vec{a})}{r^3}$ and I've tried using 2 separate methods. First using expression for divergence in spherical polar coordinates (since the above field depends only on radial component) and the other by brute force using cartesian coordinates and Einstein summation convention but I'm getting different answers. I'm getting $\frac{\vec{r}.\vec{a}}{r^3}$ when solving in spherical polar coordinates and $- \frac{\vec{r}.\vec{a}}{r^3}$ with Einstein summation convention. Can someone help me out here?

• I would be good if you could repeat the question again in the main text (not only the title). Just to make the text self-contained. – Fabian Feb 9 '17 at 5:24
• By the way: given the choice of the two. The first one is correct. The vector field points outwards (for positive $a$) and thus the divergence has to be positive. – Fabian Feb 9 '17 at 5:27