Force on electric dipole (Griffiths)

A pure dipole $p$ is located at the origin, pointing in $z$ direction.

a) What is the force on a point charge $q$ at $(a,0,0)$? (Carthesian coordinates)

b) What is the force on $q$ at $(0,0,a)$ ?

c) What work is needed to move this charge from the location (a) to the location (b)?

The electric field of the dipole $\overrightarrow{p}$ at distance $\overrightarrow{r}$ is defined as

$\overrightarrow{E}(\overrightarrow{r})= \frac {k}{r^3}*[\frac{3(\overrightarrow{p}\overrightarrow{r})\overrightarrow{r}}{r^2}-\overrightarrow{p}]$

If the charge $q$ is located at $\overrightarrow{r}=(a,0,0)$ and $\overrightarrow{p}=(0,0,p)$ is pointing in the z direction then the electric field and

the force are ($\hat z$ is the unity vector along the $z$ axis):

$\overrightarrow{E}(\overrightarrow{r}) =\frac {k}{a^3}*[0-p \hat z]= \frac {kp}{a^3}*\hat z$

that is

$\overrightarrow{F}(a,0,0)=q*\overrightarrow{E}=-\frac{kqp}{a^3}\hat z$

If the charge $q$ is located at $\overrightarrow{r}=(0,0,a)$ and $\overrightarrow{p}=(,0,p)$  the electric field at $\overrightarrow{r}$ and force om $q$ are:

$\overrightarrow{E}(\overrightarrow{r})=\frac {k}{a^3} [\frac {(3pa)a}{a^2}-p]*\hat z=\frac{2kp}{a^3}\hat z$

that is

$\overrightarrow{F}(0,0,a)= q\overrightarrow{E}=\frac{2kp}{a^3}\hat z$

The potential of a dipole at distance $\overrightarrow{r}$ is defined as

$V\overrightarrow{r}=k\frac{\overrightarrow{r}\overrightarrow{p}}{r^3}$

so that

$V(a,0,0)=0$ and $V(0,0,a) =k\frac{ap}{a^3}=k\frac{p}{a^2}$

Since the electric field is conservative the work between points $(a,0,0)$ and $(0,0,a)$ does depend only on the beginning and ending points.

$W=q*[V(0,0,a)-V(a,0,0)] =k\frac{qp}{a^2}$