Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In classical computer simulations such as molecular dynamics (MD) simulations, one integrates Newton's equations of motion to determine particle trajectories. If we think of Newton's Second Law as simply $$\textbf{f}_i = \frac{d \textbf{p}_i}{dt}$$ where $\textbf{f}_i$ is the net force acting on a particle $i$ and $\textbf{p}_i$ is the momentum of the particle, then it is clear that to ultimately integrate this and propagate the trajectory, we will need to calculate the force on every particle in the system.

However, in practice, I think that the potential energy $u$, rather than the force, is initially calculated (a force field specifies the form of the potential energy $V$). Now, I know that there is a relationship between potential energy $u$ and force $f$: $$\textbf{f} = -\boldsymbol{\nabla} u$$

In other words, force is the negative gradient of the potiental energy.

I am reading Understanding Molecular Simulation by Frenkel and Smit (Second Edition), and on page 69 (Google Books has some pages here), I see this paragraph:

Suppose that we wish to compute the $x$-component of the force: $$f_x(r) = -\frac{\partial u(r)}{\partial x} = -\left(\frac{x}{r}\right)\left(\frac{\partial u(r)}{\partial r}\right)$$

I am a little afraid this is a silly question, but how do the authors go from $-\frac{\partial u(r)}{\partial x}$ to $-\left(\frac{x}{r}\right)\left(\frac{\partial u(r)}{\partial r}\right)$? Is this the chain rule? Could you please help me see the step that the authors are making?

share|cite|improve this question
up vote 5 down vote accepted

You are right that the result you see is due to the chain rule. The author uses either spherical or cylindrical coordinates, so

\begin{equation} r = \sqrt{x^2 + y^2 + z^2} \end{equation}


\begin{equation} r = \sqrt{x^2 + y^2} \end{equation}

which you can differentiate to obtain

\begin{equation} \frac{\partial{r}}{\partial{x}} = \frac{x}{r} \end{equation}


\begin{equation} f_x(r) = -\frac{\partial{u(r)}}{\partial{x}} = -\frac{\partial{u(r)}}{\partial{r}}\frac{\partial{r}}{\partial{x}} = -\frac{x}{r} \frac{\partial{u(r)}}{\partial{r}} \end{equation}

share|cite|improve this answer

The previous answer is fine, but you should not piddle around doing the chain rule. It comes from a differential relation you learn once, and forever make second nature:

$$r dr = x dx + y dy + z dz$$

This is the differential form of the pythagorean law:

$$ r^2 = x^2 + y^2 + z^2$$

and it tells you the size of the relative size of the x,y,z increments, when you make an increment of r. The x increment is ${x\over r} dr$, so that the change in the function is

$$ u(x + dx,y,z) = u(r+dr) = u(r) + u'(r) dr = u(r) + u'(r) {x\over r} dx $$

it is important to do it this way, so that it goes into your head and stays there.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.