Representation for function ("null-Lagrangian") Let $L(t,x,p) \in C^m([0,1] \times \mathbb{R}^n \times \mathbb{R}^n;\mathbb{R})$, $m\geqslant1$ and define for any $u \in C^1([0,1];\mathbb{R}^n)$
$$
   \mathcal{L}u = \int\limits_{0}^{1}L(t,u(t),u'(t)) \, dt.
$$
Let $L(t,x,p)$ be such function that that for any two functions $u_1$ and $u_2$ with $u_1(0)=u_2(0)$ and $u_1(1)=u_2(1)$ we have $\mathcal{L}u_1 = \mathcal{L}u_2$. From that immediately follows that
$$
  \mathcal{L}u = F(u(0),u(1)).
$$
But  I was told that we can say more. There exists such function $S(t,x) \in C^{m+1}([0,1]\times \mathbb{R}^n)$ that
$$
   L(t,x,p) = S_{t}(t,x)+\langle \nabla_{x} S(t,x),p\rangle.
$$
From this representation immediately follows that
$$
   L(t,u(t),u'(t)) = S_{t}(t,u(t))+\langle \nabla_{x} S(t,u(t)), u'(t) \rangle = \frac{d}{dt}S(t,u(t))
$$
and 
$$
   \mathcal{L}u = \int\limits_{0}^{1} \frac{d}{dt}S(t,u(t))\,dt = S(1,u(1))-S(0,u(0)).
$$
So my question is if it is true and is there an easy way to prove it?
 A: If we assume $m \geq 2$, the proof is fairly straightforward. 
Let $\delta u \in C^\infty_0([0,1])$, we have that 
$$ \mathcal{L}(u+\delta u) = \mathcal{L}u $$
for any $u\in C^1([0,1])$. Hence the usual linearisation argument gives that the first variational derivative $\delta{\mathcal{L}}/\delta u = 0$ when evaluated at any point $u\in C^1([0,1])$. The corresponding Euler-Lagrange equation can be written as
$$ \frac{d}{dt} L_p = L_u \iff L_{tp} + L_{up} \dot{u} - L_u + L_{pp}\ddot{u} = 0 $$
where we evaluate at some arbitrary $u\in C^2([0,1]) \subseteq C^1([0,1])$ and some arbitrary $t\in [0,1]$. Now, observe that for any fixed $t\in [0,1]$, $x,p,q \in \mathbb{R}^n$ (the symmetric $n\times n$ matrices), there exists some $u \in C^2([0,1])$ function such that $u(t) = x$, $\dot{u}(t) = p$ and $\ddot{u}(t) = q$. This means that for any $x,p,q\in \mathbb{R}^n$ the equation 
$$ L_{tp}(t,x,p) + L_{xp}(t,x,p)\cdot p - L_x(t,x,p) + L_{pp}(t,x,p) \cdot q = 0 $$
must be satisfied. Since we can freely vary $q$, this implies in particular
$$ L_{pp}(t,x,p) = 0 $$
for any $(t,x,p)$. Hence $L$ is a linear function in $p$. That is, we can write $L(t,x,p) = M(t,x) + N(t,x)\cdot p$. Note that $N$ is vector valued, while $M$ is scalar. Turning our attention to the remaining terms, and plugging in the above reduction, we have that
$$ N_t + (p\cdot\nabla_x) N - \nabla_x M - \nabla_x(N\cdot p) = 0 $$
where all dependence on $p$ are explicit. Hence we must have
$$ N_t = \nabla_x M  \tag{1}$$
and
$$ \sum_{i} p^i (\partial_i N_j - \partial_j N_i) = 0 \tag{2}$$
Since $p$ is arbitrary, this implies that $\mathrm{d}_xN = 0$, which, using that $\mathbb{R}^n$ has trivial topology implies that $N = \nabla S$ for some $S$. Plugging back into (1) this implies that $M = S_t$ as desired. 

The proof also goes through as long as we assume $L_p$ is $C^1$. For lower regularity, off the top of my head I am not sure if there is a counterexample. 
