how can we say that solids expand on heating and contract on cooling?
Movement of the particles depends on the temperature. On increasing the temperature, the particles get energized and hence they start vibrating rapidly from their mean position. Therefore, the inter particle space increases and thus solid expands.
When the temperature is lowered, the particles lose their energy and thus inter particle space decreases and solid contracts.