Solution (source code)

= Solution

An <electric dipole> consists of opposite <electric charges> separated by a short displacement. Its <electric dipole moment> is $\mathbf p=q\mathbf d$, directed from negative to positive <electric charge>. At distances large compared with the separation, its leading <electric potential> and <electric field> in vacuum are
$$
\boxed{V(\mathbf r)=\frac{\mathbf p\cdot\widehat{\mathbf r}}{4\pi\epsilon_0r^2},\qquad \mathbf E(\mathbf r)=\frac{3(\mathbf p\cdot\widehat{\mathbf r})\widehat{\mathbf r}-\mathbf p}{4\pi\epsilon_0r^3}.}
$$
The absence of net <electric charge> removes the monopole term; the dipole <electric potential> therefore falls as $r^{-2}$ rather than $r^{-1}$. On its axis the <electric field> is parallel to $\mathbf p$ with magnitude $2p/(4\pi\epsilon_0r^3)$; on the equatorial plane it points oppositely with half that magnitude.

In a uniform applied <electric field>, the two <forces> cancel as a net translation but form a couple. The <torque> and <potential energy> are
$$
\boxed{\boldsymbol\tau=\mathbf p\times\mathbf E,\qquad U=-\mathbf p\cdot\mathbf E.}
$$
Alignment parallel to the <electric field> is stable. A nonuniform <electric field> can also exert a net <force>, $\mathbf F=\nabla(\mathbf p\cdot\mathbf E)$ for a fixed permanent <electric dipole moment>. An induced <electric dipole> instead depends on the applied <electric field>, so its <energy> must account for the work needed to create it.