Suppose I have the system of ODE $$x'(t)=Ax(t)+Bu(t)$$ $$x(0)=x_0$$ $t$ is defined on an interval $I$ of $\mathbb{R}$ containing $0$, for $x(t)=(x_1(t),...x_n(t))^T$, $x_i : I \to \mathbb{R} $ differentible on $I$, $i=1,2,...,n$, $A$ is a real valued $n \times n$ matrix, $B \in \mathbb{R}^n$ and $u :I \to \mathbb{R}$ is the control.
Find the control $u$ such that $$x(T)=x_T$$ for $T \in I$ and $$\int_0^T u^2(t)dt$$ is minimal.
I am asked to solve this by following the steps below,
Step 1) find the solution of $$x'(t)=Ax(t)+Bu(t)$$
Step 2) define a linear operator $L$ such that $x(T)=x_T$ can be written as $$Lu=x_T$$
Step 3) find minimal quadratic solution for the above equation.
I am asked to first solve $x'=Ax+Bu$, so by using variation of parameters and the exponential matrix, I get the fundamental solution $$x(t)=e^{At}x_0+\int_0^t e^{A(t-s)}Bu(s)ds$$
Then I must define a linear operator, the operator $$Lu=e^{At}x_0+\int_0^t e^{A(t-s)}Bu(s)ds$$ is not linear but the particular solution $$Lu=\int_0^t e^{A(t-s)}Bu(s)ds$$ is, so I am guessing that I only need the particular solution (is this right? and if yes why?)
So I get $$x(T)=Lu=\int_0^T e^{A(T-s)}Bu(s)ds=x_T$$
So now I need to find a minimal quadratic solution to this integral equation, I suppose that means I should find a $u$ such that $$\int_0^T u^2(s)ds$$ is minimal, I am not sure on how to approach this, one idea I had is to use Lagrange multipliers, so I define $$h=\int_0^T u^2(s)ds-\int_0^T \lambda (s) e^{A(T-s)} B u(s)ds$$ where $\lambda (s)$ are the Lagrange multipliers, but I am not sure whether this is right.
I am aware of other approaches to such problems like for example, by defining the Hamiltonian $H=u^2+\lambda (Ax+Bu)$ of the problem and solving the equations $$\dot{\lambda }=-H_x$$ $$\dot{x}=H_{\lambda }$$ Such that $$H_u=0$$ but I don't know if this is related to the approach I am asked to take.
Can you help?