Consider the problem of finding a continuously twice-differentiable function $x(t)$ which extremizes the convergent improper integral \begin{equation} I=\int_{-\infty}^{t} f(x,s)\mathop{ds} \end{equation} given that \begin{equation} G\left(x(t),\frac{\mathop{dx}}{\mathop{dt}},\frac{\mathop{d^2x}}{\mathop{dt^2}}\right)=I, \end{equation} and $f(x,s):=f(x(s),x(t),s,t)$ is analytic. Letting $X(s)=x(s)+\epsilon\eta(s)$, for any continuously twice-differentiable $\eta(s)$ such that $\eta(t)=\lim_{s\rightarrow -\infty}\eta(s)=0$, we may apply the Leibniz integral rule so that \begin{align} I(\epsilon)&=\int_{-\infty}^{t} f(X,s)\mathop{ds},\\ I'(\epsilon)&=\int_{-\infty}^{t} \frac{\partial f}{\partial X_s}\frac{\partial X_s}{\partial \epsilon}+\frac{\partial f}{\partial X_t}\frac{\partial X_t}{\partial \epsilon}\mathop{ds},\\ I'(0)&=\int_{-\infty}^{t} \frac{\partial f}{\partial x_s}\eta(s)+\frac{\partial f}{\partial x_t}\eta(t)\mathop{ds},\\ &=\int_{-\infty}^{t} \frac{\partial f}{\partial x_s}\eta(s)\mathop{ds},\\ &=0. \end{align} We also require \begin{align} I(\epsilon)&=G\left(X(t),\dot{X},\ddot{X}\right),\\ I'(\epsilon)&=\frac{\partial G}{\partial X_t}\eta_t+\frac{\partial G}{\partial \dot{X}_t}\dot{\eta}_t+\frac{\partial G}{\partial \ddot{X}_t}\ddot{\eta}_t,\\ I'(0)&=\frac{\partial G}{\partial x_t}\eta_t+\frac{\partial G}{\partial \dot{x}_t}\dot{\eta}_t+\frac{\partial G}{\partial \ddot{x}_t}\ddot{\eta}_t,\\ &=\frac{\partial G}{\partial \dot{x}_t}\dot{\eta}_t+\frac{\partial G}{\partial \ddot{x}_t}\ddot{\eta}_t,\\ &=0. \end{align} Is it possible to proceed from here to derive an appropriate modification of the Euler-Lagrange equations for this case?