The N-particle quantum mechanical system in an external field is considered
on the basis of two-particle density functions. The main point of the pres
ented work is to reveal the advantages of the two-particle density formalis
m as compared to the common one-particle density formalism applied to a sim
ple example. The two-particle density formalism permits us to take into acc
ount the exact two-particle interaction without additional models. The exch
ange and correlation effects can be considered by a proper choice of the tr
ial function. By using the presented formalism we calculate the density of
the electron gas on different metal surfaces. A simple trial function allow
ing for correlations gives us a more correct fit to the experimental data o
n the metal dipol barriers than corresponding calculations with the one-par
ticle density formalism. It is also shown that a pertubation of the externa
l potential can be effectively taken into account by a pertubation calculat
ion for the trial function.