# Functional derivatives in DFT

Crossposted from Physics SE.

I am studying density functional theory and I am currently dealing with manipulating the intrinsic free energy, $$\mathcal{F}$$, which is defined as $$\mathcal{F} = F - \int dr \rho ^{(1)}(r)\phi (r)$$ which can be expressed in it's differential form as $$\delta \mathcal{F} = -S\delta T+ \int dr \delta \rho ^{(1)}(r) \psi (r)$$ In the above equations, $$F$$ is the Helmholtz free energy, $$\phi (r)$$ is some external field, $$\psi$$ is the intrinsic chemical potential defined as $$\psi (r) = \mu - \phi (r)$$, where $$\mu$$ is the chemical potential, and $$\rho ^{(1)}$$ is the single-particle density given in terms of the local activity as

$$\rho ^{(1)} (r_1)=\Xi ^{-1} \sum _{N=1}^{\infty} \frac{1}{(N-1)!} \int dr^{(N-1)} \exp [-\beta U(r^N)] \prod _{i=1}^N \left\{ z^{*}(r_i) \right\}$$ which can be generalized to $$\rho ^{(n)} (r_1)=\Xi ^{-1} \sum _{N=n}^{\infty} \frac{1}{(N-n)!} \int dr^{(N-n)} \exp [-\beta U(r^N)] \prod _{i=1}^N \left\{ z^{*}(r_i) \right\}$$ where $$z^{*}(r) = z\exp [-\beta \phi (r)]$$, where $$z$$ is the fugacity.

Defining the grand potential $$\Omega = \mathcal{F} - N\mu + \int dr \rho ^{(1)}(r) \phi (r)$$ we obtain $$\delta \Omega = -S\delta T - \int dr \rho ^{(1)}(r) \delta \psi (r)$$.

This is all fine so far. Now, in the notes I have been provided, they calculate the second derivative of $$\Omega$$, we take the $$\psi$$ derivative of $$\rho ^{(1)}$$, $$\frac{\delta ^2 \Omega}{\delta \psi (r_1) \delta \psi (r_2)} = -\frac{\delta \rho ^{(1)}(r_1)}{\delta \psi (r_2)}$$.

The first derivative makes sense, but now, they claim that \begin{align*} -\frac{\delta \rho ^{(1)}(r_1)}{\delta \psi (r_2)} &= \beta [\rho^{(1)}(r_1)\rho ^{(1)}(r_2) - \rho ^{(1)}(r_1) \delta (r_1-r_2) -\rho ^{(2)}(r_1,r_2)] \\ &= -\beta[\rho ^{(1)}(r_1) \rho ^{(1)}(r_2) h^{(2)}(r_1,r_2)+\rho ^{(1)}(r_1) \delta (r_1-r_2)] \end{align*}

Where $$h(r_1,r_2)$$ is the total correlation function.

I have no idea how they performed these derivatives and used the correlations. How did they simplify $$d\rho ^{(1)}(r_1)/d\psi (r_2)$$? I do not understand how the chain rule leads to the terms on the RHS. Nor how they managed to get $$\rho ^{(2)}$$ in the mix. Any help with these functional derivatives would be appreciated!

• Sep 18, 2021 at 8:49

This is not a complete answer, since I can't seem to work out the $$r_1=r_2$$ case, but I think this should get you most of the way to an answer.

To start, its useful to give another definition for the grand potential in terms of the grand partition function and write the derivatives implicitly using this definition: $$\Omega=\frac{1}{\beta}\ln(\Xi)\tag{1}\label{1}$$ $$\frac{\delta\Omega}{\delta\psi(r_1)}=\frac{1}{\beta}\frac{\frac{\delta\Xi}{\delta\psi(r_1)}}{\Xi}\tag{2}\label{2}$$ $$\frac{\delta^2\Omega}{\delta\psi(r_1)\delta\psi(r_2)}=\frac{1}{\beta}\bigg[\frac{\frac{\delta^2\Xi}{\delta\psi(r_1)\delta\psi(r_2)}}{\Xi}-\frac{\frac{\delta\Xi}{\delta\psi(r_1)}}{\Xi}\frac{\frac{\delta\Xi}{\delta\psi(r_2)}}{\Xi}\bigg]\tag{3}\label{3}$$

Where $$\Xi$$ is the grand partition function. We can also re-express $$\rho^{(n)}$$ using $$\Xi$$: $$\rho^{(n)}=\frac{1}{\beta\Xi}\frac{\delta^n\Xi}{\delta\psi(r_1)\delta\psi(r_2)...\delta\psi(r_n)}\label{4}\tag{4}$$ which we can see would lead to the result in equation \eqref{3} having the same form as in your question (at least for the $$r_1\neq r_2$$ case).

To see why this definition for $$\rho^{(n)}$$ works, we just need to remember how the functional derivative behaves for this sort of expression. In general, for a functional of the form $$F[\psi(r)]=\int dr f(r,\psi(r))$$ the functional derivative can be expressed as $$\frac{\delta F}{\delta\psi}=\frac{\partial f}{\partial\psi}$$

So, the functional derivative has the effect of removing an integral over $$r$$ and taking the partial derivative of the integrand. This is exactly what we see in your explicit expression for $$\rho^{(n)}$$: every time $$n$$ increase, the lowest index term in the sum is removed, the next lowest has its integral over $$r_n$$ removed, and each term gets a factor of $$\beta$$ due to the partial derivative.

I based most of this answer off my interpretation of what is described in Fundamentals of Inhomogeneous Fluids, mainly parts of chapters 2-3.

• Thank you @Tyberius! Sep 25, 2021 at 20:30