Forces, fields and potentials
Suppose a body has a force F acting on it. F might have its origin in a gravitational field, an electric field, a stretched wire, or whatever. Left to itself, F will propel the body in the direction of the force. Let the distance the body is propelled be dx. Work done is defined as Force ´ distance moved in the direction of the force so, in this case the work done is given by
dW = Fdx
Notice that dW is positive because F and dx are both in the positive direction. A variety of outcomes is possible: the body might have acquired kinetic energy and now be moving, the body might have actuated a mechanism that has generated electricity to light a lamp, the said mechanism might have lifted a bucket of water, etc, etc. Either the body itself has acquired kinetic energy or some other body has acquired energy in some form. The issue we need to address is that of where this energy has come from.
A conventional answer is to say that, before it was propelled forwards, the body formerly possessed the energy in a form known as 'potential' energy, and to calculate this quantity from
dEpot = - Fdx
It is worth taking the trouble to unpick this equation. If you move the body backwards, by applying an equal force in the opposite direction, you move it to a place where it possesses more potential energy. If you now release the body then, by the time it regains its original position, the energy will have been delivered back to you. But in order to move the body backwards you had to impose a movement in the opposite direction to the direction of the original, pre-existing force. So F and dx in the potential energy equation will be of opposite sign (remember that d means 'the positive change of . . .' and that F is the force that exists before we start moving the object backwards). As we require the potential energy to increase as we move the body against the force, it follows that dEpot has to be positive, and that we must introduce the minus sign to the right hand side of the equation. We are entitled to do this because the equation is the definition of potential energy, and we are defining the concept so that it can be useful to us - we make the rules!
Gravitational potential energy
Let's check that all this makes sense. If the force has its origin the gravitational field near the earth's surface, then its value is given by
F = mg
which is, of course, just the weight of the object, acting downwards. The absence of a minus sign in this equation implies that we are taking downwards as positive. Now suppose that we lift the object upwards through a height h. We must write
dx = - h
on the grounds that dx means a positive change in position, and that our position change is in the negative direction. Substituting into the potential energy equation, we have
dEpot = - Fdx = - mg ´ (- h) = mgh
This is entirely in accordance with elementary ideas about gravitational potential energy.
Notice that the term 'potential energy' takes the same adjective as the force that gives rise to it. Thus gravitational fields engender gravitational forces, which give rise to gravitational potential energies and, further down the line, gravitational potentials. Strain forces (e.g. in springs) give rise to strain potential energies, etc.
One could argue that the body's increase of potential energy is the work that we do on it while moving it back. In this case the force we apply and the distance it moves are both negative, so that the potential energy change comes out positive, as required, in one move. The defining potential energy equation given above has the minus sign in it because we choose, instead, to declare the original force, which we have had to oppose. This way of doing things will turn out to make more sense when we discuss potential in a moment.