Review page for physics
Simple harmonic motion

Hooke's law relates the extension of a spring to the force acting upon it. 

F = -kx
 
The force constant k is a measure of the elasticity of the spring
x is the displacement of the oscillating ball from its rest (equilibrium) position.

One animation depicts oscillation of a ball of mass m attached to a perfectly elastic spring fixed at one end.  The second shows the sinusoidal variation of displacement with time.
Both animations are from wikipedia.com (Hooke's Law, Simple harmonic motion)

Equations 1 and 1a describe how the displacement of the ball varies with time, if at time zero, the ball is at the maximum displacement.
Equation 1:  x = X cos ωt
Equation 1a:  x = X cos 2πf t
X = amplitude of the wave
ω = angular frequency which, as shown, is equal to 2πf
displacement with time

The graphs show the variation of displacement with time as well as the variation of both the velocity of the ball and its acceleration with time.

The mathematical relationships between velocity and acceleration with time can be derived from equation (1) by differentiation . 
It will also be shown in the next exercises that the shapes of these graphs are consistent with qualitative ideas about how the velocity and acceleration of the oscillating ball vary with time. 
 
The first derivative of distance (displacement) with respect to time (dx/dt) is equal to the velocity. 
Recall that d(cos ax)/dx = –asin ax.
Therefore differentiating equation 1 and equation 1a give the two relationships below: 
Equation 2:  v = –ωX sin ωt
Equation 2a:  v = –(2πf) X sin (2πf) t
 
Acceleration (dv/dt) is the first derivative of velocity with respect to time.
Recall that d(sin ax)/dx = acos ax.
Therefore differentiating equations 2 and 2a give the relationships below:
a = –ω2X cos ω t
a = –(2πf)2 X cos 2πf t