This is the kind of stuff my thermo students were studying

That's just the first law of thermo dynamics for a particular problem that we solved using mass ratios. I worked it out in a circle, as indicated, and before I drew the circle, one guy, ThermodynaMike was really confused xD ops