Suppose we wish to heat 1 litre of 0°C water up to 50°C during wintertime by using an ideal heat pump (Carnot cycle in "reverse"). We will place this water amount in an initally empty container, in which the heating will take place, and via the heat pump extract heat from a nearby large lake where the water is near 0°C. How much work will this require?
Note that the initially empty container and the large lake represents the hot reservoir and cold reservoir respectively in the Carnot cycle.
For a Carnot cycle we have $W = Q_h - Q_c$ and $\displaystyle \frac {Q_h}{T_h} = \frac {Q_c}{T_c} $ where the subscripts $h$ and $c$ denote the hot reservoir and cold reservoir respectively. Moreover $W, Q_h, Q_c, T_h, T_c$ are all non-negative quantities (our chosen sign convention).
I know the work can be expressed as $W = \frac{Q_h}{T_h} (T_h - T_c)= \frac{Q_c}{T_c} (T_h - T_c) $ but I have no clue which to use since I really have no idea what the heat amounts $Q_h$ and $Q_c$ are or ought to be.
Also I've never previously encountered a problem of this kind where one of the reservoirs is not at a constant temperature and I'm completely confounded. I suspect it will require calculus but I am dumbfounded as to how to set it up.
Since we want to heat up the water from 0°C and 50, shouldn't $Q_h$ equal $mc \Delta T$ which amounts to $210 \, 000 \text{ J}$ with $m = 1 \text{ kg}$, $c = 4200 \text{ J/(kg}\cdot\text{K)}$ and $\Delta T=50 \text{ K}$? The question is what to plug in for $T_h$ since it varies over time.
The answer is supposed to be $W = 17.1 \text{ kJ}$. Any help appreciated!