Finding the vector potential of magnetic field via line integration
If we look at the relationship between the scalar electric potential and electric field in electrostatics, $\vec{E} = - \vec{\nabla} \phi$, we can easily invert this relationship by $$ V (\vec{r}) = -\int \limits_{\vec{r}_0}^{\vec{r}} \mathrm{d} \vec{\ell} \cdot \vec{E} $$ where $\vec{r}_0$ is arbitrary.
This got me thinking; is the same possible for magnetic field $\vec{B} = \vec{\nabla} \times \vec{A}$? Can we find $\vec{A}$ (in some specific gauge) from $\vec{B}$ by inverting this relationship in terms of a line integral (I'm aware of finding $\vec{A}$ from current distribution, but that's a volume integral and it involves sources, which I'd like to avoid).
So I made a guess: $$ \vec{A} (\vec{r}) \overset{?}{=} \int \limits_{\vec{r}_0}^{\vec{r}} \mathrm{d} \vec{\ell} \times \vec{B} $$
Of course, we need to verify that this is correct (it isn't, but it's only a constant factor), which we can do $$ A_j \overset{?}{=} \varepsilon_{jab} \int \limits_{\vec{r}0}^{\vec{r}} \mathrm{d} \ell_a B_b \quad \to \quad \left( \vec{\nabla} \times \vec{A} \right)_i = \varepsilon{ikj} \partial_k A_j = \varepsilon_{ikj} \varepsilon_{jab} \partial_k \int \limits_{\vec{r}_0}^{\vec{r}} \mathrm{d} \ell_a B_b $$
I'm not so sure about this, but from what I understand, a derivative acting on a line integral like this will pluck out the index of the line element, $\mathrm{d} \ell$, in this case, $a$ becomes $k$ $$ \left( \vec{\nabla} \times \vec{A} \right)i = \varepsilon{ikj} \varepsilon_{jkb} B_b = \left( \delta_{ik} \delta_{kb} - \delta_{ib} \delta_{kk} \right) B_b = B_i - 3 B_i = - 2 B_i $$
So the correct formula would seem to be $$ \vec{A} (\vec{r}) \overset{\checkmark}{=} - \frac{1}{2} \int \limits_{\vec{r}_0}^{\vec{r}} \mathrm{d} \vec{\ell} \times \vec{B} $$
I verified that this should be the case on a simple magnetic field $\vec{B} = B_0 \hat{z}$ and for path that is a straight line between $\vec{r}_0 = \vec{0}$ and $\vec{r}$. In that case $\mathrm{d} \vec{\ell} = \hat{r} \mathrm{d} \ell$. We also need $\hat{r} \times \hat{z} = - \hat{\varphi}$ and the integral becomes $$ \vec{A} (\vec{r}) = \frac{1}{2} B_0 \hat{\varphi} \int \limits_0^r \mathrm{d} \ell = \frac{1}{2} B_0 r \hat{\varphi} = \frac{1}{2} B_0 \left( -y, x, 0 \right) $$
Taking a curl of this gives the original magnetic field. 903