The top equation is useful to find average overall temperature, while the bottom Tm equation is best for finding average temperature over a change in length if you know heat flux or heat transfer coefficient.