paralleltransport said:
First I'll rewrite S by integrating by part:
$$ S = \frac12 \int d^4 x \partial_\mu \phi \partial^\mu \phi - m^2 \phi^2 = Boundary term - \int d^4 x \phi ( \partial^2 + m^2) \phi $$
Whenever you have to think of functional derivatives I find it easiest to do it in discrete space:
If
$$S[\phi] = \sum_{x y} \phi_x A_{xy} \phi_y$$
then the second order variation
$$ {\delta S \over \delta \phi_x \delta \phi_y} \equiv {\partial S \over \partial \phi_x \partial \phi_y} = A_{xy}$$
In the continuum, your operator $A_{xy}$ is just $\partial^2 + m^2$ as derived above. That just means:
$$ {\delta S \over \delta \phi_x \delta \phi_y} = \partial^2 + m^2$$
Thanks for the response. Having read up on this a bit more since I first wrote this post, shouldn't there be a ##\delta##-function floating around that the ##\Box## operator acts on?
This is what I've come up with since for the more general case of a Lagrangian for a scalar field with up to first-order derivatives in the field. Starting from $$\delta\mathcal{L}=\frac{\partial\mathcal{L}}{\partial\phi(x)}\delta\phi(x)+
\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi(x))}\partial_{\mu}(\delta\phi(x))+\mathcal{O}(\delta\phi^{2})$$ we have that to first-order: $$\frac{\delta S}{\delta\phi(y)}=\int\,d^{4}z\left[
\frac{\partial\mathcal{L}}{\partial\phi(z)}\delta^{(4)}(y-z)+
\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi(z))}\partial_{\mu}(\delta^{(4)}(y-z))
\right]\\=\int\,d^{4}z\left[
\frac{\partial\mathcal{L}}{\partial\phi(z)}-\partial_{\mu}\left(
\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi(z))}\right)
\right]\delta^{(4)}(y-z)\\
=\frac{\partial\mathcal{L}}{\partial\phi(y)}-\partial_{\mu}\left(
\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi(y))}\right)\qquad\qquad\qquad\qquad
$$ where the boundary term vanishes since ##\delta^{(4)}(y-z)## is zero on the boundary of the spacetime volume we're integrating over (because it has compact support within the the boundary of the spacetime volume), and we have used that $$\frac{\delta\phi(x)}{\delta\phi(y)}=\delta^{(4)}(x-y)$$
Given this we can then take the second order variation by noting that
$$
\delta\left[\frac{\partial\mathcal{L}}{\partial\phi(y)}-\partial_{\mu}\left(
\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi(y))}\right)\right]=\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)^{2}}\delta\phi(y)+\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)\partial(\partial_{\mu}\phi(y))}\partial_{\mu}(\delta\phi(y))-
\partial_{\mu}\left(
\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)\partial(\partial_{\mu}\phi(y))}\delta\phi(y)\right)\\-
\partial_{\mu}\left(
\frac{\partial^{2}\mathcal{L}}{\partial(\partial_{\mu}\phi(y))\partial(\partial_{\nu}\phi(y))}\partial_{\nu}(\delta\phi(y))\right)$$ such that
$$\frac{\delta^{2}S}{\delta\phi(x)\delta\phi(y)}=
\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)^{2}}\delta^{(4)}(x-y)+\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)\partial(\partial_{\mu}\phi(y))}\partial_{\mu}(\delta^{(4)}(x-y))-
\partial_{\mu}\left(
\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)\partial(\partial_{\mu}\phi(y))}\delta^{(4)}(x-y)\right)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad
\\-
\partial_{\mu}\left(
\frac{\partial^{2}\mathcal{L}}{\partial(\partial_{\mu}\phi(y))\partial(\partial_{\nu}\phi(y))}\partial_{\nu}(\delta^{(4)}(x-y))\right)
\\=\left[\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)^{2}}-
\partial_{\mu}\left(
\frac{\partial^{2}\mathcal{L}}{\partial\phi(y)\partial(\partial_{\mu}\phi(y))}\right)
\right]\delta^{(4)}(x-y)-\partial_{\nu}\left(
\frac{\partial^{2}\mathcal{L}}{\partial(\partial_{\nu}\phi(y))\partial(\partial_{\mu}\phi(y))}\right)\partial_{\mu}(\delta^{(4)}(x-y))-\frac{\partial^{2}\mathcal{L}}{\partial(\partial_{\mu}\phi(y))\partial(\partial_{\nu}\phi(y))}\partial_{\mu}\partial_{\nu}(\delta^{(4)}(x-y))
$$
Thus, in the case where ##\mathcal{L}=\frac{1}{2}\partial_{\mu}\phi\partial^{\mu}\phi-\frac{1}{2}\phi^{2}##, we see that $$\frac{\delta^{2}S}{\delta\phi(x)\delta\phi(y)}=-m^{2}\delta^{(4)}(x-y)-\Box\left(\delta^{(4)}(x-y)\right)=-\left(\Box +m^{2}\right)\delta^{(4)}(x-y)$$ Would this analysis be correct at all? I'm struggling to find any notes that go into detail about it all. I'm trying to understand it in an effort to get to grips with effective actions and the background field method for finding the one-loop effective action.