To get the average resting position of the spring, we must subtract the minimum from the maximum height of the spring with respect to the floor.
So,
7 + (4/12) - [ 6 + (2/12) ] = 1.5 ft
Half of this is where the resting position of the spring is located with respect to the minimum height. If the resting position of the spring is set at 0, then the amplitude of the wave is:
A = 1.5 / 2 = 0.75
Since it takes 2 seconds for the spring to expand from minimum to maximum,
Period = 2 = 2π / n
n = π
The cosine function is:
y = A cos nt
where y is the distance from the resting position and t is the time in seconds.
y = 0.75 cos πt