In particular, say we seek a sufficiently smooth function $ u : [a,b] \to \mathbb{R} $ such that the solution $x$ to the differential equation with given initial conditions
G(x, x', \dots, x^{(n)} ; u, u', \dots, u^{(m)}) = 0, \quad x^{(k)}(0) = \alpha_k, k=0,\dots n
extremizes (or at least is a critical point of) the functional
\int_a^b F(x, x', \dots, x^{(n)} ; u, u', \dots, u^{(m)}) dt