# Stuck on divergence of electric field

1. Dec 12, 2015

### betelgeuse91

1. The problem statement, all variables and given/known data
For a volume charge, $\textbf{E}(\textbf{r}) = \frac{1}{4\pi\epsilon_0}\int_{all space}\frac{\hat{\gamma}}{\gamma^2}\rho(r')d\tau'$
and I am trying to get the divergence of it.

2. Relevant equations
The book says
$\nabla\cdot\textbf{E} = \frac{1}{4\pi\epsilon_0}\int_{all space}[\nabla\cdot(\frac{\hat{\gamma}}{\gamma^2})]\rho(r')d\tau'$

3. The attempt at a solution
I am wondering why it is not
$\nabla\cdot\textbf{E} = \frac{1}{4\pi\epsilon_0}\int_{all space}[\nabla\cdot(\frac{\hat{\gamma}}{\gamma^2}\rho(r'))]d\tau'$
when taking $\nabla$ inside the integral, because if it should be this way,
then we need to apply the product rule of divergence. (I guess it's not the case)
Can somebody please explain why the divergence inside does not include the charge density function?
Thank you.

2. Dec 12, 2015

### ehild

The electric field at a point P with position vector $\vec r$ is the integral of the contribution of all charge elements dq. Those contributions depend on the distance of the charge element from the point P. That distance is denoted by γ in your formula. $\gamma =\vec r- \vec r'$, $\hat \gamma =\frac{\vec r- \vec r'}{|\vec r- \vec r'|}$.
You need the divergence with respect to $\vec {r}$, while ρ is function of $\vec {r'}$.

3. Dec 12, 2015

### betelgeuse91

Actually $\vec{r}$ is the position vector of target charge, and $\vec{r}'$ is the position vector of source charge, so we integrate it over $\vec{r}'$, so I think I need the divergence with respect to $\vec{r}'$

4. Dec 12, 2015

### betelgeuse91

I get it now...!! thank you very much!

5. Dec 12, 2015

### ehild

You are welcome.