I've been reading about extracting energy from heat, particularly Sterling engines. There's always a temperature gradient. Heat flows from the hot side to the cold side through the working fluid. As the temperature differential approaches zero the engine stops.
My question is that why do we even need a temperature differential? Even more broadly why do we use energy to cool things? Let's take a gallon of water at 50 deg C. Water has a specific heat of 4.18JdegC/g. Ignoring the heat of fusion and following Q = CMdT, just by virtue of it being "warm" (323 deg C above absolute zero) wouldn't the water "contain" 3780 * 4.18 * 323 = 5104 kJ of energy (3780 grams per gallon of water). Why couldn't you extract any of this energy as work and as a result of extracting the energy the water cools itself (it gives up energy, for every 3780*4.18 J extracted it should lower by 1 deg C). I'm invisioning the heated water (or anything heated above abs zero) as an energy sink or battery. Theoretically you should be able to extract 5104 kJ of energy from this 50 deg C gallon of water.
In the Sterling engine we could lower the cold side with liquid nitrogen but it takes energy to make this. In an AC system we spend energy to lower the temperature in the room. Since "cold" is the absence of "heat" or energy, shouldn't cooling things actually create energy for us (the hot things that earlier had energy imparted into them give up their energy to make work). It seems wasteful to just waste the heat on warming up something at a lower temperature differential such as the cool side of the Sterling engine or the ambient air by the condenser.