Non-relativistic E&M Lagrangian: number of dynamical variables greater than 6 There is an argument I do not understand given in "Introduction to quantum electrodynamics" by Cohen-Tannoudji (page 111 for the French version of the book).
We are dealing with the non-relativistic version of the QED Lagrangian.
It takes the following form:
$$ L = \sum_a \frac{1}{2} m_a \dot{\boldsymbol{r}}_a^2 +  \int  d^3r\left(\frac{\epsilon_0}{2}\boldsymbol{E}^2(\boldsymbol{r})-\frac{\epsilon_0}{2}\boldsymbol{B}^2(\boldsymbol{r})  + \boldsymbol{j(r)}\cdot\boldsymbol{A(r)} - \rho(\boldsymbol{r})U(\boldsymbol{r}) \right).\tag{B.5.a-b}$$
I remind that:
$$ \boldsymbol{E} = - \nabla U - \frac{\partial \boldsymbol{A}}{\partial t} \tag{B.3.a}$$
$$ \boldsymbol{B} = \nabla \wedge \boldsymbol{A}.\tag{B.3.b} $$
In this book, the author says that our Lagrangian has 8 dynamical variables: 3 generalised position for $A$ (its 3 components), 1: the potential $U$. And 4 more because of generalised velocities associated to those.
First thing I don't understand:
Why we don't take in account the spatial derivatives? In the Lagrangian density (if we put apart the free particle lagrangian) they also appear? Which would add more variables.
Then, the author says that the Maxwell equations have 6 degrees of freedom (the 3+3 components of the $E$ and $B$ fields).
Second thing I don't understand
I don't understand the comparison here. When he talks about the dependences in term of potentials, he has a Lagrangian and he counts the generalised positions and velocities dependences: the dynamical variables.
To make a clear comparison with the $E,B$ dependences, we would need to write a Lagrangian density in term of those variables, count the coordinates/velocities and make the conclusion.
Because probably that in this Lagrangian the velocities of the field would also appear (thus we would have more than 6 variables).
(Some context about this part of the book: he says all this to explain that there is a problem to fix that we have more variables in term of potential than in term of $E, B$ fields).
In summary: All my confusions here come from the fact: what do we exactly call "dynamic variables"? Isn't it the field dependence of the Lagrangian density: $\phi, \partial_t \phi, \partial_i \phi$? If so, why didn't he count the spatial derivative when he talked about potentials?
And how can he make the comparison with E and B without having written a Lagrangian in term of $E$ and $B$?
 A: What we call "dynamical variables" is very much user-dependent. You are allowed to call "dynamical variables" whatever you want. There are some conventions, though, and so let me discuss a few layers.
Unconstrained points mechanics.
Take a system described by (generalised) positions $\{q_i(t)\}_{i\in[1,n]}$, and their velocities $\{\dot q_i(t)\}_{i\in[1,n]}$. Here there are $2n$ degrees of freedom, because you need to specify all these variables at $t=t_0$ in order to be able to evolve the system in time.
Alternatively, you may Legendre-transform $\dot q_i\to p_i$, but this makes no difference in the counting.
Constrained point mechanics.
The setting is the same as before, but there are some constraints $\{\chi_j(q,p)\approx 0\}_{j\in[1,m]}$. Now there are $2n-m$ degrees of freedom, because you need to specify as many of these variables at $t_0$, the rest being fixed by the constraints. You may want to call all the $q_i$'s "dynamical variables", or you may want to call only the first $(2n-m)$ $q_i$'s "dynamical variables" (because, after all, the rest are not really "dynamical" in that their evolution is determined by the constraints rather than by the Hamiltonian).
Gauge point mechanics.
Again, the setting is the same as before, but now the Lagrangian is invariant under some transformations $q_i(t)\mapsto q_i+D_{ij}\lambda_j(t)$ for some differential operator $D(q):\mathbb R^m\to\mathbb R^n$. As per Noether's second theorem, the equations of motion are not independent, and so only $2n-m$ degrees of freedom can be evolved in time – the rest are essentially arbitrary. As before, you may wish to call all the $q_i$'s "dynamical variables" (but subject to a gauge symmetry), or only the first $2n-m$ $q_i$'s (because the time-evolution of the rest is not fixed by the Hamiltonian).
(FWIW: these last two layers are to some extent the same thing: constraints and gauge symmetries can be thought of as the two sides of the same coin, cf. Dirac's conjecture. Note also that constraints and gauge symmetries complicate the Legendre transform, cf. Dirac mechanics.)
Field theory.
When the degrees of freedom are fields instead of trajectories, one may take two paths. The conventional one is to regard the space coordinates as a continuous index set, $i\to\boldsymbol x$, and so we still have the same setting as before, but using $q_{\boldsymbol x}(t)$ instead of $q_i(t)$. In this sense, the Legendre transform is only with respect to the time derivative, and the counting of "dynamical variables" is with respect to $\{q_{\boldsymbol x}(t),\dot q_{\boldsymbol x}(t)\}_{x\in \mathbb R^n}$. Space derivatives are not regarded as new degrees of freedom (essentially because we evolve field configurations in time: we specify $q_{\boldsymbol x}(t_0),\dot q_{\boldsymbol x}(t_0)$ at some $t_0$, and determine $q_{\boldsymbol x}(t)$ for all $t>t_0$ as a Cauchy problem). Needless to say, in this setting we may or may not have constraints and/or gauge symmetries, but the counting is conceptually the same as in the point-mechanics case.
A second approach – the covariant/De Donder-Weyl approach – consists of Legendre transforming all the spacetime derivatives. This is certainly valid, but more cumbersome in practice and so it doesn't really solve any problem we didn't know how to solve before. If one wants a fully covariant approach it is much more convenient to ditch the Hamiltonian altogether.
Higher derivatives.
Needless to say, the discussion above admits a natural generalisation to systems that depend on higher derivatives, $q_i(t),\dot q_i(t),\ddot q_i(t),\dots$. Here there are as many "dynamical variables" as there are "initial conditions" one must specify. Again, constraints and/or gauge symmetries count negatively. For completeness, note that one may also Legendre transform by introducing as many momenta as time-derivatives, cf. Ostrogradsky's approach.
Conclusion.
In other words, you are allowed to call "dynamical variables" whatever you want. The standard approach is that there are as many dynamical variables as there are initial conditions, because that is the number of variables whose evolution is determined dynamically (as opposed to being fixed kinematically by constraints, or not fixed at all: arbitrary due to a gauge symmetry). The initial conditions are typically in the form of a Cauchy problem, and so you need to specify the variable and its time derivatives, but there are also fully covariant approaches where all the derivatives are on the same footing. In the end it is but a matter of taste. 
