Ideal gases are exceedingly idealised systems and are not suited to describe the behaviour of real systems: they always obey the same state equation and never undergo phase transitions (for example they never condense).
We must therefore step a little further: using the "philosophy" of mean field theories we can make the description of fluids a little bit more realistic. As we will see this will also lead to the derivation of the *Van der Waals equation*, which better describes the behaviour of real fluids (even if, as we will shortly see, it still has some problems).

In general, in a real gas all the atoms or molecules interact through a certain potential $\Phi (\lbrace {\vec {r}}_{i}\rbrace )$ that will depend on the positions of all the particles. For a system of $N$ particles the configurational contribution to the partition function will therefore be:

$Q_{N}=\int \prod _{i=1}^{N}d{\vec {r}}_{i}e^{-\beta \left(\sum _{i=1}^{N}\varphi _{\text{ext}}(\lbrace {\vec {r}}_{i}\rbrace )+\Phi (\lbrace {\vec {r}}_{i}\rbrace )\right)}$

where

$\varphi _{\text{ext}}$ is an external potential and in general:

$\Phi (\lbrace {\vec {r}}_{i}\rbrace )=\sum _{i\neq j}U_{2}({\vec {r}}_{i},{\vec {r}}_{j})+\sum _{i\neq j\neq k}U_{3}({\vec {r}}_{i},{\vec {r}}_{j},{\vec {r}}_{k})+\cdots$

(where

$U_{n}$ can be a generic

$n$-body interaction potential).
Generally

$\varphi _{\text{ext}}$ does not pose great problems while it is

$\Phi$ that makes

$Q_{N}$ impossible to compute exactly, forcing us to resort to approximations. In the framework of mean field theories we substitute the interaction potential

$\Phi$ with an

*effective single-particle potential*$\varphi ({\vec {r}}_{i})$ that acts on every particle in the same way:

$\Phi (\lbrace {\vec {r}}_{i}\rbrace )\approx \sum _{i}\varphi ({\vec {r}}_{i})$.
Therefore, neglecting the external term for the sake of simplicity, mean field theories allow us to compute

$Q_{N}$ as:

$Q_{N}=\left(\int d{\vec {r}}e^{-\beta \varphi ({\vec {r}})}\right)^{N}$

Of course, every particular mean field theory will provide a different form of

$\varphi$, which will lead to different results.