Derivation of formula of potential energy by a conservative force the formula for potential energy by a conservative force is given by:
$$ F = -\nabla U(r), $$
which in one dimension may be simplified to:
$$ F = -\frac{dU}{dx} .$$
My question is how is it derived and why do we use a negative sign in the formula?. Is this by definition or is there some other reason?
 A: If the particle moves from the point $x$ to $x+dx$, and assume $dx\gt 0$ for simplicity, then its potential energy increases by 
$$ dU = \frac{dU}{dx}dx $$
Well, it increases if $dU$ is positive and decreases if $dU$ is negative. So far I have only used the definition of the derivative – pure mathematics.
However, the total energy is conserved. The sum of the kinetic energy and the potential energy
$$ E = T + U = {\rm const} $$
is constant. It means that if the potential energy increases, the kinetic energy decreases, and vice versa. However, an increasing kinetic energy is exactly the situation when the force $F$ is positive (directed in the same direction as the speed or $dx$).
In other words, the equation
$$ dU = \frac{dU}{dx} dx $$
may be rewritten as 
$$ dT = -\frac{dU}{dx} dx $$
because $T$ is effectively $-U$, up to the constant whose differential is zero, but because the kinetic energy increases if the force and $dx$ have the same sign i.e.
$$ dT = F\cdot dx $$
(pushing a right-moving particle by a right-directed force accelerates the particle; the expression above is the infinitesimal work), we may compare the two equations and see that
$$ F = -\frac{dU}{dx} .$$
So the sign effectively arises from the "anticorrelation" of the kinetic and potential energy (along with the convention that all the terms are included in the total energy with the plus sign; the convention that the kinetic energy is positive, and so on).
