Let $c$ a continuous convex function.
And we consider the following problem
$$\int_0^1[x(t)E(t)-c(E(t))]dt$$ $$x(0)=1000 \quad x(1)=500$$ $$x'(t)=-x(t)E(t)$$
the exercise asks for Euler-Lagrange equation ?
Is it in this cas : if we consider $f(t,x,E)=xE-c(E)$
then the Euler Equation is : $\frac{d}{dt}(\frac{\partial f}{\partial E})=\frac{\partial f}{\partial x}$
which is equivalent to : $-E(t).(x(t)+1)=E'(t)c''(E(t))$ ?
is it true.
Because in optimal control, I think that we don't use Euler Equation, we just use the hamiltonian method.
Due to the dynamic restriction you should consider
$$ f(x,\dot x,e,\lambda) = x(t)e(t)-c(e(t))+\lambda(t)(\dot x(t)+x(t)e(t)) $$
giving
$$ e(t)(1+\lambda(t))-\dot\lambda(t) = 0\\ (1+\lambda(t))x(t)-\dot c(e(t)) = 0\\ \dot x(t)+x(t)e(t) = 0 $$