# The Unapologetic Mathematician

## Gauss’ Law for Magnetism

Let’s repeat what we did to come up with Gauss law, but this time on the magnetic field.

As a first step, though, I want to finally get a good definition of “current density”: it’s a vector field $J$ that consists of a charge density $\rho$ and a velocity vector $v$, each of which is a function of space. In our example of an infinite line current, this density was concentrated along the $z$-axis, where the velocity was vertical. But it could exist along a surface, or throughout space; a single particle of charge $q$ moving with velocity $v$ is a current density concentrated at a single point.

Anyway, so the Biot-Savart law says that the differential contribution to the magnetic field at a point $r$ from the current density at point $s$ is

$\displaystyle dB(r)=\frac{\mu_0}{4\pi}J(s)\times\frac{r-s}{\lvert r-s\rvert^3}d^3s$

So, as for the electric field, we want to integrate over $s$:

$\displaystyle B(r)=\frac{\mu_0}{4\pi}\int\limits_{\mathbb{R}^3}J(s)\times\frac{r-s}{\lvert r-s\rvert^3}d^3s$

Last time we spent a while noting that the fraction here is secretly a closed $2$-form in disguise, so its divergence is zero. This time, I say it’s actually a conservative vector field:

$\displaystyle\frac{r}{\lvert r\rvert^3}=-\nabla\left(\frac{1}{\lvert r\rvert}\right)$

Indeed, this is pretty straightforward to check by rote calculation of derivatives, and I’d rather not get into it. The upshot is we can write:

\displaystyle\begin{aligned}B(r)&=\frac{\mu_0}{4\pi}\int\limits_{\mathbb{R}^3}J(s)\times\left(-\nabla\left(\frac{1}{\lvert r-s\rvert}\right)\right)d^3s\\&=\frac{\mu_0}{4\pi}\int\limits_{\mathbb{R}^3}\nabla\left(\frac{1}{\lvert r-s\rvert}\right)\times J(s)+\frac{1}{\lvert r-s\rvert}\left(\nabla\times J(s)\right)d^3s\end{aligned}

where the extra term on the second line is automatically zero because the curl is in terms of $r$ and the current density $J$ depends only on $s$. I write it in this form because now it looks like the other end of a product rule:

\displaystyle\begin{aligned}B(r)&=\frac{\mu_0}{4\pi}\int\limits_{\mathbb{R}^3}\nabla\times\left(\frac{1}{\lvert r-s\rvert}J(s)\right)d^3s\\&=\nabla\times\left(\frac{\mu_0}{4\pi}\int\limits_{\mathbb{R}^3}\frac{J(s)}{\lvert r-s\rvert}d^3s\right)\end{aligned}

Indeed, this is clearer if we write it in terms of differential forms; since the exterior derivative is a derivation we can write

$\displaystyle d(f\alpha)=df\wedge\alpha+fd\alpha$

for a function $f$ and a $1$-form $\alpha$. If we flip $\alpha$ over to a vector field $F$ this looks like

$\displaystyle\nabla\times(fF)=(\nabla f)\times F+f\nabla\times F$

Okay, so now we see that $B$ is the curl of some vector field, and so the divergence $\nabla\cdot B$ of a curl is automatically zero:

$\displaystyle\nabla\cdot B=0$

Coupling this with the divergence theorem like last time, we conclude that there is no magnetic equivalent of “charge”, or else the outward flow of $B$ through a closed surface would be the integral on the inside of such a charge. But instead we find

$\displaystyle\int\limits_{\partial U}B\cdot dS=\int\limits_U\nabla\cdot B\,d^3s=0$

January 12, 2012 -

1. Re: “where the extra term on the second line is automatically zero” — where did that extra term come from in the first place? I see (J(s) \cross (-X))d^3s = (X \cross J(s))d^3s by anticommutativity of the cross product, where “X” is (grad (1/|r-s|)); am I reading it misparenthesized?

I don’t trust cross products.

Comment by Joe English | January 12, 2012 | Reply

2. I added it, Joe, because it’s automatically zero, and it puts the whole formula into position for running the product rule in reverse. Try going from the next line (after the short paragraph), with the curl of the product and apply a product rule to get up to the version with the two terms.

Comment by John Armstrong | January 12, 2012 | Reply

3. “so now we see that is the curl of some vector field, and so the divergence of a curl is automatically zero” — the math symbols in that sentence show “del cross B” and then “del cross B = 0″. Should those be “del dot B” and “del dot B = 0″? Thanks.

Comment by RyanRyan | January 13, 2012 | Reply

4. Ah, yes, you’re right. Thanks, RyanRyan.

Comment by John Armstrong | January 13, 2012 | Reply

5. [...] we saw when discussing Gauss’ law for magnetism, we can rewrite the fraction in the [...]

Pingback by Faraday’s Law « The Unapologetic Mathematician | January 14, 2012 | Reply

6. [...] go back to the way we derived the magnetic version of Gauss’ law. We [...]

Pingback by Ampère’s Law « The Unapologetic Mathematician | January 30, 2012 | Reply

7. [...] first is Gauss’ law and the second is Gauss’ law for magnetism. The third is directly equivalent to Faraday’s law of induction, while the last is [...]

Pingback by Maxwell’s Equations « The Unapologetic Mathematician | February 1, 2012 | Reply

8. [...] Gauss’ law and Gauss’ law for magnetism, we’ve actually already done this. First, we write them in differential [...]

Pingback by Maxwell’s Equations (Integral Form) « The Unapologetic Mathematician | February 2, 2012 | Reply

9. [...] magnetic field generated by a collection of circuits , each carrying a current . Recall that Gauss’ law for magnetism tells us that ; since space is contractible, we know that its homology is trivial, and thus must [...]

Pingback by Energy and the Magnetic Field « The Unapologetic Mathematician | February 14, 2012 | Reply

10. [...] problem arises again in justifying the existence of a vector potential: as Gauss’ law for magnetism tells us, for a magnetic field we have ; therefore for some vector potential because the [...]

Pingback by A Short Rant about Electromagnetism Texts « The Unapologetic Mathematician | February 18, 2012 | Reply

11. [...] A very small sample chosen mostly at random: Coulomb’s Law, The Biot-Savart Law, Currents, Gauss’ Law for Magnetism, Faraday’s Law, Conservation of Charge, Deriving Physics from Maxwell’s [...]