The Helmholtz free energy A(N,V,T) is a natural function of N, V and T. The isothermal-isobaric ensemble is generated by transforming the volume V in favor of the pressure P so that the natural variables are N, P and T (which are conditions under which many experiments are performed - ``standard temperature and pressure,'' for example).
Performing a Legendre transformation of the Helmholtz free energy
But
Thus,
where G(N,P,T) is the Gibbs free energy.
The differential of G is
But from G=A+PV, we have
but
, thus
Equating the two expressions for dG, we see that