# Substituting field by its expectation value in path integral

Here notation used functional matrix notation. The spacetime variables $$x_1,x_2,...$$ will be denoted by $$1,2,...$$. For example $$\int dx_1$$ will be denoted by $$\int_1$$ and the fermion propagator $$S(x_1,x_2)$$ will be denoted by $$S_{12}$$ and so on.

Let $$Z$$ be the partition function for qed, $$\mathcal A$$ the action and $$S^{-1}$$ the inverse fermion propagator.

In this paper Recursive Graphical Construction of Feynman Diagrams in Quantum Electrodynamics its showed that

$$\int \mathcal{D}\bar{\psi}\mathcal{D}\psi\mathcal{D}A\Bigg\{\delta_{12}+\int_3{\bar{\psi_2}S^{-1}_{13}\psi_3}-e\int_{34}{V_{134}\bar{\psi_2}\psi_3}A_4\Bigg\}\exp{(-\mathcal A})=0 \tag{4.2}$$

Substituting the field product $$\bar{\psi_2}$$ $$\psi_3$$ by functional derivatives with respect to the electron kernel $$S^{-1}_{13}$$ they arrived to

$$\delta_{12}Z +\int_3{S^{-1}_{3} \frac{\delta}{S^{-1}_{23}}Z} -e\int_{34}{V_{134}\frac{\delta}{S^{-1}_{23}}}\bigg[\langle\hat A_4\rangle Z\bigg]=0 \tag{4.3}$$ My question is why they substituted the field $$A_4$$ by the expectation value $$\langle\hat A_4\rangle$$?

If you stay with the partition function $$Z$$ framework, you should add local and bi-local source terms such as $$\bar\psi j + \bar j\psi + \bar\psi\eta \psi + k_\mu A^\mu,$$ then in the functional integration you may substitute $$\bar{\psi_2}\psi_3 \rightarrow \frac{\delta}{\delta\eta_{23}}$$ or $$\bar{\psi_2}\psi_3 \rightarrow \frac{\delta}{\delta j_{2}} \frac{\delta}{\delta \bar j_{3}}$$ and $$A^\mu \rightarrow \frac{\delta}{\delta k_\mu}.$$
If you really want to leverage the language of functional dirivatives on propagator $$S(x_1,x_2)$$ such as $$\frac{\delta}{\delta S(x_1,x_2)}$$, you have to do a proper Legendre transformation and use the language of effective action $$\Gamma[S]$$ and such, rather than the original partition function $$Z$$.
Let $$Z=\exp (W)$$, since $$\langle\hat A\rangle=\frac{\delta W}{\delta j}$$ we have that $$\frac{\delta Z}{\delta j}=\frac{\delta W}{\delta j}Z \tag 1$$
on the other hand $$\frac{\delta Z}{\delta j}=AZ \tag 2$$
Comparing (1) and (2) we arrive at $$\langle\hat A\rangle=\frac{\delta W}{\delta j}=A$$