Here n is the number of moles of gas and R is the molar ideal gas constant. Because the internal energy does not change and the internal energy of an ideal gas is solely a function of temperature, the temperature of the gas does not change; therefore T i = T f . This implies that P i V i = P f V f = n R T i .