I've been reviewing a paper on modeling starling flocks and I am struggling to follow a jump in the math. They have the following:
(1) $H = \frac{J}{2}\sum_\limits{\langle ij\rangle} (\phi_i-\phi_j)^2 = \frac{1}{2}a^2J\int\frac{d^3x}{a^3}[\nabla \phi (x,t)]^2$
(2) $\frac{\partial \phi}{\ t} = -\frac{\delta H}{\delta \phi}=a^2J\nabla^2\phi$
where $J$ is a constant, $a$ is the average nearest-neighbor distance, and $\phi_i$ is the angle between the direction of motion of bird $i$ and the flock
What is not clear to me is how the following happens:
$-\frac{\delta H}{\delta \phi} = -\frac{\delta}{\delta \phi} \left(\frac{1}{2}a^2J\int\frac{d^3x}{a^3}[\nabla \phi (x,t)]^2\right)\to a^2J\nabla^2\phi$
I thought maybe they were they were using vector properties
$\int [\nabla \phi]^2 d^3x = \int \nabla \cdot(\phi\nabla\phi)d^3x-\int \phi \nabla^2\phi d^3x$
where by the divergence theorem $\int \nabla \cdot(\phi\nabla\phi)d^3x = \int\phi\nabla\phi n dS\to0$ as the integration is all over space so the surface S goes to infinity. This process would get rid of the negative sign but then applying the $\frac{\delta}{\delta\phi}$, I think it would become
$-\frac{\delta H}{\delta \phi} =\frac{1}{2}a^2J\int\left(\frac{\delta}{\delta \phi}\left[\phi\nabla^2 \phi\right]\right)\frac{d^3x}{a^3}=\frac{1}{2}a^2J\int\left(\nabla^2 \phi +\phi\nabla^2(1)\right)\frac{d^3x}{a^3}=\frac{1}{2}a^2J\int\nabla^2 \phi \frac{d^3x}{a^3}$
but that doesn't seem to be right, as then the integral of the Laplacian would just give you back the Laplacian. I've been out of school for over a decade, so I'm assuming there is basic vector calculus that I don't remember that would fix this.
I believe I figured out most of it. Really I needed to be more focused on the the variance $\frac{\delta H}{\delta \phi}$. I believe they're using the functional derivative (wiki):
Given:
$H[\phi] = \int \frac{f(x,\nabla \phi (x))}{a^3} d^3x$
then
$\int \frac{\delta H}{\delta \phi(x)}\frac{\rho(x)}{a^3} d^3x =\left[\frac{d}{d\epsilon} \int \frac{f(x,\nabla \phi(x) +\epsilon\nabla\rho(x))}{a^3}d^3x\right]_{\epsilon=0} $
$\int \frac{\delta H}{\delta \phi(x)}\frac{\rho(x)}{a^3} d^3x =\left[ \int \frac{d}{d\epsilon}\frac{(\nabla \phi(x) +\epsilon\nabla\rho(x))^2}{a^3}d^3x\right]_{\epsilon=0} $
$\int \frac{\delta H}{\delta \phi(x)}\frac{\rho(x)}{a^3} d^3x =\left[ \int \frac{2(\nabla \phi(x) +\epsilon\nabla\rho(x))\nabla\rho(x)}{a^3}d^3x\right]_{\epsilon=0} $
$\int \frac{\delta H}{\delta \phi(x)}\frac{\rho(x)}{a^3} d^3x = \int \frac{2\nabla \phi(x)\nabla\rho(x)}{a^3}d^3x $
from vector properties and the divergence theorem
$\int \frac{\delta H}{\delta \phi(x)}\frac{\rho(x)}{a^3} d^3x =\int \frac{-2\nabla^2 \phi(x)\rho(x)}{a^3}d^3x $
$\int \frac{\delta H}{\delta \phi(x)}\frac{\rho(x)}{a^3} d^3x =\int -2\nabla^2 \phi(x)\frac{\rho(x)}{a^3}d^3x $
so then
$\frac{\delta H}{\delta \phi(x)} =-2\nabla^2 \phi(x) $
which combined with the original $H = \frac{a^2J}{2}\int d^3x (\nabla\phi)^2$ gives
$-\frac{\delta H}{\delta \phi(x)} =a^2J\nabla^2 \phi(x) $
Though it seems a bit hand-wavy how they drop the $a^3$ and not the other constants.