IV. The theory of electrocapillarity. — Part II. The thermodynamics of capillarity