Formula for the heat input in a heat engine There's one situation relating to heat engines where there's one equation I never understood completely. The situation is something like: there's a heat engine operating between two systems $A$ and $B$ with temperatures $T_A<T_B$.
As we know there's one heat input from system $B$ into the working substance and one work output. What I'm in doubt is one equation for the heat input.
Suppose, for simplicity, that $B$ has constant heat capacity $C$, in that case one has
$$Q = C(T_B-T_A).$$
This equation always puzzled me. The main issue is that this is the heat transfer in a process where system $B$ is taken from initial state $\xi_1$ with temperature $T_B$ to the final state $\xi_2$ with temperature $T_A.$
Now as I always understood in a heat engine the working substance changes its state, while the reservoirs do not.
Furthermore, if the hot reservoir cools in one cycle, in the next one the efficiency would be something different, and everything would have changed.
My question is: why in this case $Q$ is given by this formula? How can we derive it considering that we are dealing with reservoirs in a heat engine? And how can we understand these changes in temperature of the reservoirs in a heat engine? This really doesn't make much sense to me.
EDIT: The whole point here is that the result follows trivially if we know the following facts:


*

*The system $B$ is in thermal contact just with the working substance;

*In a cycle the system $B$ goes from a state with temperature $T_B$ to a state with temperature $T_A$.


If these two things are true, we know that the heat for system $B$ will be $Q_B = C(T_A-T_B)$  and consequently by conservation of energy if system $B$ has only thermal contact with the working substance, the heat input is $Q = C(T_B-T_A)$.
The first fact is obvious. The problem is the second fact: I can't see why system $B$ goes from a state with temperature $T_B$ to a state with temperature $T_A$. Furthermore, it seems to me that this would affect the heat engine after the first cycle, since temperature changed.
So, why system $B$ goes from a state with temperature $T_B$ to another with temperature $T_A$ in one cycle?
 A: $C$ in your equation is heat capacity, not specific heat.  The heat capacity of a temperature reservoir is infinite, so a finite amount of heat can transfer while the temperature remains constant.
A: Given that body $B$ is taken from $T_B$ to $T_A$, only $A$ may be considered as heat reservoir. This can happen in reality if $C_A\gg C_B$. The expression $Q_B=C_B(T_B-T_A)$ just follows from the definition of $C_B$.
A: (Disclaimer: I have not formally studied thermodynamics in a while; my terminology may be somewhat off and I am mostly assuming the incidental details in the question are correct. Corrections appreciated.)
Here are two different models of a heat engine in operation.

Model 1: There is a hot reservoir and a cold reservoir. The hot reservoir is some unspecified otherwise-inert substance with heat capacity $C$. The hot reservoir, cold reservoir, and heat engine between them are a closed system. (As you put it: "The system $B$ is in thermal contact just with the working substance".)
Given this, and additionally supposing that the reservoirs are made of some realistic substance, then their $C$ is finite, the hot reservoir will have cooled off (and the cold reservoir heated up), and therefore the efficiency of the engine will decrease, as you have already noted.
(If you let this process continue over several cycles, then you have a model of a real heat engine being shut down!)
The advantage of this model is that it is mathematically simple.

However, we usually want to think of a practical heat engine as being in continuous operation over many cycles. A heat engine is almost always combined with some source of heat. Therefore:
Model 2: The hot reservoir is also in contact with something which provides heat (e.g. external combustion) or generates more heat from a non-thermal source (e.g. internal combustion), at a sufficient rate to maintain the temperature of the hot reservoir. (Similarly, the cold reservoir must be cooled.)
This model is more realistic but much more complex and may involve things that aren't thermodynamics.

Given that we want to study a model of the heat engine without also modeling those other processes which are maintaining the temperatures of the reservoirs, the simplest way to do this is to use Model 1 — keep all the equations for the closed system — but pretend that the heat capacity of both reservoirs is infinite in order to get answers which more-or-less match Model 2.
A: I think, the heat from body B(with finite heat capacity) is transferred to A through the engine.The engine takes heat from B as input, does some work and transfers the remaining to A.By this heat transfer, the temperature of the body B is reduced and when it becomes Ta, the engine will stop.So the heat added to the engine is nothing but the heat lost by the body B.Thus the formula with the heat capacity holds.
