Solution (source code)

= Solution

In <momentum space>, the <Feynman rules> for the <real scalar field> are
$$
\boxed{\text{internal line: }\frac{i}{p^2-m^2+i0},\qquad
\text{cubic vertex: }-ig_1,\qquad
\text{quartic vertex: }-ig_2.}
$$
Each <interaction vertex> supplies $(2\pi)^6\delta^{(6)}(\sum p)$, with all its <momenta> counted inward. Impose <momentum conservation>, integrate each independent <loop momentum> with $d^6p/(2\pi)^6$, and divide by the <Feynman-diagram symmetry factor>. For a connected amputated <scattering amplitude>, remove the external <scalar propagators> and retain a single overall <momentum conservation> factor. These signs follow by expanding $\exp(i\int\mathcal L_{\mathrm{int}})$; the factorials in the <Lagrangian density> cancel the corresponding attachments in the <Wick theorem>. The <Feynman i-epsilon prescription> specifies the <scalar propagator> poles.