General form for functional derivatives Working on the hamiltonian formalism applied to canonical field theory, how do I deduce the general form for the functional derivatives  $\frac{\delta}{\delta \pi}$
 and  $\frac{\delta}{\delta \phi}$ (in terms of partial derivatives) for a general functional $$F[\phi, \pi, \partial_{i}\phi, \partial_{j}\pi]~?$$
Field quantization, by Greiner and Reinhardt, claims that
$$\frac{\delta H}{\delta \phi}=\frac{\partial\mathcal{H}}{\partial\phi}-\partial_{i}\frac{\partial\mathcal{H}}{\partial(\partial_{i}\phi)}$$  
$$\frac{\delta H}{\delta \pi}=\frac{\partial\mathcal{H}}{\partial\pi}-\partial_{i}\frac{\partial\mathcal{H}}{\partial(\partial_{i}\pi)}$$
on which Greiner arrives comparing functional differentials taken by different ways. The method is not clear to me, though. I think it's possible that I haven't understood entirely the concept of functional derivative.
 A: Consider a map $$S \ni\phi \mapsto F[\phi] \in \mathbb R$$ defined on a class $S$ of smooth functions $\phi$ defined on the compact set $\Omega \subset \mathbb R^n$ obtained by taking the closure of an open set with regular boundary $\partial \Omega$. Thus the map $F$ associates a real number $F[\phi]$ to each function $\phi\in S$. 
We say that the functional derivative  of the functional $F$ exists at $\phi_0$ and is the function  on $\Omega$ denoted by
$$\frac{\delta F}{\delta \phi}|_{\phi_0}$$
if
$$\frac{d}{d\alpha}|_{\alpha=0} F[\phi_0 + \alpha\eta] = \int_\Omega \frac{\delta F}{\delta \phi}|_{\phi_0}(x) \eta(x) d^nx \tag{1}$$
for every smooth function $\eta$ such that $\phi_0 + \alpha \eta \in S$ for $\alpha$ in a neighborhood of $0$ (depending on $\eta$ and $\phi_0$).
This definition must be compared with the trivial analog 
$$\frac{d}{d\alpha}|_{\alpha=0} f({\bf x_0 + \alpha h}) = \sum_{k=1}^n \frac{\partial f}{\partial x_k}|_{\bf x_0} h_k \tag{2}$$
valid for a differentiable function $f : \mathbb R^n \to \mathbb R$. 
Here (1) can be viewed as the infinite dimensional case of (2), where now $n \to \infty$ and the sum is replaced by an integral because the discrete index $k$ becomes the continuous variable $x$.
Let us consider the particular case, with $\Omega \subset \mathbb R^n$ as said,
$$F[\phi] := \int_\Omega {\cal F}(\phi(x), \nabla \phi(x)) d^nx\:, $$
where ${\cal F}(x, y_1, \ldots, y_n)$ is a smooth function and the class $S$
is made of smooth functions $\phi$ taking a given value (a given function) on the boundary of $\Omega$.
With these hypotheses, swapping the symbol of integral with that of derivative (by Lebesgue's dominate convergence theorem), using integration by parts and observing that 
$\eta(x) =0$ if $x \in \partial \Omega$ in order to have $\phi + \alpha \eta \in S$,
we eventually have that
$$\frac{d}{d\alpha}|_{\alpha=0} F[\phi_0 + \alpha\eta] =
 \frac{d}{d\alpha}|_{\alpha=0} \int_\Omega {\cal F}\left(\phi(x) + \alpha \eta(x), \nabla \phi(x) + \alpha \nabla \eta(x)\right) d^nx =
 \int_\Omega 
\left.\left[\frac{\partial {\cal F}}{\partial \phi}- \sum_{k=1}^n \frac{\partial}{\partial x_k}\frac{\partial {\cal F}}{\partial \frac{\partial \phi}{\partial x_k}}\right]\right|_{\phi=\phi_0} \eta(x) d^nx\:.$$
In other words,
$$ \frac{\delta F}{\delta \phi}|_{\phi_0}=\left.\left[\frac{\partial {\cal F}}{\partial \phi}- \sum_{k=1}^n \frac{\partial}{\partial x_k}\frac{\partial {\cal F}}{\partial \frac{\partial \phi}{\partial x_k}}\right]\right|_{\phi=\phi_0}\:.$$
The extension to the case of $m$ components of $\phi$ (called $\phi$ and $\pi$ for instance if $m=2$) is immediate.
A: A general advice:


*

*Before trying to understand Hamiltonian field theory, make sure you understand Lagrangian field theory.

*Before trying to understand Lagrangian field theory, make sure you understand Lagrangian point mechanics.
In Lagrangian point mechanics, the functional derivative of the action is
$$\tag{1} \frac{\delta S}{\delta q(t)}
~=~\frac{\partial L(t)}{\partial q(t)}
-\frac{d}{dt}\frac{\partial L(t)}{\partial \dot{q}(t)}
+\frac{d^2}{dt^2}\frac{\partial L(t)}{\partial \ddot{q}(t)}
-\ldots, $$
where the ellipses $\ldots$ denote possible higher-order terms. See also e.g. this Phys.SE post and links therein.
Once you understand how to derive eq. (1), it should be fairly straightforward to generalize to field theory by yourself.
An extra complication arises in Hamiltonian field theory, where only spatial (but not temporal!) derivatives are allowed.
