Solution (source code)

= Solution

An <electric dipole> has equal and opposite charges separated by a small vector from negative to positive, with <electric dipole moment> $\mathbf p=q\mathbf d$. More generally, a localized neutral distribution has $\mathbf p=\int\mathbf r'\rho(\mathbf r')\,d^3r'$, independent of origin. At distances large compared with its size, the leading nonzero term in the <multipole expansion> is
$$
\phi(\mathbf r)=\frac{\mathbf p\cdot\hat{\mathbf r}}{4\pi\epsilon_0r^2},\qquad
\mathbf E(\mathbf r)=\frac{3(\mathbf p\cdot\hat{\mathbf r})\hat{\mathbf r}-\mathbf p}{4\pi\epsilon_0r^3},\quad r>0.
$$
The field points along $\mathbf p$ on either axial side and opposite $\mathbf p$ in the equatorial plane; its axial magnitude is twice the equatorial magnitude at equal <radius>. Near the charges the finite-charge expression must replace the far-field approximation.

A permanent dipole in an externally imposed slowly varying electrostatic field has interaction <energy> $-\mathbf p\cdot\mathbf E$, <torque> $\boldsymbol\tau=\mathbf p\times\mathbf E$ and <force> $\nabla(\mathbf p\cdot\mathbf E)$ for fixed $\mathbf p$. A uniform field aligns it but gives no net <force>. For a linearly induced dipole $\mathbf p=\alpha\mathbf E$, the formation-inclusive <energy> is $-\alpha E^2/2$, not $-\alpha E^2$: the moment itself grows while the field is applied. Dipole <density> gives <electric polarization>, whose bound charges are $\rho_b=-\nabla\cdot\mathbf P$ and $\sigma_b=\mathbf P\cdot\hat{\mathbf n}$.