# Quick Potential Query

In my electrostatics notes, when calculating the work done in moving a point charge from r1 to r2 we use

$W=\int_{\mathbf{r_1}}^{\mathbf{r_2}} \mathbf{F} \cdot \mathbf{dr}$
which ends up giving W=qV where V is the potential difference.

However in previous years we used $\mathbf{F}=-\nabla W \Rightarrow W=-\int_{\mathbf{r_1}}^{\mathbf{r_2}} \mathbf{F} \cdot \mathbf{dr}$

(this works if you consider W as potential energy (mgz) and then you get a force due to gravity of -mg in the z direction.

so which is correct and why?

$$- \int_{{r_1}}^{{r_2}} \mathbf{F} \cdot \mathbf{dr}$$