Solution (source code)

= Solution

Each field has only an azimuthal component and is independent of $r$ and $\phi$. The <curl in spherical coordinates> therefore reduces to
$$
(\nabla\times\mathbf A)_r
=\frac1{r\sin\theta}
\frac{\partial}{\partial\theta}
\bigl(\sin\theta A_\phi\bigr),
\qquad
(\nabla\times\mathbf A)_\theta
=-\frac1r\frac{\partial}{\partial r}(rA_\phi),
$$
and its $\phi$ component vanishes. The <half-angle identities>
$$
\sin\theta\tan\frac\theta2=1-\cos\theta,
\qquad
\sin\theta\left(-\cot\frac\theta2\right)=-(1+\cos\theta)
$$
show in both cases that
$$
\boxed{\nabla\times\mathbf A_+
=\nabla\times\mathbf A_-
=\frac{\mathbf e_r}{r^2}
=\frac{\mathbf x}{r^3}}.
$$

Apply part (a) with $g(r)=r^{-3}$. Then
$$
\nabla\cdot\frac{\mathbf x}{r^3}
=r(-3r^{-4})+3r^{-3}=0
$$
away from the origin, explicitly confirming that each resulting <curl> has zero <divergence>.