Defining the local activity by
![{\displaystyle \left.z(r)\right.=z\exp[-\beta \psi (r)]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5711f24c6b0fa5613ba4f87e59d553408e7c4da9)
where
, and
is the Boltzmann constant.
Using those definitions the grand canonical partition function can be written as
.
By functionally-differentiating
with respect to
, and utilizing the mathematical theorem concerning the functional derivative,
,
we get the following equations with respect to the density pair correlation functions.
,
.
A relation between
and
can be obtained after some manipulation as,
![{\displaystyle {\delta \rho (r) \over {\delta \ln z(r')}}=\rho ^{(2)}(r,r')-\rho (r)\rho (r')+\delta (r-r')\rho (r).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f0d0800d7e2cfd5ca9fb03e79a18e377a6f4b9f0)
Now, we define the direct correlation function by an inverse relation of the previous equation,
![{\displaystyle {\delta \ln z(r) \over {\delta \rho (r')}}={\delta (r-r') \over {\rho (r')}}-c(r,r').}](https://wikimedia.org/api/rest_v1/media/math/render/svg/248bf25124c088b235f10aa6881b820c904c92d8)
Inserting these two reults into the chain-rule theorem of functional derivatives,
,
one obtains the Ornstein-Zernike relation.
Thus the Ornstein-Zernike relation is,
in a sense, a differential form of the partition function.