force analysis
According to Hooke's law
Restoring force f =-ky = ma = m [d 2y/dt 2]
That is, my "+ky=0, y"+(k/m) y = 0.
The characteristic equation corresponding to the homogeneous differential equation is
r^2+k/m=0
The characteristic root is r 1, 2 = √ (k/m) i,
General solution y = c1cos [√ (k/m)] t+c2sin [√ (k/m)] t.
Initial conditions: when t=0, the displacement y(0)=a and the velocity y'(0)=0.
Constants C 1=a and C2=0 can be solved.
Then the equation y=acos[√(k/m)]t of the motion law of the object can be obtained.
Do simple harmonic vibration.