Fourth-order terms in nonequilibrium thermodynamic potentials