Why do things expand on heating?
With only two or three exceptions, all materials (solids, liquids and gases) expand as they become warmer. In the case of solids, the atoms vibrate more as the temperature goes up. So, even though they stay joined together, they move slightly further apart, and the solid expands a little in all directions.
The effect is small, but not trivial. A metre rule that is heated from 0 to 100 degrees (from the freezing point of water to its boiling point) will get 1 to 2 mm longer depending what material it is made of. Some plastics would not make good metre rules, as they would get up to 10 mm longer. liquids expand for the same reason. The atoms vibrate as they move around, and get slightly further apart. We talk about the increase in its volume as the temperature increases.
It is very difficult to prevent the thermal expansion of solids and liquids, as the material will create very large forces if it is not allowed to expand. So, for example, a large bridge is always built with expansion joints to allow it to get longer on a hot day.
However, the effect can also be useful. Metals expand at different rates as their temperatures rise. So if strips of two metals are bound closely together, and are: warmed, they bend as one: metal expands more than the other. Bimetallic strips like this can be used to control the temperature in a heating system such as an electric iron.
Like other liquids, water contracts as its temperature falls, and its density increases. Unlike other liquids, when its temperature falls below 4 degrees, water begins to expand again, and becomes less dense. This is called the anomalous expansion of water. The density falls even further as it freezes, because the water molecules form an open crystal structure in the solid state. So ice is less dense than water, while almost all other materials are more dense in the solid state than as a liquid.
Gases behave completely differently. Firstly, we don’t have to allow the gas to expand if it gets hotter; if we put it in a sealed container then we can just allow the pressure to increase instead. Secondly, if we do allow a gas to expand, then it will increase in volume much more than solids or liquids do as it gets hotter. Between 0 to 100 degrees it will expand by a third, so 300 of gas will become 400
In the diagram below the piston compresses the gas with a constant force 50 that the pressure of the gas is constant. We know from the molecular model that the piston is supported by the collisions of the molecules with the underside of the piston. If the temperature of the gas increases, the pressure starts to increase because the molecules travel faster and they hit the piston harder. Hence the piston starts to move up. The piston stops moving up when the pressure has dropped to the original value.
The result is that we have heated the gas and allowed its volume to increase at constant pressure. Note that initially, the pressure was made up of many molecules hitting the piston slowly. After the gas has heated up and expanded, the same pressure is made of fewer collisions with the piston, but these collisions are from molecules moving faster.