We analyze theoretically a common experimental process used to obtain the
magnetic contribution to the specific heat of a given magnetic material. In the
procedure, the specific heat of a non-magnetic analog is measured and used to
subtract the non-magnetic contributions, which are generally dominated by the
lattice degrees of freedom in a wide range of temperatures. We calculate the
lattice contribution to the specific heat for the magnetic compounds GdMIn5
(M = Co, Rh) and for the non-magnetic YMIn5 and LaMIn5 (M = Co, Rh),
using density functional theory based methods. We find that the best
non-magnetic analog for the subtraction depends on the magnetic material and on
the range of temperatures. While the phonon specific heat contribution of
YRhIn5 is an excellent approximation to the one of GdCoIn5 in the full
temperature range, for GdRhIn5 we find a better agreement with LaCoIn5,
in both cases, as a result of an optimum compensation effect between masses and
volumes. We present measurements of the specific heat of the compounds
GdMIn5 (M = Co, Rh) up to room temperature where it surpasses the value
expected from the Dulong-Petit law. We obtain a good agreement between theory
and experiment when we include anharmonic effects in the calculations