Solution (source code)

= Solution

The absence of magnetic monopoles is expressed by $\nabla\cdot\mathbf B=0$. In a regular simply connected region, a magnetic <vector> potential may be introduced so that
$$
\boxed{\mathbf B=\nabla\times\mathbf A.}
$$
Its units are $\mathrm{T\,m}=\mathrm{Wb\,m^{-1}}$. It is not unique: adding a gradient leaves the <magnetic field> unchanged because $\nabla\times\nabla\chi=0$. In time-dependent electromagnetism,
$$
\mathbf E=-\nabla\phi-\partial_t\mathbf A,
\qquad
\mathbf A\mapsto\mathbf A+\nabla\chi,\quad
\phi\mapsto\phi-\partial_t\chi
$$
is a <gauge transformation> preserving both physical fields. <Stokes theorem> gives $\oint_C\mathbf A\cdot d\boldsymbol\ell=\int_S\mathbf B\cdot d\mathbf S=\Phi_B$ for a contour bounding an appropriate surface.

For localized steady currents, choose the <Coulomb gauge> $\nabla\cdot\mathbf A=0$. Substitution into <Ampère's law> and the curl-of-curl identity gives
$$
-\nabla^2\mathbf A=\mu_0\mathbf J,
\qquad
\mathbf A(\mathbf r)=\frac{\mu_0}{4\pi}\int\frac{\mathbf J(\mathbf r')}{|\mathbf r-\mathbf r'|}\,d^3r'.
$$
<Boundary conditions> are needed in addition to the gauge choice. For a uniform <magnetic field> one convenient choice is $\mathbf A=\tfrac12\mathbf B\times\mathbf r$. For a magnetic dipole, $\mathbf A=\mu_0\mathbf m\times\mathbf r/(4\pi r^3)$ outside its source. The magnetic <vector> potential simplifies field calculations and appears directly in the <Lagrangian> of a charged particle, $L=\tfrac12m v^2+q\mathbf v\cdot\mathbf A-q\phi$. In multiply connected regions, a field-free region can retain nontrivial circulation of $\mathbf A$, relevant to the <Aharonov-Bohm effect>; a local gauge argument cannot remove every global circulation.