trying to account for x=0 case in free energy and chemical potential calculations