Please clarify a doubt in the article: Reflections in Maxwell's treatise

While going through an article titled "Reflections in Maxwell's treatise" a misunderstanding popped out at page 227 and 228. Consider the following equations $$(23\ a)$$ and $$(23\ c)$$ in the article (avoiding the surface integral):

$$\displaystyle \psi_m (\mathbf{r})=-\dfrac{1}{4 \pi} \int_V \dfrac{\nabla' \cdot \mathbf{M} (\mathbf{r'})}{|\mathbf{r}-\mathbf{r'}|} dV' =\dfrac{1}{4 \pi} \int_V \dfrac{\rho_m}{|\mathbf{r}-\mathbf{r'}|} dV' \tag{23a}$$

$$\displaystyle \mathbf{H}(\mathbf{r})=-\dfrac{1}{4 \pi} \int_V \nabla' \cdot \mathbf{M} (\mathbf{r'}) \dfrac{\mathbf{r}-\mathbf{r'}}{|\mathbf{r}-\mathbf{r'}|^3} dV' =\dfrac{1}{4 \pi} \int_V \rho_m \dfrac{\mathbf{r}-\mathbf{r'}}{|\mathbf{r}-\mathbf{r'}|^3} dV' \tag{23b}$$

$$\displaystyle \mu_0\mathbf{H}(\mathbf{r})=\dfrac{\mu_0}{4 \pi} \int_V \rho_m \dfrac{\mathbf{r}-\mathbf{r'}}{|\mathbf{r}-\mathbf{r'}|^3} dV'$$

where $$\rho_m=-\nabla' \cdot \mathbf{M} (\mathbf{r'})$$

Using Gauss law and divergence theorem and noting that the divergence due to the surface integral (in the article) is zero:

$$\nabla \cdot \mu_0\mathbf{H}(\mathbf{r})=\mu_0\ \rho_m=-\mu_0 \nabla' \cdot \mathbf{M} (\mathbf{r'})$$

Using the above result:

$$\nabla \cdot \mathbf{B}(\mathbf{r}) =\nabla \cdot (\mu_0\mathbf{H}(\mathbf{r})+\mu_0\mathbf{M} (\mathbf{r'}))=-\mu_0 \nabla' \cdot \mathbf{M} (\mathbf{r'})+\bbox[yellow]{\mu_0 \nabla \cdot \mathbf{M} (\mathbf{r'})}$$

$$\bbox[yellow]{\text{In the second term, since divergence is with respect to field coordinates, the second term is zero.}}$$ Therefore:

$$\nabla \cdot \mathbf{B}(\mathbf{r})=-\mu_0 \nabla' \cdot \mathbf{M} (\mathbf{r'})$$

But it should be zero (equation $$32$$ in the article). There must be something wrong in my calculation. Please explain why am I getting $$\nabla \cdot \mathbf{B}(\mathbf{r}) \neq 0$$

• Don;t be fooled by symbols. Integration variables are dummy variables. What really matters is that the term at numeratori in the integrand of equation 23a is the gradient of magnetization at some point. That term, as a function of the point, can be treated/interpreted as a density of magnetic "charge" at the same point. – GiorgioP May 15 at 11:23