Solution (source code)

= Solution

The <adiabatic invariance of the action> applies when the frequency changes by only a small fraction during one oscillation and no <separatrix> is encountered. A convenient condition is
$$
\left|\frac{\dot\omega}{\omega^2}\right|\ll1,
\qquad \omega(t)=\sqrt{\frac{k(t)}m}.
$$
Then
$$
\boxed{I=\frac E\omega\simeq\text{constant}.}
$$
Consequently
$$
E=I\omega\propto\sqrt{k}.
$$
If $A$ is the displacement amplitude, $E=\tfrac12kA^2$, and hence
$$
A=\sqrt{\frac{2I}{m\omega}}
\propto\omega^{-1/2}
\propto k^{-1/4}.
$$
\b[Thus a slowly stiffened spring raises the energy as $k^{1/2}$ while reducing the amplitude as $k^{-1/4}$.]