Hint: The oscillation of the block starts from the extreme position.
Step 1: Find the amplitude and angular frequency of the block.
Consider the diagram of the spring block system. It is an SHM with an amplitude of 5 cm about the mean position shown.
Given, spring constant, k=50 N/m
m = mass attached =2 kg
Angular frequency, rad/s
Step 2: Find the equation of motion of oscillations.
Assuming the displacement function,
y(t)=Asin
where, =initial phase
But given at t=0, y(t) =+A
y(0)=+A=Asin()
or sin
The desired equation is y(t)=Asin
Putting A=5 cm, =5 rad/s
we get, y(t)=5sin5t
where, t is in second and y is in centimetre.