How do you find the potential function V of the gradient system? As you may know, if a system can be written in the form:
$$\dot{\mathbf{x}}= -\bigtriangledown V$$
for some continuously differentiable, single-valued scalar function $V(x)$. such a system is called gradient system with potential function $V$.
The question is that having the gradient system, how can one find its potential function?
 A: I'm going to assume everything is happening in $\mathbb{R}^n$, which I think is what you intended.
Start by defining V(0) = 0.
Now, for each $x\in \mathbb{R}^n$, let $\gamma_x:[0,b]\rightarrow \mathbb{R}^n$ be a (piecewise) smooth curve with $\gamma_x(0) = 0$ and $\gamma_x(b) = x$, i.e., $\gamma_x$ is any continuous curve joining $0$ to $x$.  Define $V(x) = \int_0^b W \cdot d\gamma_x(t) = \int_0^b W(\gamma_x(t))\cdot \gamma_x'dt$, that is, $V(x)$ is the result obtained by integrating $W$ along $\gamma_x$.
First note that by the fundamental theorem for line integrals, $V(x)$ is independent of the choice of curve.  Thus, to actually compute $V(x)$, one may as well take $\gamma_x$ to be a straight line joining $0$ and $x$ (or, if some other path gives a nicer integral, use that).
However, to actually prove that this $V(x)$ satisfies $\nabla V = W$, it'll help to be able to pick the curves however we want.
So, why does this $V(x)$ work?  Well, suppose one wants to compute $\frac{d}{dx_1} V(x)$.  Formally, this is lim$_{h\rightarrow 0} \frac{V(x+he_1) - V(x)}{h}$, where $e_1$ is a unit vector in the direction of $x_1$.
To actually evaluate this, make life as easy as possible by picking $\gamma_{x+he_1}$ and $\gamma_x$ nicely.  So, pick $\gamma(t)$ to be a smooth curve which starts at 0, and when , near $x$, looks like a straight line pointing in the direction of $e_1$, with $\gamma(1) = x$.  Thus, $\gamma(t)$ is both $\gamma_x$ and $\gamma_{x+he_1}$, if you travel along it long enough.
Then $V(x+he_1) - V(x) = \int_1^{1+h} W\cdot e_1 dt$.
But then $\frac{d}{dx_1} V(x) = $lim$_{h\rightarrow 0}\frac{1}{h} \int_1^{1+h} W\cdot e_1 dt$.  But then, by the fundamental theorem of calculus (the usual one variable version), this is exactly $W\cdot e_1$, i.e., it's the first component of $W$.  Of course, the other components work analogously.
(Incidentally, using Petya's isomorphism between vector fields and one forms, and using Stokes' theorem in place of the fundamental theorem of line integrals, this proves that $H^1_{\text{de Rham}}(\mathbb{R}^n) = 0$)
A: Riemannian metric $g$ generates an isomorphism between vector fields and 1-forms: vector field 
v corresponds to a 1-form g(v,.). For $R^n$ and flat metric a field $\sum v_i \frac{\partial}{\partial x_i}$ corresponds to $\sum v_i dx_i$.
To find a potential you should consider a  1-form corresponding to your field and integrate it. The result, up to sign, is a potential up to a constant.
