Answer:
The position equation will be:

Explanation:
The general position equation of mass attached to a spring is given by:

Where:
- A is the amplitude of the sinusoidal motion
- ω is the angular frequency (ω=2πf)
- ∅ is the phase (zero in our case)
We know that it takes 3 sec for the spring to complete one cycle. It means the period is T = 3 s.
Let's recall that T = 1/f where f is the frequency, so f = 1/3 Hz and hence ω=2π(1/3)=2π/3.
The amplitude is the distance from the origin to the crest. In our case, A = 4/2 in = 2 in, because the distance from the highest to the lowest is 4.
Therefore, the position equation will be:

I hope it helps you!