Work-Energy theorem is very useful in analyzing situations where a rigid body moves under several forces. As we know that a rigid body cannot store potential energy in its lattice due to rigid structure, it can only possess kinetic energy. Thus the work done by any force acting on a rigid body is equal to the change in its kinetic energy. This is the basis of work energy equation for rigid bodies.
To analyze motion of a rigid body in such situation, see the video:
In variety of cases when a spring is connected to body then in case when a spring is compressed or
elongated, it absorbs energy and stores in form of elastic potential energy which is due to the negative
work done by spring on the attached body.
So work done by spring will always be subtracted from body
energy if it absorbs energy and will be added to body energy if it releases energy.
To understand similar cases, pl see the example videos below –
For general situations which involves friction and other cases, more example videos are given below –