  The thermal properties of materials are critically important to various
technologies and are increasingly the target of materials design efforts.
However, it is only relatively recent advances in first-principles
computational techniques that have enabled researchers to explore the
microscopic mechanisms of thermal properties, such as thermal expansion. We use
the Gr\"{u}neisen theory of thermal expansion in combination with density
functional calculations and the quasiharmonic approximation to uncover
mechanisms of thermal expansion in PbTiO$_3$ thin-films in terms of elastic and
vibrational contributions to the free energy. Surprisingly, we find that
although the structural parameters of PbTiO$_3$ thin-films evolve with
temperature as if they are dominated by linear elasticity, PbTiO$_3$ thin-films
are strongly anharmonic, with large changes in the elastic constants and
Gr\"{u}neisen parameters with both misfit strain and temperature. We show that
a fortuitous near-cancellation between different types of anharmonicity gives
rise to this behavior. Our results illustrate the importance of high-order
phonon-strain anharmonicity in determining the temperature-dependent structural
parameters of PbTiO$_3$ thin-films, and highlight the complex manner in which
thermal expansion, misfit strain and elastic and vibrational properties are
intertwined.
