find the extremal for

$\displaystyle \int^{T}_{0} (\dot{x}^2 + 2x\dot{x} + 2x^2) dt$

when $\displaystyle x(0) = 1$ and $\displaystyle T = 2$ i.e. $\displaystyle x(2)$ free.

i get $\displaystyle x = Ae^{\sqrt{2}t} + Be^{-\sqrt{2}t}$

and the first condition $\displaystyle x(0) = 1$ gives $\displaystyle A + B = 1$

then when i apply the transversality condition $\displaystyle T = 2$

ie. $\displaystyle \frac{df}{d\dot{x}}(2) = 0$

it gets really complicated. can someone please tell me if i have the correct equation for $\displaystyle x$?