Vector calculus and principle of reciprocity MRI

I'm studying the principle of reciprocity for the MRI. At some point during a calculation the book states that:

$$\oint d\vec{l} \cdot \left[\int d^3r' \frac{\vec{\nabla'}\times\vec{M}(\vec{r}')}{\left| \vec{r}-\vec{r}' \right|} \right] = \int d^3r' \oint d\vec{l} \cdot \left[ \left( - \vec{\nabla'}\frac{1}{\left| \vec{r}-\vec{r}' \right|} \right) \times\vec{M}(\vec{r}') \right]$$

This is supposed to come up when you integrate by parts negletting a surface term because there are finte sources. Unfortunately I don't see the right way to prove this relation.

Additional physics context: The space is $\mathbb{R}^3$ and the primed terms refer to the sources, there is a magnetization vector $\vec{M}$ with the relative current density $\vec{J}=\vec{\nabla}\times \vec{M}$. The flux of the magnetization field trough an antenna (i.e a simple coil) is $\Phi = \oint d\vec{l} \cdot \vec{A}$ where $\vec{A}$ is the vector potential: $$\vec{A} \propto \int d^3r' \frac{\vec{\nabla'}\times\vec{M}(\vec{r}')}{\left| \vec{r}-\vec{r}' \right|}$$

What I thought so far:

By using the vector identity $\nabla \times (f \mathbf{A}) = \nabla f \times \mathbf{A} + f \nabla \times \mathbf{A}$ I get the solution above plus an extra term:

$$\int d^3r' \; \vec{\nabla'}\times\left( \frac{\vec{M}(\vec{r}')}{\left| \vec{r}-\vec{r}' \right|} \right)$$

But I don't see how this is zero.

• Use Stoke's theorem: $\int_V (\nabla \times \vec{A}) dV= \int_S (\hat{n} \times \vec{A}) da$. – secavara Feb 22 '18 at 19:43