Solution (source code)

= Solution

The fixed <point charge> produces <electric potential> $\phi(r)=k_eq/r$, where $k_e=1/(4\pi\epsilon_0)$. The external quasistatic <work> is the increase in <Coulomb potential energy>:
$$
\boxed{W_{+}=q\,[\phi(d)-\phi(2d)]=\frac{k_eq^2}{2d}=\frac{q^2}{8\pi\epsilon_0d}.}
$$
The endpoints have radii $2d$ and $d$, irrespective of their opposite coordinate signs. One must use a path avoiding the singular <point charge> at the origin. The <electric field> is conservative on such paths, so the endpoint calculation suffices; a literal straight path through the origin is inadmissible. The <work> done by the <electric field> has the opposite sign.