The principle includes energy exchange by heat transfer and by the performance of mechanical work and introduces the concept of the internal energy of the system.
In thermodynamics, the quantity of heat, Q, added to the system and the work, W, done by the system are used to describe the energy relations in any thermodynamic process.
The gas in the constant-pressure and the constant-volume process is brought at the same temperature change so dU is the same for both processes, then nCpdT = nCVdT + nRdT.
Equation (6-5) is the First Law of Thermodynamics, a generalization of the principle of conservation of energy to include energy transfer through heat as well as mechanical work.
The change in internal energy is independent of path, unlike Q and W which depend on the initial and final states and the path leading from one state to the other.
Internal energy U of a system is defined as the sum of the total kinetic energy of all of its constituent particles and all the total potential energy of interaction among these particles.
When the system does work W by expanding against its surroundings and no heat is added during the process, energy leaves the system and the internal energy decreases; then ΔU = -W.