Derive force from the pair-wise potential equation How can we calculate the force exerted on particle $i$ by particle $j$ given a general potential function $V(d)$? Let's discuss this genenal question with a concrete example below.
To simulate the motion of a set of $n$ particles with equal masses, we need to calculate the resultant force for each particle, which is the sum of force vectors. These particles move along a one-dimensional axis and interact via a pair-wise potential, where the
$$V(d) = \frac{\exp(-2d^3) - 1}{d},$$
where $d$ is the distance between particle $i$ and particle $j$.
I don't have strong math and physics background, and I've been learning partial derivative and potential energy on wikipedia, but it makes me more confused.
Simeon Carstens' answer below explains a lot!! It says 
$$F_i=−\frac{\partial}{\partial x_i}V(x_1,...,x_n).$$ 
So my understanding is that the force exerted on particle i by particle j can be expanded as $Fi=-\frac{∂}{∂xi}V(d(xi,xj))=-\frac{∂}{∂xi}\frac{exp(-2(xi-xj)^3) - 1}{xi-xj}$.
By $(\frac{u}{v})'=\frac{u'v-v'u}{v^2}$, the above epxression can be derived as $Fi=\frac{(6(xi-xj)^3+1)exp(-2(xi-xj)^3) - 1}{(xi-xj)^2}$.
Am I correct? Please tell me if I'm wrong and which part is incorrect! Any help is apprieciated!
 A: You can calculate the total potential energy as the sum of all the contributions stemming from the pairwise interactions. But you have to write the potential energy as a function of all your particle coordinates $x_1, ..., x_n$:
$$
V(x_1, ..., x_n) = \frac{1}{2}\sum_{i=1}^n \sum_{j=1 \atop j \neq i}^{n} V(d(x_i, x_j)) = \sum_{i=1}^n \sum_{j > i} V(d(x_i, x_j))
$$
Here, $d(x_i, x_j)$ is the distance between particles $i$ and $j$, which is a function of their coordinates $x_i$ and $x_j$.
Then the force acting on particle $i$ is just
$$
F_i = -\frac{\partial}{\partial x_i} V(x_1, ..., x_n)
$$
In general, the force is a vector: $\vec F_i = -\nabla_{\vec{x}_i} V(\vec x_1, ..., \vec x_n)$. But as your problem is 1D, the force and the coordinate vectors have only one component.
When actually simulating this system (because you put the simulation tag), you can exploit Newton's third law to save computation time: the force exerted on particle $i$ by particle $j$ is just minus the force exerted on particle $j$ by particle $i$.
If you want to keep the distances as your variables, you could use the Lagrange formalism and use your distances as generalized coordinates.
