# How to find a vector potential (inverse curl)?

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.

-
– Will Jagy Apr 7 '12 at 21:18
@WillJagy: Looking at it, thanks. (Not sure if it works yet or not.) – Mehrdad Apr 7 '12 at 21:23
It looks like the question is a duplicate of the question in Will's comment. – Fabian Apr 7 '12 at 22:01
@Fabian, Will: I got $\vec{A} = \langle -y, x \rangle$, which is true for inside the cylinder, but which cannot be true outside. However, if $\vec{A}$ is continuous (which it must be because of my problem, since it's a magnetic vector potential), that means it must have nonzero curl outside, right? So how does that work? – Mehrdad Apr 8 '12 at 0:43
@Will, Fabian: Here's a link to my calculation at the boundary. – Mehrdad Apr 8 '12 at 0:49

As already noted in an old answer, the inverse of the curl operator (up to possible problems with the domain not having a star shape) can be written as $$\vec A(\vec r)= \int_0^1 [\vec B(t \vec r) \times (t\vec r) ]\, dt.$$

For concreteness, let us assume that the cylinder has radius $R$ and we use cylindrical coordinates $\vec r=(\rho \cos\theta,\rho \sin \theta, z)$. Then we have $$A_x(\vec r)= -y B_0 \int_0^1 t \mathop H(R-t\rho)\,dt$$ with $H$ the Heaviside-step function. Similarly, $$A_y(\vec r)= x B_0 \int_0^1 t \mathop H(R-t\rho)\,dt$$ and $$A_z(\vec r)=0.$$

To find an explicit form of $\vec A(\vec r)$, we need to perform the integral ($\rho= \sqrt{x^2 + y^2}$) $$\int_0^1 t \mathop H(R-t\rho)\,dt = \int_0^{\mathop{\rm min}(R/\rho,1)}\!\!\!t\,dt = \tfrac12\mathop{\rm min}(R/\rho,1)^2 .$$

Edit: Putting everything together, we have $$\vec{A}(\vec r) = \tfrac12 B_0\mathop{\rm min}(R/\rho,1)^2 \begin{pmatrix}-y\\x\\0\end{pmatrix} =\tfrac12 B_0\mathop{\rm min}\left[\frac{R^2}{x^2+y^2},1\right] \begin{pmatrix}-y\\x\\0\end{pmatrix}.$$

-
I'm confused with your notation... isn't the answer supposed to be a vector? – Mehrdad Apr 8 '12 at 4:52
How about $\vec{A}(\vec r) = (A_x, A_y, A_z)$? – Fabian Apr 8 '12 at 4:53
Uhm, sure? I obviously know what that means lol; I was referring to the explicit form... – Mehrdad Apr 8 '12 at 4:54
I added a line where I plugged the result of the integration back into the expression of $A_x$, $A_y$, and $A_z$ obtained above... – Fabian Apr 8 '12 at 4:59
Oh lol, I misunderstood part of your answer, sorry for being stupid. I think my mistake was when squaring integrate the function, I didn't square it; thanks. – Mehrdad Apr 8 '12 at 5:01