# Partition functions in $\phi^{4}$ theory

The partition function in a $\phi^{4}$ theory is written $$Z[J]=\int D\phi \, e^{-\int d^{4}x \left(\frac{1}{2}\left[(\nabla \phi)^{2}+m^{2}\phi^{2}\right]+\frac{\lambda}{4!}\phi^{4}+J\phi\right)}$$ I'm confused on how the Fourier transform of this is done. According to the Wikipedia page the quartic term becomes $$\int d^{4}pd^{4}p_{1}d^{4}p_{2}d^{4}p_{3} \delta^{4}(p-p_{1}-p_{2}-p_{3})\tilde\phi(p)\tilde\phi(p_{1})\tilde\phi(p_{2})\tilde\phi(p_{3})$$ but I don't understand why it isn't just $$\int d^{4}p\, \tilde\phi^{4}(p)$$ I get that the first one enforces momentum conservation, but is there a "cleaner" way to do it?

Let's define the fourier transform as $\phi(x)=\int_p e^{ipx}\phi(p)$. Plugging this expression in $\int_x \phi(x)^4$, you will get four integrals over the momenta, and one over position. This last integral will give the delta function, and the result is the one given by Wikipedia.