Solution (source code)

= Solution

Keep $\lambda$ for the cubic coupling and $j$ for the external <source>. Expanding the interaction part of the <scalar field path integral> yields
$$
Z[\lambda;j]=\sum_{V=0}^\infty\frac1{V!}
\left(-\frac{i\lambda}{3!}\right)^V
\int\prod_{v=1}^V d^4y_v\int D\phi\,
\prod_{v=1}^V\phi(y_v)^3\,
 e^{iS_0[\phi]+i\int j\phi}.
$$
A <functional derivative> of the source exponential inserts $i\phi(y)$. In particular, $\delta_j(y)^3 e^{i\int j\phi}=-i\phi(y)^3e^{i\int j\phi}$, so $-i\lambda\phi(y)^3$ can be replaced by $\lambda\delta_j(y)^3$. The <functional derivatives> commute and can be taken outside the free <path integral>. Resumming the <exponential series> gives
$$
\boxed{Z[\lambda;j]=\exp\left[\frac\lambda{3!}\int d^4y\,
\frac{\delta^3}{\delta j(y)^3}\right]Z[0;j].}
$$
This is a formal <perturbation series>; a real cubic <scalar potential> is unbounded and the expression does not assert a stable nonperturbative <vacuum state>.

To evaluate the free <Gaussian path integral>, use <integration by parts> to write
$$
S_0[\phi]+\int j\phi=\frac12\int\phi K\phi+\int j\phi,
\qquad K=-\Box-m^2+i\epsilon.
$$
The inverse kernel is
$$
K^{-1}(x,y)=D(x-y)
=\int\frac{d^4p}{(2\pi)^4}
\frac{e^{-ip\cdot(x-y)}}{p^2-m^2+i\epsilon}.
$$
<Completing the square> with $\phi=\chi-K^{-1}j$ changes the exponent to $i\int\chi K\chi/2-i\int jK^{-1}j/2$. The translation-invariant <functional measure> makes the remaining <Gaussian path integral> precisely $Z[0;0]$, hence
$$
\boxed{Z[0;j]=Z[0;0]\exp\left[-\frac i2\int d^4x\,d^4y
\int\frac{d^4p}{(2\pi)^4}
\frac{j(x)j(y)e^{-ip\cdot(x-y)}}{p^2-m^2+i\epsilon}\right].}
$$
For $\epsilon>0$, the exponent includes $-\epsilon\int\phi^2/2$, which damps the regulated finite-dimensional integrals. The <Feynman i-epsilon prescription> displaces the positive-<energy> pole below the real $p^0$ axis and the negative-<energy> pole above it, selecting the time-ordered <vacuum expectation value>. Indeed the <Feynman propagator> is $\Delta_F=iD$. Thus $i\epsilon$ specifies both convergence and the <vacuum state> boundary conditions, with $\epsilon\to0^+$ taken after integration.