I am stuck with a problem related to simulating a Lennard-Jones system. The Lennard Jones potential is $U(r) = 4\epsilon [ \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} ]$. Hence the force will be $F(r)=-\frac{\partial{U(r)}}{\partial{r}}= 48 \epsilon [ \frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7}]$. But to do computer simulation I need to know the force componentwise i.e. all the three components $F_x$, $F_y$, $F_z$ are to be known.
Is the $x$ component simply $F_x = 48 \epsilon [ \frac{\sigma^{12}}{\Delta x^{13}} - \frac{\sigma^6}{\Delta x^7}]$, where $\Delta x$ is the distance between the pair of particles concerned? (or simply $\Delta x =x_i - x_j$)
And let's say that we are calculating the force on the ith particle due to the $j$th particle. How can I express the direction of this force in terms of $x_i$ and $x_j$ ?