Two different approaches to study thermal expansion and compression of nanosystems are unified, which have been treated quite independently by earlier workers. We provide the simple theoretical analysis, which demonstrates that these two approaches may be unified into a single theory, viz. one can be derived from other. It is concluded that there is a single theory in the place of two different approaches. To show the real connection with the nanomaterials, we study the effect of temperature (at constant pressure), the effect of pressure (at constant temperature) as well as the combined effect of pressure and temperature. We have considered different nanomaterials viz. carbon nanotube, AlN, Ni, 80Ni-20Fe, Fe-Cu, MgO, CeO2, CuO and TiO2. The results obtained are compared with the available experimental data. A good agreement between theory and experiment demonstrates the validity of the present approach.