Step-by-step explanation:
Hooke's law :
According to the Hooke's law, The force is the directly proportional to the displacement of the string.
On the other hand,
In a simple harmonic motion, The restoring force is directly proportional to the displacement and acts in the opposite direction to that of displacement.
The restoring force is defined as,


Where,
F = restoring force
k = restoring constant
x = displacement
The negative sign shows the force opposes the string's displacement