I found a nice paper about inverse vector operators here. I have successfully implemented a Mathematica function for most of them, however I can't figure out how to do inverse gradient (page 7 in the paper). According the paper, the inverse gradient can be computed as a path independent line integral, but in my attempts I got improper results. The paper doesn't show up an example for it and I'm not really familiar with line integrals.

If anyone could help me I would be really thankful.

• Please add working code to make reproduction of your problem possible. Otherwise answering will be difficult. – user9660 Jan 16 '15 at 3:54
• My problem is that I dont have a working code. I got a concept how to find the potential function (inverse gradient) of a conservative vector field with line integral. However I don't know how to implement it in Mathematica. Let's say B=Grad[A,{x,y,z}]; where A is a function of [x,y,z]. If I know only the vector field B, according the paper one can find A. – plasmacel Jan 16 '15 at 4:00

Perform the line integral over the straight-line path from the origin to $(x,y)$ via the parametrization $u(t)=(tx,ty)$ for $0\le t\le1$. Then $\mathrm du=(x,y)\,\mathrm dt$, so the integral can be computed as
Integrate[b[t x, t y].{x, y}, {t, 0, 1}]

Note that if $b = \nabla a$, from $b$ one can only recover $a$ up to a constant. In this case, since we are integrating from the origin, what we obtain is $a(x,y)-a(0,0)$. This may be a problem if $a$ has a singularity at the origin, in which case you'll need to integrate from a different point.