Recovering the Euler Lagrange condition Consider the control system :
$$
\dot x(t) = F(t) x(t) + G(t) u(t)
$$
where $F,G$ are smooth vectors, $u$ is a control in $L^2([0,+\infty[,\mathbb{R}^m)$ and $x$ is the state in $\mathbb{R}^n$.
Consider the functional :
$$
J(u) = \int_0^{+\infty} (x^T x +u^Tu) \ dt
$$
I take the topology on curves so that if two controls are close in $\mathbb{R}^m$ then their corresponding trajectories are also close in $\mathbb{R}^n$.

Now compute, $J(u+\delta v) - J(u)$
and denote $y$ (resp. x) the trajectory associated to the control $u+\delta v$ (resp. u).
We have $$J(u+\delta v) - J(u)= \int_0^{+\infty} (y^T y - x^Tx + 2v \delta v + \delta v^T \delta v) \ dt
$$
and since $\dot y = F y + Gu + G\delta v = \dot x + G\delta v$, we have
$$
y = x + \int_0^tG(s)\delta v(s) \ ds
$$
and then
$$
J(u+\delta v) - J(u)= \int_0^{+\infty} \left(2x\left(\int_0^tG(s)\delta v(s)\ ds\right) +2 u \delta v \right)\ dt
$$
but I can't recover the Euler-Lagrange equations, what do I do wrong ?
Classically, we consider a perturbation $\delta x$ on the trajectory $x$ (and then the perturbation to the control is fixed to $\dot \delta x$) and we get the Euler-Lagrange equation with the same computation as abose.
But why, in the case of a perturbation on $u$, my approach fail to recover the Euler Lagrange conditions ? It should not depend how we perturb the system ?  
 A: In general, you can have the system
$$\frac{dx}{dt} = f\big(t, \,x, \, u\big)$$
where $x : \mathbb{R} \to \mathbb{R}^n$ and $u : \mathbb{R} \to \mathbb{R}^m$
 and $f : \mathbb{R} \times \mathbb{R}^n \times \mathbb{R}^m\to \mathbb{R}^n$.  A solutions is then $x = x(t) = x(t\,|\,\,u)$. You vary the input $u = u(t)$ by $u_{\varepsilon} = u(t,\varepsilon)$, where $u(t) = u(t, 0)$. You can denote $\delta u(t) = \frac{\partial u}{\partial \varepsilon}(t,\varepsilon)\big{|}_{\varepsilon = 0}$, so $u_{\varepsilon}(t) = u(t) + \varepsilon\, \delta u(t) + O(\varepsilon^2)$ 
Your functional is then
$$J[u_{\varepsilon}] = \frac{1}{2} \int_{0}^{\infty}\, \Big(\,\, x(t\,|\,u_{\varepsilon})^Tx(t\,|\,u_{\varepsilon}) \, + \, u_{\varepsilon}(t)^Tu_{\varepsilon}(t) \,\, \Big)dt$$
Then, the functional derivative of $J$ with respect to $u$ at the input $u = u(t)$ is obtained by differentiating $J[u_{\varepsilon}]$ with respect to $\varepsilon$ and then plugging $\varepsilon = 0$:
\begin{align}
\frac{\partial}{\partial \varepsilon}J[u_{\varepsilon}]\Big{|}_{\varepsilon = 0} &= 
\int_{0}^{\infty}\, \left(\,\, x(t\,|\,u_{\varepsilon})^T\, D_ux(t\,|\,u_{\varepsilon})\, \frac{\partial u_{\varepsilon}}{\partial \varepsilon} \, +\,  u_{\varepsilon}(t)^T \, \frac{\partial u_{\varepsilon}}{\partial \varepsilon}\,\, \right) \Big{|}_{\varepsilon = 0} dt\\
&= \int_{0}^{\infty}\, \left(\,\, x(t\,|\,u)^T\, D_ux(t\,|\,u) \, +\,  u(t)^T \,\, \right) \delta u(t)\,dt\\
&= \int_{0}^{\infty}\, \delta u(t) ^T\left(\,\,  D_ux(t\,|\,u)^T\, x(t\,|\,u)\, +\,  u(t) \,\, \right) \,dt
\end{align}
The critical input $u=u(t)$ for the functional $J[u]$ is obtained when $\frac{\partial}{\partial \varepsilon}J[u_{\varepsilon}]\Big{|}_{\varepsilon = 0} = 0$, which, since $\delta u(t)$ can be arbitrary,  yields 
$$D_ux(t\,|\,u)^T\, x(t\,|\,u)\, +\,  u(t) = 0$$
The question is now what is $D_ux(t \, |\, u)$. We go back to the original system of equations and extend it as follows:
\begin{align}
&\frac{dx}{dt} = f\big(t, \,x, \, u\big)\\
&\frac{d}{dt} D_ux = D_xf\big(t, \,x, \, u\big)\, D_ux + D_uf\big(t, \,x, \, u\big)
\end{align}
A solution to the system above looks like $x(t), \, D_ux(t)$, where $D_ux : \mathbb{R} \to \text{Linear}(\mathbb{R}^m , \, \mathbb{R}^n)$
Thus, your optimal input is 
$$u = -\,\big(D_ux\big)^T x$$
Consequently, to obtain the optimal solution $x = x(t)$ you need to solve the system
\begin{align}
&\frac{dx}{dt} = f\big(t, \,x, \, u\big)\\
&\frac{d}{dt} D_ux = D_xf\big(t, \,x, \, u\big)\, D_ux + D_uf\big(t, \,x, \, u\big)\\
& \text{ where }\, u = -\,\big(D_ux\big)^T x
\end{align}
i.e.
\begin{align}
&\frac{dx}{dt} = f\Big(t, \,x, \, -\big(D_ux\big)^T x\Big)\\
&\frac{d}{dt} D_ux = D_xf\Big(t, \,x, \, -\big(D_ux\big)^T x\Big)\, D_ux + D_uf\Big(t, \,x, \,-\big(D_ux\big)^T x\Big)
\end{align}
A: The line  $\dot{y} = Fy + Gu + G\delta u = \dot{x} + G\delta u$ is incorrect. Since $y = x + \delta x$ and $v = u + \delta u$, where 
\begin{align}
&\frac{dx}{dt} = F(t)u + G(t)u\\
&\frac{dy}{dt} = F(t)y + G(t)v
\end{align}
you should have
\begin{align}
\dot{y} &= F(t)y + G(t)v = F(t)(x+\delta x) + G(t)(u + \delta u) \\
&= \big(\,F(t)x + G(t)u\, \big) + F(t)\delta x + G(t)\delta u \\
&=\dot{x} + F(t)\delta x + G(t)\delta u
\end{align}
Since $\dot{\delta x} = F(t)\delta x + G(t)\delta u$, one sees that $\delta x$ depends on $\delta u$, i.e. $\delta u(t)$ can be chosen in an arbitrary way, but $\delta x$(t) cannot be chosen in an arbitrary way. For that reason, as I pointed out in my previous answer, one needs to look at the dependence of $\delta x$ with respect to $\delta u$. 
