Find the extremal for

$\displaystyle \int_0^T (\dot{x}^2 + 2x\dot{x} + 2x^2) dt\,when\,x(0)=1\,and\,T=2 (i.e\,x(2)\,free) $

Now I have done most of the question as follows

$\displaystyle \frac{\partial f}{\partial x} - \frac{d}{dt}*\frac{\partial f}{\partial \dot{x}} = 2\dot{x} + 4x - \frac{d}{dt}(2\dot{x}+2x) = 0$

which cancels down to

$\displaystyle -2\ddot{x}+4x = 0 $

then when you solve the ODE you get

$\displaystyle x(t) = Ae^{sqrt(2)t} + Be^{-sqrt(2)t} $

then subbing in the first bound of $\displaystyle x(0)=1 $ we get $\displaystyle A+B=1 $

I believe I have done this part correctly

Now, I have got no clue how to do the other bound. Can somebody please show me how to do it