Short summary:
I want to calculate the divergence of $\overrightarrow{A}=\overrightarrow{(\frac{x}{x^2+y^2},\frac{y}{x^2+y^2})}^T=\frac{1}{r} \overrightarrow{e_r} $. So I calculate $\nabla \overrightarrow{A}= \frac{1}{r}\frac{\partial}{\partial r}(r\cdot\frac{1}{r})+\frac{1}{r}\frac{\partial v_\phi}{\partial \phi}=\frac{1}{r}(\frac{r-r}{r^2})$ by using the quotient rule. Then i see that the derivative is always zero except for r=0 where its infinity, does this mean its the dirac delta function? And why do I apply the product rule and dont say $\frac{\partial}{\partial r}(r\cdot\frac{1}{r})=\frac{\partial}{\partial r}1=0$?
Longer background not absolutley necessary for the question:
If I calculate the divergence in cartesian coordinates I get: $\nabla \overrightarrow{A}= \frac{y^2-x^2+x^2-y^2}{(x^2+y^2)^2}$ wich means i cant do this $\frac{\partial}{\partial r}(r\cdot\frac{1}{r})=\frac{\partial}{\partial r}1=0$, but I still dont get the mathematical reason behind it.
The exercise wich made me think about the question was the following exercise about the 2d divergence theorem:
If I calculate the flux of A trough the boundary of the square with the corners $(\pm1,\pm'1)$ I get 2π. Normaly Id need to make a second boundary around r=0 wich would give me -2π cause the normal vector points in the other direction. Therefore the flux of A trough the boundary would be 0, just like the integral of the divergence of A over the area of the square without the pole point. Then the divergence theorem would apply. My exercise wants me to calculate the integral of the divergence of A over the area of the square with the pole point. So i need to know if it is the dirac delta function, wich would make sense since: $\int_0^{2\pi}\int_0^{r(\phi)}\frac{1}{r}\delta(r)r \ dr \ d\phi=2\pi$. But this would mean that the divergence theorem still applies, wich it shouldnt because there is a pole point.
Thanks in advance.