# Is it possible to combine the Euler-Lagrange equations with the method of Lagrange multipliers?

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$$

-

This method can be used, for example, in order to compute the geodesics on a surface such as the sphere. The condition would simply be $g(x,y,z)=x^2+y^2+z^2-1=0$ and the functional optimize would be arc length.