Solution (source code)

= Solution

A <Carnot cycle> consists of four reversible stages: isothermal expansion at the hot-reservoir <temperature> $T_h$, adiabatic expansion to $T_c$, isothermal compression at $T_c$, and adiabatic compression back to the starting state. The adiabatic stages exchange no <heat>. For one mole of an <ideal gas>, the two isothermal stages have heats $Q_h=RT_h\ln(V_B/V_A)$ and $Q_c=RT_c\ln(V_C/V_D)$ in magnitude. The reversible adiabatic relations ensure $V_B/V_A=V_C/V_D$.

More generally, the total <entropy> change over any reversible cycle is zero. The two <heat> exchanges therefore satisfy
$$
\frac{Q_h}{T_h}-\frac{Q_c}{T_c}=0.
$$
With <work> output $W=Q_h-Q_c$, its <thermal efficiency> is
$$
\boxed{\eta_C=\frac W{Q_h}=1-\frac{T_c}{T_h}.}
$$
The <temperatures> must be absolute. The second law makes this the maximum efficiency for an engine exchanging <heat> only with those two reservoirs; irreversible <entropy> production lowers the efficiency.