# Calculating the divergence of electric field using the definition of divergence.

If I try to calculate the divergence of electric field created by a point charge at the origin then I shall do something like this:

$$\displaystyle \mathbf{E}= \frac{1} {4\pi\epsilon_0} \frac{q}{r^2} \hat r$$

$$\displaystyle \mathbf{\nabla} \cdot \mathbf{E} = \frac{1}{r^2} ~ \frac{\partial (r^2E_r)}{\partial r} + \frac{1}{rsin\theta} ~ \frac{\partial (E_{\theta}sin\theta)}{\partial{\theta}} + \frac{1}{rsin\theta} \frac{\partial E_{\phi}}{\partial{\phi}}$$

$$\displaystyle E_{\theta} ~and~ E_{\phi}$$ will be zero and $$\displaystyle r^2 E_r = \frac{1}{4\pi\epsilon_0}q$$

$$\displaystyle \mathbf{\nabla} \cdot \mathbf{E} = \frac{1}{r^2} \frac{\partial kq}{\partial r}~~~~~~~~~~~~~~~~~~~~~~~~~~~, k= \frac{1}{4\pi\epsilon_0}$$

The derivative of a constant is zero and therefore

$$\displaystyle \mathbf{\nabla} \cdot \mathbf{E} = 0$$

But I have studied that $$\displaystyle \nabla \cdot \mathbf{E} = \frac{\rho}{\epsilon_0}$$. Why there is a discrepancy? I have worked out the divergence from the it's very definition.

#### topsquark

Forum Staff
If I try to calculate the divergence of electric field created by a point charge at the origin then I shall do something like this:

$$\displaystyle \mathbf{E}= \frac{1} {4\pi\epsilon_0} \frac{q}{r^2} \hat r$$

$$\displaystyle \mathbf{\nabla} \cdot \mathbf{E} = \frac{1}{r^2} ~ \frac{\partial (r^2E_r)}{\partial r} + \frac{1}{rsin\theta} ~ \frac{\partial (E_{\theta}sin\theta)}{\partial{\theta}} + \frac{1}{rsin\theta} \frac{\partial E_{\phi}}{\partial{\phi}}$$

$$\displaystyle E_{\theta} ~and~ E_{\phi}$$ will be zero and $$\displaystyle r^2 E_r = \frac{1}{4\pi\epsilon_0}q$$

$$\displaystyle \mathbf{\nabla} \cdot \mathbf{E} = \frac{1}{r^2} \frac{\partial kq}{\partial r}~~~~~~~~~~~~~~~~~~~~~~~~~~~, k= \frac{1}{4\pi\epsilon_0}$$

The derivative of a constant is zero and therefore

$$\displaystyle \mathbf{\nabla} \cdot \mathbf{E} = 0$$

But I have studied that $$\displaystyle \nabla \cdot \mathbf{E} = \frac{\rho}{\epsilon_0}$$. Why there is a discrepancy? I have worked out the divergence from the it's very definition.
I don't have much time to look up how to find the answer, but consider that you are working with a term: $$\displaystyle \dfrac{k}{r^2} \dfrac{d q}{d r}$$. You have a problem at r = 0: That's where the charge is and we're also working with $$\displaystyle 1/r^2$$, which can't strictly be taken at r = 0. Essentially your charge distribution is $$\displaystyle \rho = 4 \pi \delta (r)$$, where $$\displaystyle \delta (r)$$ is the Dirac delta function.

See if that will get you started.

-Dan

• 1 person

You are saying $$\displaystyle \frac{\partial q}{\partial r}$$ can not be taken to be zero because with $$\displaystyle r$$ the charge $$\displaystyle q$$ is changing, it's zero everywhere but q at the center. I quite getting you but can you please help just a little more? I mean what's the problem with that derivative, $$\displaystyle \frac{\partial q}{\partial r}$$.

Last edited:

#### topsquark

Forum Staff
Yeah, this took a while. Again my apologies.

Whilst I was working on this I kept going in circles as to what needs to be derived in what way and where. I did do some web digging and I feel the following should work out for you. If not, let me know.

Divergence. Go down to the section that saya "You must use the Dirac $$\displaystyle \delta$$ function and its properites." The whole thing is there step by step.

-Dan

• First of all thank you so much sir. You have done all those research just for solving the problem of a stranger like me. I have never met someone like you, if this forum have people like you then I believe that Physics Stackexchange will be left behind very soon. Your humble and kind words are so sweet and adds too much even to a simple answer.
Now, to give the real happiness: I have understood my doubt, the problem is that $$\displaystyle \frac{\partial q}{\partial r}$$ isn't simply zero, the graph of charge vs distance from center has been attached (I have made curvature near the zero just to make more visible). In the figure $$\displaystyle Q$$ is zero everywhere but at $$\displaystyle r=0$$ it's value is $$\displaystyle q$$ and hence we have got special kind of step function whose derivative can't found by elementary definition of derivatives.
After all you have helped me that link of Physics Stackexchange just added a little more information but the main thing was provided by you. Thank you so much.

#### Attachments

• 154.9 KB Views: 1
• 1 person

#### Torgny

the divergence of E is 0 outside the electron. So since the formula uses the electron as a point your calculations are correct. Inside the electron it is Here is a derivation    Well since there is a thread here I might ask a question myself. In this derivation above they calculate the field inside an electron. They do so by addding shells of charge. But in the intial calculation of E field from a charge in problem 2.7 they have a distance from the charged sphere. In problem 2.8 they go inside an electron and then there are some parts just around the point they calculate the E field in that don't have a seperation between the point and the charge volume. How can one prove mathematically that this is possible? The field is infinite since we have r^2 in the denumerator for E and at the same time the charge in the numerator goes to 0?

Last edited: