Example of ODE not equivalent to Euler-Lagrange equation

Note: I'm updating my answer to give a better (i.e., simpler) example plus a little more information about how to derive the example from Douglas' results (which may not be entirely clear upon first reading of his paper). This also addresses the question of time-dependent Lagrangians originally raised by the OP.

Have a look at Jesse Douglas' paper Solution of the inverse problem of the calculus of variations, Trans. Amer. Math. Soc. 50 (1941), 71–128. In this paper, Douglas derives necessary conditions for a system of second order equations in any number of dependent variables to be the Euler-Lagrange equations of a first-order functional. He shows how to reduce the problem to an overdetermined linear system whose compatability can be checked by differentiation.

For example, it's a consequence of his results that the system $$ \ddot x = 0,\quad\ddot y = 0,\quad \ddot z = (y^2+z^2)\tag1 $$ is not equivalent (in the sense of having the same solutions) to the Euler-Lagrange equations for any nondegenerate first-order functional $$ \int \phi(t,x,y,z,\dot x, \dot y,\dot z)\,\mathrm{d}t,\tag2 $$ where 'nondegenerate' has the usual meaning that the Hessian of $\phi$ with respect to the variables $(\dot x, \dot y,\dot z)$ is invertible.

What Douglas does is show that the problem of finding such a $\phi$ is equivalent to finding a nondegenerate solution of an overdetermined linear system of equations for the components of the Hessian of $\phi$ with respect to the variables $(\dot x, \dot y,\dot z)$. This is his system (4.7–10) together with the nondegeneracy condition (4.11).

For the given right-hand sides in the above system (1), one easily finds that Douglas' system (4.7–10) implies $$ \frac{\partial^2\phi}{\partial\dot x\,\partial\dot z} =\frac{\partial^2\phi}{\partial\dot y\,\partial\dot z} =\frac{\partial^2\phi}{\partial\dot z\,\partial\dot z} = 0, $$ which implies that $\phi$ cannot be nondegenerate.

Remark: Most of Douglas' paper concerns explicitly working out, in the case of two dependent variables, the consequences of the criterion he derives in Part II for an arbitrary number of dependent variables. Part II is quite short and readable while the later parts are much more technical.


If you're willing to consider PDEs, I coauthored an explicit example of a PDE in a gauge field $A$ that fails to be the Euler-Lagrange equation arising from any gauge-invariant lagrangian involving $A$ alone in arXiv:1501.07548.

The PDE in question is formula (12), which is a deformation of the (topologically massive, for $\mu\neq 0$) 3D Yang-Mills equation of motion. The relevant term is the one involving the mass parameter $m$; for $m\to\infty$, we find (topologically massive) Yang-Mills. To avoid reproducing most of that (short) paper here, I will only sketch the proof that this is not an EL equation for any gauge-invariant lagrangian: the PDE is gauge invariant under standard Yang-Mills type gauge transformations, but fails to satisfy a Noether identity. However, gauge-invariant PDEs arising as EL equations always satisfy Noether identities; contradiction.