I am confused with a question in my thermodynamics class and would like to seek some clarification.
The problem I was given:
A reversible heat engine operates on a Carnot Cycle between a heat source (at initial temperature, $T_A$) and a heat sink (at initial temperature, $T_B$).
Unlike the infinite thermal reservoirs, the heat source and the heat sink in this case contain ideal gases with the same finite masses. After a certain period of time, the temperatures of both the thermal reservoirs will be equalized to $T_2$. For the surroundings, assume that there is no heat transfer and no temperature change. The pressures of both the thermal reservoirs remain constant.
Assuming that all processes are ideal, $$Prove:\quad T_2=\sqrt{T_AT_B}$$
My Approach:
Using Clausius equality of a reversible cycle, $$\frac{dQ}{T} = constant$$ $$\frac{Q_1}{T_1} = -\frac{Q_2}{T_2}$$ $$\frac{mC_p(T_2-T_A)}{T_2} = -\frac{mC_p(T_2-T_B)}{T_2}$$ $$\frac{T_2-T_A}{T_2} = \frac{-T_2+T_B}{T_2}$$ $$T_2 = \frac{T_A+T_B}{2}$$
The solution I was given uses the summation of entropy in an isolated system.
$$S_A = -S_B$$ $$ln\frac{T_2}{T_A} = -ln\frac{T_2}{T_B}$$ $$\frac{T_2}{T_A} = \frac{T_B}{T_2}$$ $$T_2=\sqrt{T_AT_B}$$
My question:
Isn't $S_A$ the same as $\frac{Q_1}{T_1}$ if the process is reversible? And if so, why does my value differ? Or is it because $S_A$ is from the perspective of reservoir A while $\frac{Q_1}{T_1}$ is from the perspective of the heat engine. Thus, applying Clausius inequality does not consider the respective reservoirs heat transfers.
P.S. I am quite lost in this subject, would appreciate a bit of help in highlighting my wrong assumptions/ understanding.