A heat engine operates between a body with finite heat capacity 𝑐 at initial temperature $𝑇_1$ and a reservoir at fixed temperature $T_2$. Show that the maximum amount of work that can be done is given by $𝑊$ where: $W=c\left|T_2-T_1\right|-cT_2\ln\left(T_2/T_1\right)$.
The way this was shown used results of a Carnot engine. From what I understand the Carnot cycle is reversible, because it operates between 2 reservoirs. Here, the body with finite heat capacity will eventually end up at a temperature of the reservoir, $T_2$.
Once this happens, how can you go back the other way? Even if you input work into the engine, you can not force heat to flow between two bodies already at the same temperature, can you? Why can we assume the results derived from considering a Carnot cycle and apply them to this question?