We calculate the free energy density for inhomogeneous electrolytes based on the mean-field Debye-Huckel theory. Derived are the contributions of (1) the differential term for the electrolyte density being slow varying in one direction and (2) the boundar