Think about conservation of energy with regards to a mass-spring system: ##\frac 1 2 m {\frac {dx} {dt}}^2+mg(h-x)+\frac 1 2 kx^2=constant## where h is the max height. Imagine we drop it from when the displacement in the spring is zero. Putting this in terms of time we can get
##\frac 1 2 m(A \omega sin(\omega t))^2+mg(h-Acos(\omega t))+\frac 1 2 k(Acos(\omega t))^2=constant##
Taking the rate of change with respect to time we get
##mA^2 \omega^3 sin(\omega t)cos(\omega t)+mgA \omega sin(\omega t)-kA^2 cos(\omega t)sin(\omega t)=0##
Putting the rate of change of the potential energies on one side and the kinetic energy on the other, we get
##mA^2 \omega^3 sin(\omega t)cos(\omega t)=kA^2 cos(\omega t)sin(\omega t)-mgA \omega sin(\omega t)##
which simplifies to
##mA\omega^3 cos(\omega t) = kAcos(\omega t)-mg\omega##.
As you can see, the rate of change is driven by ##cos(\omega t)## for both.
This was quick and dirty, so if I made any errors somewhere, someone feel free to correct me.