Consider the simplest problem of optimal control \begin{align} &\max_u\int^T_0{F(y,u)dt}\\ \text{s.t.} \quad&\dot y = f(y,u)\\ & y(0) = y_0\\ & y(T)~~\text{free} \end{align} where $y$ is the state and $u$ the control. I'd like to use a static-like approach to derive the necessary conditions of the maximum principle. Build Lagrangian: \begin{align} L^1(y,u,\lambda) = \int^T_0{[F(y,u) + \lambda(f(y,u)-\dot y)]dt} \end{align}
Necessary conditionds for optimum are given by \begin{align} L^1_u &= \int^T_0{[F_u + \lambda f_u] dt} = 0\\ L^1_\lambda &= \int^T_0{[f(y,u)-\dot y ]dt} = 0 \end{align}
Define Hamiltonian \begin{align} H(y,u,\lambda) := F(y,u) + \lambda f(y,u) \end{align}
such that the FOCs can be written as \begin{align} H_u &= 0~\forall t\\ H_\lambda &= \dot y~\forall t \end{align}
For last FOC we write Lagrangian as (integrating by parts) \begin{align} L^2(y,u,\lambda) = \int^T_0{[H(y,u,\lambda) + \dot\lambda y]dt} + y_0\lambda(0) - y(t)|_{t=T}\lambda(T) \end{align}
Note that $L^1=L^2$. Last FOC is given by differentiating over $y$ ($y_0$ drops, cause it's fixed) \begin{align} L^2_y &= \int^T_0{[H_y + \dot \lambda] dt} - \lambda(T) = 0\\ \end{align}
and finally \begin{align} H_y &= -\dot \lambda ~\forall t\\ \lambda(T) &= 0 \end{align}
So we are done here.
- How can I get those conditions without varying the Lagrangian, i.e. stick to either $L^1$ or $L^2$?