Solution
= Solution
Twice integrating by parts, with both endpoint variations fixed, gives $g_x-d(g_{\dot x})/dt+d^2(g_{\ddot x})/dt^2=0$. In the given <integral> the mixed $\dot x\ddot x$ term is a boundary term, and the equation is $(D^2-4)^2x=0$. Decay removes the growing solutions, so $x=(A+Bt)e^{-2t}$. The initial data give $A=1,B=3$, hence $x=(1+3t)e^{-2t}$.