divergence free vector fields on non-simply connected domains

We know that divergence free vector fields are themselves curls of vector fields on simply connected domains. I want to construct a counter example in the case the domain is not simply connected. So consider an infinite line of charge along the $z$-axis of constant charge density. Then its electric field is given (unless I have made a mistake!) by $$\vec{E} = k\langle\frac{x}{x^2+y^2}, \frac{y}{x^2+ y^2},0\rangle.$$ By Gauss' theorem this should be divergence free (also follows from a simple computation). Can it be shown that this is not the curl of some vector field?

I guess in general if we can find a surface without boundary on which the flux is not zero then by Stokes' theorem the electric field cannot be the curl of a vector potential. But the problem is that there cannot find a closed surface without boundary around the $z$-axis, and so maybe one has to take the unit sphere and remove a small cylinder and use some approximation argument. Any ideas?

The "standard example" of a divergence-free non-curl field is the radial field $$\frac{(x, y, z)}{(x^{2} + y^{2} + z^{2})^{3/2}},$$ which has positive flux through the unit sphere. (Note that the domain is simply-connected, but has non-trivial second homology. Simple-connectedness of the domain is relevant when you look for curl-free non-gradient fields.)
Your example is the curl of a vector field defined on the complement of the $z$ axis, namely $$\langle \dfrac{yz}{x^2 + y^2}, \dfrac{xz}{x^2 + y^2}, 0 \rangle$$
The condition on the domain $D$ for a divergence free field to be a curl is not that it is simply connected, but rather that every closed surface in $D$ is the boundary of a domain contained in $D$.
• Please check, the vector field should be $\langle \frac{yz}{x^2+y^2}, \frac{-xz}{x^2+y^2},0\rangle$ (negative sign), whose curl gives op's electric field. Jul 5, 2023 at 19:00