Contradicting forces on a circular loop under current in magnetic field? I have the following general conceptual concern.
Think of a thin conducting loop of radius $R$ placed in the $x$-$y$-plane at $z=0$. There is a homogeneous current density $\vec{j}$ running through this loop:
$$\vec{j}(\vec{r})=|j|\delta(z)\delta(x^2+y^2-R^2)\frac{-y\,\vec{e}_x+x\,\vec{e}_y}{\sqrt{x^2+y^2}}$$
Per definition, this loop has a magnetic moment of:
$$\vec{m}=\frac{1}{2}\int d^3r\,\left(\vec{r}\times\vec{j}(\vec{r})\right)=-|j|\pi R\,\vec{e}_z$$
Now, imagine there appears a magnetic field that can be locally described as:
$$\vec{B}=b_0 z\,\vec{e}_z$$
If we ask ourselves what the electromagnetic force on the loop will be, we have two equations that can give us the answer. (The two answers should be the same, but curiously they are not). First equation is the straightforward definition of Lorentz force:
$$\vec{F}_1=\int d^3r\,\left(\vec{j}(\vec{r})\times\vec{B}\right)$$
And the second equation makes use of the magnetic moment (and is also exact for this simple magnetic field):
$$\vec{F}_2=\nabla(\vec{m}\cdot\vec{B})$$
It is now straightforward to see that the first force has the structure $\vec{F}_1=A\vec{e}_x+B\vec{e}_y$, while the second force must clearly look like $\vec{F}_2=C\vec{e}_z\neq 0$ (evidently non-zero due to inhomogenous $\vec{B}$ field). My question is - what went wrong and how to fix this?
 A: The formula $F_2$ can be derived for bodies that are small enough that higher than first order variation in $\mathbf B$ inside the body has negligible impact on the force. For larger bodies, it is not valid, but F1 is.
So, F1 is more general than F2, but neither of them are good for anything if we use non-physical magnetic field function such as $z\mathbf e_z$. The fact that they give different result means some assumption in the derivation is broken in this situation. Probably the zero divergence of $\mathbf B$ is needed for the derivation of F2.
A: The solution came up in the comments, here is an elaboration. One of Maxwell's equations is:
$$\nabla\cdot\vec{B}=0$$
The local description for $\vec{B}$ given above clearly does not satisfy this. However, the defining equation for Lorentz force $\vec{F}_1$ assumes a magnetic field $\vec{B}$ that is valid not only locally, but over all space volume. Therefore, equation $\vec{F}_1$ cannot be applied here.
On the other hand, equation $\vec{F}_2$ is actually initially obtained involving a local linear approximation for an arbitrary 'valid' $\vec{B}$ field. The Maxwell's equation $\nabla\cdot\vec{B}=0$ is also already incorporated into the expression $\vec{F}_2$. Therefore, in this case only $\vec{F}_2$ gives the correct result.
