If you are given a vector field, how do you find a vector potential for it?
In my particular case, I need to find a vector field $\vec{A}$ such that
$ \vec{\nabla} \times \vec{A}(\,\vec{r}) = \begin{cases} B_0\hat{z} && \text{if $\vec{r} \in$ some cylinder along } \hat{z} \newline \vec{0} && \text{ otherwise} \end{cases} $
but I'm hoping for a better answer than "guess-and-check" (or at least, a more generic way of guess-and-checking) that would help me in other cases as well.
Note:
The vector field (and hence, the potential) does not necessarily go to zero as we approach infinity.