So energy is lost as heat as a function of DPDt how fast we compress the gas or a non reversible process. In an irreversible compression the work done by the surroundings on the system is larger than in a reversible compression between the same states. This Demonstration compares the thermodynamic processes of reversible and irreversible isothermal expansion of an ideal gas.
W Pext DV ie.
Here why we are not considering internal pressure. W n e t P 1 V 2 V 1 I n P 1 P 2. A P-T graph is shown for a cyclic process. For an ideal gas whose internal energy U is only a function of temperature we thus have for the first law of thermodynamics.