Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
You need to account for the KE when the mass is dropped and it moves downward. Unless the spring doesn't move, you can't use this energy equation. And if it doesn't move I don't think you could consider it a linear spring.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.