How to determine if division by zero causes a derivative to not exist? I study engineering so I don't know calculus with sufficient rigor to know if a derivative exists or not.
If one wants to take the divergence of the field $\vec{E}=\frac{\hat{r}}{r^2}$ the typical answer is that it is zero everywhere except at the origin, where it explodes. But how is this apparent when calculating the following expression:
$\nabla \cdot \vec{E} = \frac{1}{r^2} \frac{\partial}{\partial r}(\frac{r^2}{r^2})$
Is it because of a division by zero in the coordinate $r=0$?
Why then doesn't my textbook and professor make a big deal out of the divergence of $\vec{E}=\frac{\hat{r}}{r}$ if to calculate it you stumble upon $\nabla \cdot \vec{E} = \frac{1}{r^2} \frac{\partial}{\partial r} (\frac{r^2}{r})$?
Is it because the numerator converges more rapidly such that it can be differentiated and thus you can say that you avoid division by zero? If thats the case then why cant the limit of the former expression be 1? Or is this divergence also undefined and I haven't been told about it?
How can I determine when division by zero renders a nonexistent derivative?
Thanks.
 A: At $0$, $\vec{E}$ is not defined for either case so it does not make sense to consider the divergence at this point. However in the former case, the divergence of the electric field is zero everywhere except $0$ as you note. In the latter case, the divergence of the electric field behaves like $r^{-2}$. Not only is it not defined at zero, but it in fact diverges as you approach zero.
Gauss' theorem for electric fields says that $\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0}$, where $\rho$ is the electric density. For a point mass, it has no density away from its location, so we expect that the right hand side should be zero everywhere it is defined. This justifies our above calculation. However a point mass intuitively has "infinite" density at its location because there is a finite amount of charge localized within zero volume (making the ratio of charge to volume (i.e. charge density) infinite). Appealing to Gauss' law, this says that the divergence is somehow infinite at the origin. This is the justification for saying that the divergence explodes at the origin.
In the latter case, however, there would be a true density if we somehow measured an electric field of the form $\frac{\hat{r}}{r}$ since the divergence is nonzero everywhere. (Again: appeal to Gauss' law.) This does not resemble a point mass and so it's not an often-considered case outside of comparisons which is why your text does not make a big deal out of it.
A: To make sense of it, you should ask yourself what is involved with calculating the divergence. First, the divergence is calculated POINTWISE. That is, you pick a point and take some limits and such and end up with a number. In your case, the point $r=0$ is a "bad" point since we cannot make sense of the needed limit (difference quotient involved in computing partials).
What you should say is that at every POINT $(r,\theta)$ such that $r\neq 0$, the divergence exists and is the number you computed. At $r=0$, the divergence does not exist.
However, the divergence is supposed to measure the rate of flow of the field through some tiny surface enclosing the point. One could argue that certainly there is some flow of this field through a tiny sphere surrounding the origin. 
Let's compute the divergence a different way. Let's compute the limit 
$$
\lim_{r\to 0}\int_{S_{r}}\frac{3}{4\pi r^{3}}E\cdot n\ dS
$$
where $r>0$ and $S_r$ is a sphere of radius $r$. This is exactly measuring the rate of flow of the field through the sphere of radius $r$. Now the unit normal to a sphere (of any radius) is just the point $\frac{\hat{r}}{r}$. We get
$$
\lim_{r\to 0}\int_{S_{r}}\frac{3}{4\pi r^{3}}E\cdot n\ dS=
\lim_{r\to 0}\int_{S_{r}}\frac{3}{4\pi r^{3}}\frac{r^2}{r^{3}}\ dS=\lim_{r\to 0}\frac{3}{4\pi r^{4}}4\pi r^2=\lim_{r\to 0}\frac{3}{r^{2}}\to \infty
$$
This calculation shows that the divergence does indeed "explode" at 0.
