Hooke's Law sign confusion Consider a spring with potential energy $U=\frac{1}{2} k x^2$, where $x$ is displacement from equilibrium.
Hooke's law says the force required to move the spring is $F=kx$.
From classical mechanics, we usually calculate force as $F=-{\nabla}U$ which yields $F=-kx$ here.
Why is the sign different? Does $F=-\nabla U$ denote the force on the spring instead of the force generated by the spring?
 A: Hooke's law is actually $F=-kx$ which specifies that the force that the spring produces is always pointing away (opposite) from the direction of the displacement of the spring from the equilibrium position (taken as $x=0$ for simplicity). There is no contradiction.
$F=-\nabla U$ is the force generated by the spring as it should be since $U$ is the potential energy of the spring. $kx$ being the force "required to move the spring" is talking about some external force involved separate from the spring itself. 
A: The system is the spring.  
Ignoring the two forces acting at the fixed end of the spring consider the two forces acting on the free end of the spring $\vec F_{\text{on spring due to external}}$, the external force, and $\vec F_{\text{on external due to spring}}$, the force due to the spring.  
At equilibrium   
$\vec F_{\text{on spring due to external}}+ \vec F_{\text{on external due to spring}}=0 \Rightarrow \vec F_{\text{on spring due to external}}=- \vec F_{\text{on external due to spring}}$
If the end of the spring undergoes a displacement $\vec x = x\, \hat x$ from its unstretched position then there are two possible equations which relate force and displacement:  


*

*$\vec F_{\text{on spring due to external}} = k \vec x \Rightarrow
   F_{\text{on spring due to external}}\, \hat x = k \,x \,\hat
   x\Rightarrow F_{\text{on spring due to external}} = k \,x$  

*$\vec F_{\text{on external due to spring}} = - k \vec x \Rightarrow  
   F_{\text{on external due to spring}}\, \hat x = -k \,x \,\hat   
   x\Rightarrow F_{\text{on external due to spring}} = - k \,x$
with the second equation being the one which is often written as  $F= -kx$ where $F$ is the force exerted by the spring and the negative sign there showing that as the spring is extended (x increasing) the force due to the spring is in the opposite direction.  
The change in the potential energy stored in the spring $\Delta U$can be defined in one of two ways:  


*

*The work done by an external force $\vec F_{\text{on spring due to external}}$ in displacing the end of the spring $\Delta \vec x$
$\Delta U = \vec F_{\text{on spring due to external}} \cdot \Delta \vec x = F_{\text{on spring due to external}}\,\hat x \cdot \Delta x \,\hat x = F_{\text{on spring due to external}}\,\Delta x$
$\Rightarrow F_{\text{on spring due to external}} = \dfrac{\Delta U}{\Delta x}$


*

*Minus the work done by the force due to the spring $\vec F_{\text{on external due to spring}}$ in displacing the end of the spring $\Delta \vec x$
$\Delta U = \vec F_{\text{on external due to spring}} \cdot \Delta \vec x = -F_{\text{on external due to spring}}\,\hat x \cdot \Delta x \,\hat x = -F_{\text{on external due to spring}}\,\Delta x$
$\Rightarrow F_{\text{on external due to spring}} = -\dfrac{\Delta U}{\Delta x}$ 
and it is this second form which is often written as $F = - \dfrac{\Delta U}{\Delta x}$ with $F$ being the force due to the spring.
