By combining Newton's second law $F\=ma$ with Hooke's law and noting that the acceleration $a$ is just $\frac{{\ⅆ}^{2}x}{\ⅆ{t}^{2}}$, we obtain
$m\frac{{\ⅆ}^{2}x}{\ⅆ{t}^{2}}equals;-kx$.
The solution of this differential equation for $x\left(t\right)$ can be expressed as
$x\left(t\right)equals;A\cdot \mathrm{sin}\left(\sqrt{\frac{k}{m}}\cdot tplus;\mathrm{varphi;}\right)$,
where $A$is is the amplitude of the oscillation, i.e. its maximum displacement, and $\mathrm{\ϕ}$ is the initial phase. In the animations below, we have set $A\=1$and $\mathrm{\ϕ}\=0\,$thus
$x\left(t\right)equals;\mathrm{sin}\left(\sqrt{\frac{k}{m}}\cdot t\right)period;$
${}$