Consider a cylinder of volume V containing n moles of an ideal gas at pressure P, fitted with a piston of area A. Suppose, the gas is heated at constant pressure which raises its temperature by dT. The gas exerts a total force F = PA on the piston which moves outward a small distance dx.

dW = Fdx = PAdx = PdV … (1)
where Adx = dV is the increase in volume of the gas during the expansion. dW is the work done by the gas on the surroundings as a result of the expansion. If the heat supplied to the gas is dQp and the increase in its internal energy is dE then, by the first law of thermodynamics,
dQp = dE + dW=dE + PdV
If Cp is the molar specific heat capacity of the gas at constant pressure, dQ = nCp dT.
∴ nCpdT = dE + PdV …(2)
On the other hand, if the gas was heated at constant volume (instead of at constant pressure) from the initial state such that its temperature increases by the same amount dT, then dW=0. Since the internal energy of an ideal gas depends only on the temperature, the increase in internal would again be dE. If dQv was the heat supplied to the gas in this case, by the first law of thermodynamics and the definition of molar specific heat capacity at constant volume (CV),

The equation of state of an ideal gas is PV = nRT.
Therefore, at a constant pressure,
PdV = nRdT
\(\therefore\) \(\frac{dV}{dT}\) = \(\frac{nR}{P}\).......(5)
From Eqs. (4) and (5).
Cp - Cv = \(\frac{P}n\),\(\frac{nR}{P}\) = R.....(6)
This is Mayer’s relation between C and CV.
Here, heat and work are expressed in the same units. If heat is expressed in calorie or kilo calorie and work is expressed in erg or joule, the above relation becomes
Cp – Cv = \(\frac RJ\)......(7)
Where J is the mechanical equivalent of heat.