We
present a systematic analysis to describe the free energy of
electrical double layers (EDLs) based on variational calculus and
demonstrate that the EDL free energy needs to be appropriately modified
for different boundary conditions. We extend our formalism to study
the electrostatic interaction potential between two plates and reconcile
the two complementary methods utilized in the literature, i.e., the
Gibbs–Duhem equation and the EDL grand potential. Next, we
perform the same analysis while also including electrostatic correlations
between the ions through the recently proposed modified Gauss’s
law involving a fourth-order differential equation for the electrical
potential. The variational calculus formalism enables us to self-consistently
derive the additional boundary conditions required for higher-order
derivatives of the electrical potential, an approach that was previously
overlooked. Next, we expand our analysis to predict the electrostatic
interaction potential between two plates for any electrical potential,
ion size, and correlation length scale. We calculate the potential
distribution and estimate the interaction potential for a range of
physical parameters. Our results reveal that the self-consistently
derived boundary condition may significantly affect the properties
of EDLs. Finally, we outline an alternative model to include electrostatic
correlations that does not require additional parameters or boundary
conditions. In summary, our analysis provides a robust framework to
describe the thermodynamics of EDLs and will be useful for future
fundamental and applied studies of EDLs, which occur across the sciences
and engineering.