(N/A) Consider a block of mass $m$ attached to a spring,which is fixed to a rigid wall. The block is placed on a frictionless horizontal surface.
If the block is pulled to one side and released,it executes a to-and-fro motion about a mean position.
Let $x=0$ indicate the position of the center of the block when the spring is in equilibrium. The positions $-A$ and $+A$ indicate the maximum displacements to the left and the right of the mean position.
According to Hooke's law,when a spring is deformed,it is subject to a restoring force,the magnitude of which is proportional to the deformation or displacement and acts in the opposite direction.
At any time $t$,if the displacement of the block from its mean position is $x$,the restoring force $F$ acting on the block is:
$F(x) = -kx$ $(1)$
where $k$ is the spring constant.
According to Newton's second law,$F = ma = m \frac{d^2x}{dt^2}$.
Equating the two,$m \frac{d^2x}{dt^2} = -kx$,which gives $\frac{d^2x}{dt^2} + \frac{k}{m}x = 0$.
This is the differential equation for simple harmonic motion $(SHM)$ with $\omega^2 = \frac{k}{m}$.
The period of oscillation $T$ is given by $T = \frac{2\pi}{\omega} = 2\pi \sqrt{\frac{m}{k}}$.