phinds said:
@MartinG, be aware that using only Newton's Law of Gravity, a body does not gain weight if its temperature is increased. Einstein's General Relativity (which describes the world we actually live in) is a more comprehensive (and more accurate) description of gravity and it includes energy as part of what affects space time curvature (which we call Gravity).
The above distinguishes between how the active gravitational mass of an system changes (or does not change) when the system gains energy under Newtonian mechanics and under General Relativity. As you point out, energy counts under General Relativity but does not count under Newtonian mechanics.
This explanation is slightly unsatisfying because in General Relativity it is not "mass" that gravitates. Instead it is stress and energy (the stress-energy tensor) that gravitates. So let us consider inertial mass instead.
As originally presented and as presented in many introductory physics textbooks and popular science presentations, mass increases with velocity. This is called "relativistic mass increase". Relativistic mass increases with velocity according to ##m_r=m_0 \frac{1}{\sqrt{1-v^2/c^2}}##
However, the notion of relativistic mass has fallen out of favor. Instead, when physicists use the word "mass", they mean "invariant mass". We have an Insights article on this:
https://www.physicsforums.com/insights/what-is-relativistic-mass-and-why-it-is-not-used-much/
The invariant mass (or just plain "mass") for a system can be defined in either of two ways. Either as the total energy (divided by ##c^2##) in a frame of reference where the system has zero momentum or as the invariant magnitude of the system's energy-momentum four-vector. The two definitions are equivalent except that the latter still works for objects moving at light speed. We can stick with the former definition since things with temperature cannot move at light speed.
If you increase the energy of a system (e.g. by heating it up) without changing its momentum, you increase the invariant mass of the system.
I have not done the math, but I confidently assert that the inertial mass of a compact, bound system is the same as its invariant mass. Also under general relativity there is no distinction between inertial mass and passive gravitational mass.