From given information $ a=-\,kx, $
where a is acceleration, $ x $ is displacement and $ k $ is a proportionality constant.
$ \frac{v\,dv}{dx}=-\,k\,x $
$ \Rightarrow $ $ v\,dv=-\,k\,x\,dx $
Let for any displacement from 0 to $ x, $
the velocity changes from
$ {{v}_{0}} $ to v.
$ \Rightarrow $ $ \int_{{{v}_{0}}}^{v}{v\,dv=-\int_{0}^{x}{k\,x\,dx}} $
$ \Rightarrow $ $ \frac{{{v}^{2}}-v_{0}^{2}}{2}=-\frac{k\,{{x}^{2}}}{2} $
$ \Rightarrow $ $ m\left( \frac{{{v}^{2}}-v_{0}^{2}}{2} \right)=-\frac{mk\,{{x}^{2}}}{2} $
$ \Rightarrow $ $ \Delta K\propto {{x}^{2}} $ [ $ \Delta K $ is loss in KE]