Deriving Biot-Savart Law from Maxwell's Equations As an exercise, I've been trying to derive the Biot-Savart law from the second set of Maxwell's equations for steady-state current
$$\begin{align}&\nabla\cdot\mathbf{B}=0&&\nabla\times\mathbf{B}=\mu_0\mathbf{J}\end{align}$$
I've been able to do this using the fact that an incompressible field has a vector potential $\mathbf{A}$, allowing me to rewrite the second equation as
$$\nabla^2\mathbf{A}=-\mu_0\mathbf{J}$$
which can be solved by components using the Green's function for the Laplacian, yielding
$$\mathbf{A}(\mathbf{x})=\frac{\mu_0}{4\pi}\int\frac{\mathbf{J}(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}\,d^{3}\mathbf{x}'$$
and since $\nabla\times\left(\psi\mathbf{J}\right)=\psi\nabla\times\mathbf{J}+\nabla\psi\times\mathbf{J}$,
$$\nabla\times\mathbf{A}=\mathbf{B}(\mathbf{x})=\frac{\mu_0}{4\pi}\int\frac{\mathbf{J}\times(\mathbf{x}-\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|^3}\,d^{3}\mathbf{x}'$$
as desired. However, if instead I take the curl of both sides of Ampere's Law, and use the identity $\nabla \times \left( \nabla \times \mathbf{B} \right) = \nabla(\nabla \cdot \mathbf{B}) - \nabla^{2}\mathbf{B}$ initially, I find that
$$\nabla(\nabla \cdot \mathbf{B}) - \nabla^{2}\mathbf{B}=0-\nabla^2\mathbf{B}=\mu_0\nabla\times\mathbf{J}$$
which I can again solve like Poisson's equation, yielding
$$\mathbf{B}(\mathbf{x})=-\frac{\mu_0}{4\pi}\int\frac{\nabla'\times\mathbf{J}(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}\,d^3\mathbf{x}'$$
which can be simplified using the identity $\psi(\nabla\times\mathbf{J})=-\nabla\psi\times\mathbf{J}+\nabla\times\left(\psi\mathbf{J}\right)$, giving
$$\mathbf{B}(\mathbf{x})=\frac{\mu_0}{4\pi}\int\frac{\mathbf{J}(\mathbf{x}')\times(\mathbf{x}-\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|^3}\,d^3\mathbf{x}'-\frac{\mu_0}{4\pi}\int\nabla'\times\left(\frac{\mathbf{J}(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}\right)\,d^3\mathbf{x}'$$
The first integral is precisely the Biot Savart law, but I have no idea how to make the second integral vanish. I've exhausted any obvious vector calculus identities, and Stokes theorem doesn't help much. I'm clearly missing an obvious mistake, but I haven't been able to locate it. This is similar to other questions that have been asked before, but I have a specific question about a step in the derivation which is not answered elsewhere.
 A: As far as I can remember, the formula you obtain is right. You can make this "problematic" integral disappear by using the following identity, that we will call "curl theorem" :
$$\int\vec{\nabla}\times\vec{w}dV = -\int\vec{w}\times d\vec{S}$$
To show this is true, we are going to use the divergence or Green-Ostrogradski theorem, namely 
$$\int\vec{\nabla}\cdot \vec{v}dV = \int \vec{v}\cdot d\vec{S}$$
Since the divergence theorem is a scalar identity while the curl theorem is a vector identity, we are going to need three distinct vector fields that we are going to denote $\vec{v}_i$. Now, we would want $\vec{\nabla}\cdot\vec{v}_i = (\vec{\nabla}\times\vec{w})_i$ to deduce an identity on the curl. Writing that in tensor notation :
$$\partial^k(v_i)_k=\epsilon_{ikl}\partial^k w^l$$
As we can see, it is sufficient to take $(\vec{v}_i)_k = \epsilon_{ikl}w^l$ and the relation will be satisfied. So, for such a vector field we have $\vec{\nabla}\cdot\vec{v}_i = (\vec{\nabla}\times\vec{w})_i$.
Applying the divergence theorem to $\vec{v}_i$ :
$$\int(\vec{\nabla}\times\vec{w})_idV = \int\vec{\nabla}\cdot\vec{v}_idV = \int\vec{v_i}\cdot d\vec{S} = \int (v_i)_k(d\vec{S})^k = \int\epsilon_{ikl}w^l(d\vec{S})^k = -\int(\vec{w}\times d\vec{S})_i$$
Thus giving a proof of the "curl theorem". Using it on your problematic integral :
$$-\frac{\mu_0}{4\pi}\int\nabla'\times\left(\frac{\mathbf{J}(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}\right)\,d^3\mathbf{x}' = -\frac{\mu_0}{4\pi}\int\left(\frac{\mathbf{J}(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}\right)\,\times d\vec{S}'$$
Now, the volume integral is done on all of space, and provided you suppose that $\lim_{x'\rightarrow\infty}\frac{\vec{J}(x')}{|x-x'|} = 0$, it gives a 0 contribution. Why does this not add any crazy assumptions ? 
For this limit to be non-zero, we must necessarily have that $|J(x)|$ tend to infinity. Indeed, suppose $J(x)$ is finite. Then, there is a constant $C$ such that $|J(x)|<C$. Then, $lim_{x'\rightarrow\infty}\frac{|J(x')|}{|x-x'|}<\lim_{x'\rightarrow\infty}\frac{C}{|x-x'|} = 0$. Thus, if we were to have this "extra" integral not vanish, we would be required to have an infinite current density at infinity, which seems to be not so physical.
Of course, all my derivation where done in the context of well-behaved functions. It won't work say for an infinitely small wire, as the current density becomes a distribution (using the dirac delta $\delta(x)$). I am not qualified enough to tackle this case rigorously, but I hope the explanation above gives an idea to why setting this integral to 0 is sensible.
A: A first observation is that this is not particular to magnetism. The exact same thing happens if you try to find Coulomb's law for the electric field; you get a term like
$$\int  \nabla' \frac{\rho(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}\ d^3 \mathbf{x}'$$
which should be zero. Well, there are no fancy vector calculus identities involved, just plain old fundamental theorem of calculus. To see this, let's look at your version. The integral is a vector, and each component has two terms because of the curl. Let's concentrate on the first term of the first component:
$$\int \partial'_2 \left( \frac{J_3(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|} \right)\ d^3\mathbf{x}'$$
By Fubini's theorem (assuming sufficiently well behaved functions), we can integrate the three variables in any order. The $x_2'$ integration is trivial because the integrand is a total derivative, so the result is just the thing inside the parenthesis evaluated at $x_2' = \pm \infty$, which we typically assume to be zero. Therefore this term vanishes, and so do all the others because they are essentially the same.
