Final temperature after maximum work output? Two simple identical blocks with heat capacity $C$ are at temperatures $T_2$ and $T_1$ respectively, with $T_2>T_1$. What is the final temperature of the two blocks if the maximum possible work is extracted from the equilibration process?
My attempt so far is the following:
The maximum possible work would obviously be a bunch of infinitesimal Carnot cycles, each extracting an infinitesimal amount of work $dW$ the heat going from one block to another. All we need to do is write down the expression for $dW$, integrate it, and we're done.
I will let the temperature of the hotter block be $T$ and that of the colder block be $T'$. We have that
$$\begin{align*}
dW&=\left(1-\frac{T'}{T}\right)dE\\
&=\left(1-\frac{T'}{T}\right)C~dT
\end{align*}$$ 
There is my problem! The temperature of the colder block $T'$ is a function of the temperature of the hotter block $T$, so I can't do any integrals! Moreover, I wouldn't know the bounds of integration even if I did find the function $T'(T)$. How can I solve this?
Note: My question is very similar to this other question. The difference is that (1) the author of that question was asking how to just get started, and (2) none of the answers to that question address my concern.
 A: Let $dQ_1$ = heat transferred to hot reservoir = $CdT_1$
Let $dQ_2$ = heat transferred to cold reservoir = $CdT_2$
For the sum of the entropy changes of the system and the surroundings to be zero, we must have$$\frac{dQ_1}{T_1}+\frac{dQ_2}{T_2}=0$$This means that:
$$C\frac{dT_1}{T_1}+C\frac{dT_2}{T_2}=0$$This means that $$d\ln T_1+d\ln T_2=d\ln(T_1T_2)=0$$This means that $$T_1T_2=T_{10}T_{20}$$where the subscript 0 refers to the initial temperatures.  In the final state, we must have that $$T_1=T_2=T_f$$where $T_f$ is the final temperature of both reservoirs.  So, $$T_f=\sqrt{T_{10}T_{20}}$$
The amount of work done is equal to the heat transferred from the hot reservoir minus the heat transferred to the cold reservoir:$$W=C(T_{10}-T_f)-C(T_f-T_{20})=C(T_{10}+T_{20}-2T_f)$$If we substitute our equation for $T_f$ into this equation, we obtain:$$W=2C\left(\frac{(T_{10}+T_{20})}{2}-\sqrt{T_{10}T_{20}}\right)$$The term in parenthesis is the difference between the arithmetic mean of the two initial temperature and their geometric mean.
