The purpose of this post is to review how the fields of an electrostatic dipole \boldsymbol{\pi} and magnetostatic dipole \boldsymbol{\mu} arise. For the electrostatic dipole, “fields” means the electrostatic potential \phi and by extension the electrostatic field \textbf E=-\partial\phi/\partial\textbf x while for the magnetostatic dipole, “fields” means the magnetostatic potential \textbf A and by extension the magnetostatic field \textbf B=\partial/\partial\textbf x\times\textbf A.
Because one is working in the regime of electrostatics, Coulomb’s law is valid:
\phi(\textbf x)=\frac{1}{4\pi\varepsilon_0}\iiint_{\textbf x’\in\textbf R^3}\frac{\rho(\textbf x’)}{|\textbf x-\textbf x’|}d^3\textbf x’
An electrostatic dipole consists of two stationary charges \pm q separated by \Delta\textbf x; arbitrarily placing the charge -q at the origin \textbf x’=\textbf 0 implies that \rho(\textbf x’)=q(\delta^3(\textbf x’+\Delta\textbf x)-\delta^3(\textbf x’)). Substituting this into Coulomb’s law picks out:
\phi(\textbf x)=\frac{q}{4\pi\varepsilon_0}\left(\frac{1}{|\textbf x+\Delta\textbf x|}-\frac{1}{|\textbf x|}\right)
As \Delta\textbf x\to\textbf 0, one has by definition the directional derivative of 1/|\textbf x| along \Delta\textbf x:
\frac{1}{|\textbf x+\Delta\textbf x|}-\frac{1}{|\textbf x|}\to\Delta\textbf x\cdot\frac{\partial}{\partial\textbf x}\frac{1}{|\textbf x|}=-\Delta\textbf x\cdot\hat{\textbf x}/|\textbf x|^2
Using the definition \boldsymbol{\pi}:=-q\Delta\textbf x of the electrostatic dipole in this case, the electrostatic potential reduces to:
\phi(\textbf x)=\frac{\boldsymbol{\pi}\cdot\hat{\textbf x}}{4\pi\varepsilon_0|\textbf x|^2}
The electrostatic field then follows:
\textbf E(\textbf x)=-\frac{1}{4\pi\varepsilon_0}\frac{\partial}{\partial\textbf x}\frac{\boldsymbol{\pi}\cdot\textbf x}{|\textbf x|^3}=\frac{3(\boldsymbol{\pi}\cdot\hat{\textbf x})\hat{\textbf x}-\boldsymbol{\pi}}{4\pi\varepsilon_0|\textbf x|^3}
Meanwhile, because one is working in the regime of magnetostatics, the Biot-Savart law (in the Coulomb gauge) is valid:
\textbf A(\textbf x)=\frac{\mu_0}{4\pi}\iiint_{\textbf x’\in\textbf R^3}\frac{\textbf J(\textbf x’)}{|\textbf x-\textbf x’|}d^3\textbf x’
A magnetostatic dipole consists of a steady current loop I enclosing an area \textbf S, with \textbf J(\textbf x’)d^3\textbf x’\mapsto Id\textbf x’:
\textbf A(\textbf x)=\frac{\mu_0 I}{4\pi}\oint_{\textbf x’\in S^1}\frac{d\textbf x’}{|\textbf x-\textbf x’|}
As \textbf S\to\textbf 0, one has (still looking for a simple way to see this):
\oint_{\textbf x’\in S^1}\frac{d\textbf x’}{|\textbf x-\textbf x’|}\to\frac{\partial}{\partial\textbf x}\frac{1}{|\textbf x|}\times\textbf S
Using the definition \boldsymbol{\mu}:=I\textbf S of the magnetostatic dipole, the magnetostatic vector potential reduces to:
\textbf A(\textbf x)=\frac{\mu_0\boldsymbol{\mu}\times\hat{\textbf x}}{4\pi|\textbf x|^2}
From which the magnetostatic field is:
\textbf B(\textbf x)=\frac{\mu_0(3(\boldsymbol{\mu}\cdot\hat{\textbf x})\hat{\textbf x}-\boldsymbol{\mu})}{4\pi|\textbf x|^3}