For more complicated systems with more particles and more forms of energy, we can extend the definition from Work Done on a System By External Forces:

Where represents the changes in kinetic and potential energy associated with any other changes in the system.

For example, a bouncing tennis ball has deformations and bending in the system as the ball hits the floor, increasing its internal energy while decreasing some kinetic energy, so the ball won’t bounce back as high.