# Maximal work from cooling a portion of water

Let's consider a portion of water of mass $m$. We want to find out how much work (electric energy) we can acquire by cooling it from temperature $T_1$ to temperature $T_0$.

The most efficient way is to use the Carnot engine. We'll get the work $$W = \left(1 - \frac {T_0}T\right) Q_w ~~~~~(1)$$ if we take the heat $Q_w$ from the water. On the other hand, the water will cool down by $\Delta T$ then, $$\Delta T = \frac {Q_w}{mc} ~~~~~(2)$$ where $c$ is the water's specific heat. So $$W = \left(1 - \frac {T_0}T\right) mc\Delta T ~~~~~(3)$$

Then I'd say that the work acquired from cooling down the water will be $$W = \left(1 - \frac {T_0}{T_1}\right) mc\left(T_1 - T_0\right) ~~~~~(4)$$ But in the solution of a problem it is claimed that $$W = \int_{T_0}^{T_1} \left(1 - \frac {T_0}T\right) mc dT~~~~~(5)$$

Why is it so and not as proposed by me in formula (4)? Why am I wrong?

You must take into account the fact that the efficiency of your Carnot engine is continuously changing while you are cooling the water, because $T$ changes. For this reason your equation (3) is correct if applied to a very small (infinitesimal) cycle, and should read
$$dW = \left( 1-\frac{T_0}{T} \right) mc dT$$
In this case you are taking energy from a body, of finite heat capacity(its not a heat reservior) ,doing some work and dumping the remaining heat energy into a heat sink, say the atmosphere, at temperature ${T_0}$ (which can be assumed as an ideal heat sink with infinite heat capacity). Since temperature of water is changing , carnot engine changes its efficiency, every time the water temperature changes to a different $T$, that is for every infintesmally small amount of heat taken from water.So what you do is you integrate to get the total work output.