Suppose I let a block fall from a height above a vertical spring. Any air drag is ignored. I want to find the maximum compression the spring will undergo. **Is it possible to use the work-energy theorem over the Course of the entire motion?**

The confusion is due to the fact that the spring force doesn't act throughout the entire motion, so isn’t part of the “net” force through a specific part of the time interval. Since the work energy theorem is derived by newton’s second law, is the theorem still applicable? I guess could consider the spring force as a discontinuous function that is 0 for all positive extensions but this feels wrong.

I know I can solve this easily using conservation of mechanical energy but I just want to know if the work energy theorem csn be applied to situations like these.