Functional derivatives on position and momentum spaces I'll first give some context for the problem I'm having, but the essence of it seems to be related to only what is in the title.
I've been working with the Wetterich equation for the Functional Renormalization Group. In this technique, we often need to compute functional derivatives of the effective action. Often the calculations get simpler when working with momentum space. However, I have been struggling with how to actually take the derivatives in momentum space.
Pick, for example, the effective action given by
$$\Gamma_k[\varphi] = \int - \frac{1}{2} \varphi \partial^2 \varphi + \frac{m_k^2}{2} \varphi^2 + \frac{\lambda_k}{4!} \varphi^4 \textrm{d}^4 x.$$
In position space, the second functional derivative would read
$$\frac{\delta^2 \Gamma_k}{\delta \varphi(x) \delta \varphi(y)} = - \partial^2 \delta^{(4)}(x-y) + m_k^2 \delta^{(4)}(x-y) + \frac{\lambda_k}{2}\varphi^2(x) \delta^{(4)}(x-y),$$
but since it is weird to write $- \partial^2$, we'll often just implicitly take this expression to momentum space and write
$$\frac{\delta^2 \Gamma_k}{\delta \varphi \delta \varphi} = q^2 + m_k^2 + \frac{\lambda_k}{2}\varphi^2, \tag{1}$$
where the deltas are omitted since they were only an identity on "functional matrix space" and $q$ stands for momentum.
Eq. (1) can be found, for example, on R. Percacci's An Introduction to Covariant Quantum Gravity and Asymptotic Safety as a special case of Eq. (6.26). More specifically, Percacci writes

$$\Gamma_k(\varphi) = \int \textrm{d}^4x \left[\frac{1}{2} (\partial_\mu\varphi)^2 + V_k(\varphi^2)\right] \tag{6.24}$$

and

In momentum space [...] the inverse propagator is
$$\frac{\delta^2 \Gamma_k}{\delta \varphi \delta \varphi} = q^2 + 2 V_k' + 4 \varphi^2 V_k'', \tag{6.26}$$
where a prime denotes the derivative with respect to $\varphi^2$.

Notice Eq. (1) is just Percacci's Eq. (6.26) for the potential $V_k(\phi^2) = \frac{m_k^2}{2} \varphi^2 + \frac{\lambda_k}{4!} \varphi^4$.
Let us now attempt to obtain the same conclusion by rewriting the effective action on momentum space from the very start. Denoting the Fourier transform by
$$\tilde{\varphi}(p) = \int \varphi(x) e^{- i x \cdot p} \textrm{d}^4 x$$
so that the inverse reads
$$\varphi(x) = \frac{1}{(2\pi)^4} \int \tilde{\varphi}(p) e^{+ i x \cdot p} \textrm{d}^4 p.$$
We get, for the first term,
$$
\begin{align}
\int - \frac{1}{2} \varphi \partial^2 \varphi \textrm{d}^4 x &= \frac{1}{(2\pi)^8}\int - \frac{1}{2} \tilde{\varphi}(p)\tilde{\varphi}(q) e^{i x \cdot p}\partial^2 e^{i x \cdot q} \textrm{d}^4 x \ \textrm{d}^4 p \ \textrm{d}^4 q, \\
&= \frac{1}{(2\pi)^8} \int \frac{1}{2} q^2 \tilde{\varphi}(p)\tilde{\varphi}(q) e^{i x \cdot (p + q)} \textrm{d}^4 x \ \textrm{d}^4 p \ \textrm{d}^4 q, \\
&= \frac{1}{(2\pi)^4} \int \frac{1}{2} q^2 \tilde{\varphi}(p)\tilde{\varphi}(q) \delta^{(4)}(p + q) \textrm{d}^4 p \ \textrm{d}^4 q, \\
&= \frac{1}{(2\pi)^4} \int \frac{1}{2} q^2 \tilde{\varphi}(p)\tilde{\varphi}(-p) \textrm{d}^4 p.
\end{align}
$$
Proceeding similarly with the other terms, we get to
$$\Gamma_k[\varphi] = \frac{1}{(2\pi)^4} \int \frac{1}{2} \big[p^2 + m_k^2 \big] \ \tilde{\varphi}(p)\tilde{\varphi}(-p) \textrm{d}^4 p + \frac{\lambda_k}{4! (2\pi)^{12}} \int \tilde{\varphi}(p)\tilde{\varphi}(q)\tilde{\varphi}(r)\tilde{\varphi}(-p-q-r) \textrm{d}^4 p \ \textrm{d}^4 q \ \textrm{d}^4 r.$$
Hence, it seems that the functional derivative is
$$\frac{\delta^2 \Gamma_k}{\delta \varphi(p) \delta \varphi(q)} = \frac{1}{(2\pi)^4} p^2 \delta^{(4)}(p+q) + \frac{1}{(2\pi)^4} m_k^2 \delta^{(4)}(p+q) + \frac{\lambda_k}{2 (2\pi)^{12}} \int \tilde{\varphi}(r)\tilde{\varphi}(-p-q-r) \textrm{d}^4 r. \tag{2}$$
I can't understand how Eqs. (1) and (2) can coexist. They appear to give vastly different expressions for the same thing, especially due to the integral. The factors of $(2\pi)^4$ everywhere seem to be wrong, but I can't figure out why. In short, what is the correct manner of taking the functional derivative on momentum space and why do Eqs. (1) and (2) (seem to) disagree? References and further comments are welcome, but not necessary for the answer to be accepted.
Edit: I removed the mention of taking $\tilde{\varphi}(p) = \tilde{\varphi}_0$, as I recalled this is incorrect. We in fact take $\varphi(x) = \varphi_0$, in position space. Nevertheless, the main points of the question remain.
 A: After a while, I noticed that, if we set $\varphi(x) = \varphi_0$, the last term of Eq. (2) can be written as
$$
\begin{align}
\frac{\lambda_k}{2 (2\pi)^{12}} \int \tilde{\varphi}(r)\tilde{\varphi}(-p-q-r) \textrm{d}^4 r &= \frac{\lambda_k}{2 (2\pi)^{12}} \int \tilde{\varphi}(r)\tilde{\varphi}(s) \delta^{(4)}(p+q+r+s) \textrm{d}^4 r \ \textrm{d}^4 s, \\
&= \frac{\lambda_k}{2 (2\pi)^{12}} \int \varphi(x)\varphi(y) e^{-i r \cdot x} e^{-i s \cdot y} \delta^{(4)}(p+q+r+s) \textrm{d}^4 r \ \textrm{d}^4 s \ \textrm{d}^4 x \ \textrm{d}^4 y, \\
&= \frac{\lambda_k \varphi_0^2}{2 (2\pi)^{12}} \int e^{-i r \cdot x} e^{-i s \cdot y} \delta^{(4)}(p+q+r+s) \textrm{d}^4 r \ \textrm{d}^4 s \ \textrm{d}^4 x \ \textrm{d}^4 y, \\
&= \frac{\lambda_k \varphi_0^2}{2 (2\pi)^{4}} \int \delta^{(4)}(r) \delta^{(4)}(s) \delta^{(4)}(p+q+r+s) \textrm{d}^4 r \ \textrm{d}^4 s, \\
&= \frac{\lambda_k \varphi_0^2}{2 (2\pi)^{4}} \delta^{(4)}(p+q).
\end{align}
$$
At this stage, Eq. (2) becomes
$$
\begin{align}
\frac{\delta^2 \Gamma_k}{\delta \varphi(p) \delta \varphi(q)} &= \frac{1}{(2\pi)^4} p^2 \delta^{(4)}(p+q) + \frac{1}{(2\pi)^4} m_k^2 \delta^{(4)}(p+q) + \frac{\lambda_k \varphi_0^2}{2 (2\pi)^{4}} \delta^{(4)}(p+q), \\
&= \frac{\delta^{(4)}(p+q)}{(2\pi)^4} \left[p^2 + m_k^2 + \frac{\lambda_k \varphi_0^2}{2} \right].
\end{align}
$$
At this stage, the differences are merely conventional. To proceed to the Wetterich equation, one would consider a cutoff $R_k(p^2)$, define $P_k(p^2) = p^2 + R_k(p^2)$, write
$$
\begin{align}
\left(\Gamma^{(2)}_k + R_k\right)^{-1} k\partial_k R_k &= \frac{(2\pi)^4 \delta^{(4)} (p+q) k\partial_k R_k}{P_k(p^2) + m_k^2 + \frac{\lambda_k \varphi_0^2}{2}}, \\
\frac{1}{2}\textrm{Tr}\left[\left(\Gamma^{(2)}_k + R_k\right)^{-1} k\partial_k R_k\right] &= \frac{1}{(2\pi)^4} \int \frac{(2\pi)^4 \delta^{(4)} (0) k\partial_k R_k}{2 \left[P_k(p^2) + m_k^2 + \frac{\lambda_k \varphi_0^2}{2}\right]} \textrm{d}^4p, \\
&= \frac{V_4}{(2\pi)^4} \int \frac{k\partial_k R_k}{2 \left[P_k(p^2) + m_k^2 + \frac{\lambda_k \varphi_0^2}{2}\right]} \textrm{d}^4p, \tag{3}
\end{align}
$$
where $V_4 = (2\pi)^4 \delta^{(4)} (0) = \int \textrm{d}^4 x$. The $(2 \pi)^4$ factors get absorbed on the four-dimensional volume, which will be cancelled on the LHS as mentioned on the comment by bbrink. Eq. (3) then agrees with Percacci's Eqs. (6.28) and (6.29):

$$\partial_t \Gamma_k = \frac{1}{2} \textrm{Tr}\left(\frac{\partial_t P_k}{P_k + 2 V_k' + 4 \varphi^2 V_k''}\right) \tag{6.28}$$

and

$$\textrm{Tr}(W(-\partial^2)) = \int \textrm{d}^d x \int \frac{\textrm{d}^d q}{(2\pi)^d} W(q^2),  \tag{6.29}$$

where I omitted a second equality of Eq. (6.29) which is not relevant in here.
In summary, the difference between both equations is that Percacci's version leaves the delta and $(2\pi)^4$ factors implicit and reinserts them when computing the trace.
