I keep working through this problem and getting the wrong answer:
A spring with spring constant k is positioned vertically and then compressed from its equilibrium length by a distance Δy. A ball of mass m is placed on top of the spring, and is launched into the air when the spring is released. The ball travels to a maximum height hmax. Using the Work-Kinetic Energy theorem, determine hmax in terms of the given variables and any other constants you deem necessary.
The thought process was ∆K = $K_f - K_i$ = W --> $\frac{mv^2}{2}-\frac{mv_0^2}{2}$ = W
$W$ = $W_s - W_g$ where $W_s$ is a spring and $w_g$ is gravity
The final velocity is also zero so $K_f$ = 0. Which gives us
$\frac{mv_0^2}{2} = -k∆y^2 - mgh_m$ (solve for $h_m$)
$h_m = \frac{-k∆y^2}{2mg}+\frac{v_0^2}{2g}$
I might be completely off but I can't figure out what else to do. I would be very grateful is someone walked me through it