Relay said:
Isn't energy the ability to do work? Batteries, springs, flywheels, etc. have energy because they can do work. When they can no longer do work, they have no more energy left.
Actually, it isn't. Energy is conserved, but the ability to do work is not. For instance, suppose you have a book that you have lifted. Because it is some height above the ground, it has potential energy. This can be converted to work, for instance by lifting another weight with a pulley. Suppose, however, you just drop the book. As it falls, this potential energy is converted to kinetic energy. You can still convert this to work, for instance by having it land on one end of a catapult-like device.
But suppose, instead it just lands on the floor. This energy is now mostly converted to heat. Some is converted to sound, but this too is eventually dissipated to heat due to viscous effects in the air. The sound can also be minimized by having the ground be clay, or some other soft, non-rubbery material. The temperature of the ground is raised slightly. Can this be used to do work?
Somewhat. If you have something colder than the ground to accept the heat, then you can build a heat engine. But you will never get back all of that energy. Some of it will necessarily be wasted. The laws of thermodynamics imply that the maximum efficiency with which heat can be converted to work is:
\frac{T_h - T_c}{T_h}
where T_h is the temperature of the hotter body and T_c the temperature of the colder one, both measured on an absolute scale (0 needs to mean absolute 0). This is called the Carnot efficiency. The 2nd law of thermodynamics implies that every heat engine must have two reservoirs at different temperatures. From this you see that the only way to get 100% efficiency is with a cold reservoir at absolute 0 or a hot reservoir at infinite temperature. But infinite temperature is not possible, absolute 0 is probably impossible, and as soon as you started a machine with a reservoir at absolute 0, it wouldn't be at absolute 0 anymore because it just absorbed heat.
So heat and work are different forms of energy. You can go from work to heat at 100% efficiency, but not the other way around.