Potential Energy from Force built $U$ by integrating the force. Run it backward with Leibniz Notation and Units and the force comes from $U$ by differentiating. This is how physicists usually work: write down an energy, and the forces follow.
Key idea
$$F(x) = -\dfrac{dU}{dx}.$$ The force points downhill on the $U(x)$ graph, toward lower potential energy, and it is strongest where the graph is steepest. In three dimensions, $\vec{F} = -\nabla U = -\left\langle \dfrac{\partial U}{\partial x}, \dfrac{\partial U}{\partial y}, \dfrac{\partial U}{\partial z} \right\rangle$.
Why it works
Over a tiny step $dx$, the force does work $F\,dx$, and the potential energy changes by $dU = -F\,dx$. Divide by $dx$: $F = -dU/dx$. Picture a ball on a hilly track shaped like the $U$ graph: it is pushed toward the valleys, harder where the slope is steep, and not at all at a flat spot.
Worked example: Force at a point
A particle has $U(x) = x^3 - 3x^2 + 2$ (J, m). Find the force on it at $x = 1\ \text{m}$ and at $x = 3\ \text{m}$.
- $\dfrac{dU}{dx} = 3x^2 - 6x$.
- At $x = 1$: $dU/dx = -3$, so $F = +3\ \text{N}$ (toward $+x$, where $U$ is lower).
- At $x = 3$: $dU/dx = 9$, so $F = -9\ \text{N}$ (toward $-x$).
Answer: $+3\ \text{N}$ and $-9\ \text{N}$.
Worked example: A model chemical bond
A simple model of a bond has $U(x) = \dfrac{4}{x^2} - \dfrac{4}{x}$ (energy and distance in convenient units). Where is the force zero, and which way does it push when the atoms are closer than that?
- $F = -\dfrac{dU}{dx} = \dfrac{8}{x^3} - \dfrac{4}{x^2}$.
- $F = 0$ when $\dfrac{8}{x^3} = \dfrac{4}{x^2}$, at $x = 2$: the bond length.
- For $x < 2$, $8/x^3 > 4/x^2$, so $F > 0$: the atoms are pushed apart. For $x > 2$ they are pulled together.
Answer: Zero at $x = 2$; closer than that, the force pushes the atoms apart.
Common mistake
Thinking the force points toward higher potential energy, the way a dropped ball "heads for" the ground. The ball does head downhill on the $U$ graph: lower height, lower $U$. Check with gravity: $U = mgy$ gives $F_y = -mg$, pointing down, toward lower $U$. If your force points uphill on the $U$ graph, you dropped the minus sign.
Where $dU/dx = 0$ the force vanishes: those are the equilibrium points. Whether an object placed there stays put depends on the shape of $U$ around it, the subject of Potential Energy Diagrams.