# How to derive spring potential formula from Hooke's law?

I found this answer in another forum: \begin{align} W&=\int \mathbf F\cdot {\rm d}\mathbf x \\ &=-\int_0^xkx\,{\rm d}x \\ &=\frac{1}{2}kx^2 \end{align}

I don't understand why we have to set the limits $[0,\,x]$. When deriving kinetic energy, for example, it is enough to merely substitute $F$ but here you need to substitute $F$ and set limits, why?

• -1. Unclear. What other limits would you expect to use instead of [0,x]? Integrals require limits. Oct 4, 2017 at 16:46
• Do you know how the calculation of work (shown in your question) is related to spring potential energy? Do you know the definition of potential energy? Oct 4, 2017 at 17:27
• Possibly useful: physics.stackexchange.com/q/327303/25301 Oct 5, 2017 at 10:13

Basically you calculate the work needed to extend the spring from 0 to $x$. This work corresponds to the (potential) energy stored in the spring due to the extension.
You could as well calculate the work needed to extend from some arbitrary fixed $x_0$ to $x$ and you would get the same result shifted by a constant term $\frac{1}{2}kx_0^2$. Potential energy is only defined up to a constant. When you do calculations all that enters will be derivatives of the potential so constants will disappear.
For convenience you can take $x_0=0$ and you are left with the relevant part, i.e. the $x$-dependence of the potential.
$$\int m\mathbf{a}\cdot\mathbf{dr}=m\int\frac{\mathbf{dv}}{\textrm{dt}}\cdot\mathbf{dr}\\ =m\int_{v_0}^{v} \mathbf{v}\cdot\mathbf{dv}\\ =\frac{1}{2}mv^2-\frac{1}{2}mv_0^2$$