Given a field $\vec{F} = <F_x,F_y,F_z>$; If a potential can be defined at any point, then the field is necessarily conservative and we can use any path to find the potential. I'll consider moving along the axes. Thus, from an arbitrary starting point $(0,0,0)$, integrating first along the x-axis (where $y$, $z$ are constants), then along the y-axis, then the z-axis, should give the potential associated with an arbitrary point $(x,y,z)$.
I.e., $-U = \int_0^x F_xdx + \int_0^y F_ydy + \int_0^z F_zdz$ which is of course, $U(x,y,z) = -\int{\vec{F}\cdot <dx,dy,dz>}$
Now, I know that this doesn't work (eg given below), and I also know how to solve the question correctly from Mark Viola's answer to another question on here. I also understand why that solution works. But why doesn't this?
example
$\vec{F} = <4xy, 2x^2>$, thus $U = -\int_{(0,0)}^{(x,0)}4xydx + -\int_{(x,0)}^{(x,y)}2x^2dy =-\int_0^{(x,y)} \vec{F}\cdot <dx,dy>$
$U = -\int_0^x 4xydx + -\int_0^y 2x^dy = -2x^2y + -2x^2y + C = -4x^2y + C$
but if you verify using $\vec{F} = -\nabla\cdot U$, we don't get the original $\vec{F}$ back.