Does entropy increase with heat flow? In an exam, I had a scenario where 2 bodies with different temperatures were put together and over time their temperatures mixed and eventually became uniform. My intuition tells me that as a result, the entropy of this system increased, however the exam asked me to explain why entropy remained the same. Could someone tell me whether the exam is correct, and if so, why?
Edit: The problem was posted on our website (with no official answer unfortunately), so here it is in full:
Consider an isolated system composed of two bodies at slightly
different temperatures T1 and T2 (T1 = T2 + dT) thas have been put in
contact.
a) What does the second law of thermodynamics say about the
direction of heat flow between them? (1pt)
b) Explain how the entropy of both bodies change. Show that the total
entropy of that system is constant. (6pts)
(there's a picture showing the 2 bodies and a barrier around them labeled "perfect insulation")
 A: As I describe here, for two bodies with a finite temperature difference, the total entropy is constant only if the connection is made through a Carnot heat engine.
However, the exam explicitly states that the temperature difference is infinitesimal. This isn't uncommon in thermodynamics thought experiments; for example, if we consider the cooling of a hot object surrounded by a large thermal reservoir (e.g., a cup of hot coffee in your kitchen), then it's routine to assume that the environment is isothermal even though we know that the thermal energy lost by the coffee must heat up the reservoir to some degree. It's just that the amount can be assumed negligible. In this way, we can obtain that that environment gains $Q/T$ entropy, for example, where $Q$ is the thermal energy lost by the relatively small object and $T$ is the approximately constant temperature of the large reservoir.
If this is the strategy that your exam is aiming for, then I expect the desired answer is that the slightly hotter body spontaneously heats the slightly cooler body because that arrangement increases the total entropy; however, because the temperature difference is infinitesimal, that entropy increase is negligible.
