The force for a spring with displacement , spring constant k is (Hook's Law).From Newton's law So .The solution of the above equation is . Since , So . If the spring is moved away equilibrium position, it will move with displacement similar to , which is called simple Harmonic motion (SHM).