If we heated two identical metal rod both vertically and horizontally, we would observe that it expands. However, if the rod is placed vertically, gravity will indeed play a role. The expansion of the rod increases its height, which in turn increases its gravitational potential energy. This is because the center of mass of the rod is raised higher. To clarify:
$$Q=mcΔT\ +\ ΔU$$
Now let's say we have two rectangular metal rods and their dimensions are L and L/4 as shown in the figure. The question I'm curious about is this: If we give a total heat Q to this system, what will be the amount of extension of these rods (Δh and ΔL)? (Assume that the heat is distributed properly and there is no energy loss in the system.And you don't need to give a value here, you can just use the units.)
The problem here is, I found Δh=ΔL. But I don't think this is correct. Eventually doesn't the metal block at the bottom do more work and need to extend less? Also if the temperature changes in the two blocks are different, the formula should be as follows
$$Q=mcΔT_{1}\ +mcΔT_{2}+\ ΔU$$
But can this formula be correct? After all, the two blocks are in contact and everything, including their initial temperatures, are identical and must be at the same temperature. So in short, what I mean is that it seems illogical to me in both cases.