  We report on a significant failure of LDA and GGA to reproduce the phase
stability and thermodynamics of mixed-valence Li$_x$FePO$_4$ compounds.
Experimentally, Li$_x$FePO$_4$ compositions ($0 \leq x \leq 1$) are known to be
unstable and phase separate into Li FePO$_4$ and FePO$_4$. However,
first-principles calculations with LDA/GGA yield energetically favorable
intermediate compounds an d hence no phase separation. This qualitative failure
of LDA/GGA seems to have its origin in the LDA/GGA self-interaction which de
localizes charge over the mixed-valence Fe ions, and is corrected by explicitly
considering correlation effects in this material. This is demonstrated with
LDA+U calculations which correctly predict phase separation in Li$_x$FePO$_4$
for $U-J \gtrsim 3.5$eV. T he origin of the destabilization of intermediate
compounds is identified as electron localization and charge ordering at
different iron sites. Introduction of correlation also yields more accurate
electrochemical reaction energies between FePO$_4$/Li$_x$FePO$_ 4$ and
Li/Li$^+$ electrodes.
