What happens if the Euler-Lagrange function is always zero? As titled, I was considering the mimimization problem where $y(x)$ has two endpoints fixed. That is, minimizing $$\int_a^b L(x,y(x),y'(x)) \, dx$$
where $$\ y(a)=m, y(b)=n $$for all $y(x)$.
if the Euler-Lagrange equation is always zero for all functions $y(x)$, I think the original integral $$\int_a^b L(x,y(x),y'(x)) \, dx$$ is constant for all $y(x)$.
Which means if
$$\frac {d}{dx} \frac {\partial L}{\partial y'} = \frac {\partial L}{\partial y}$$ for all $y(x)$, then
$$\int_a^b L(x,y(x),y'(x)) \, dx = C$$ for some constant $C$.
But I don't know how to prove it. I start by using integration by parts, writing $$\int_a^b L(x,y(x),y'(x)) \, dx$$ as $$\left.\ x*L(x,y(x),y'(x))\right|_a^b - \int_a^b x*\frac {d}{dx}L(x,y(x),y'(x)) \, dx$$
But I don't know how to continue from here, or maybe I shouldn't use IBP here.
Any help will be appreciated.
 A: The simplest reference on this is a discussion in section 2 of Landau & Lifschitz's Classical Mechanics, their first volume in their coyrse of theoretical phtsics. This uses the same setup as you do: one spatial and one temporal dimension. They show that a Lagrangian that differs from another Lagrangian by a total temporal derivative,  that is:

$L'(q,\dot{q},t) = L(q,\dot{q},t) + (d/dt)f(q,t)$

Give actions

$S' := \int_T L'  dt = \int_T L dt + f|\partial T = S + f|\partial T$

Where $S$ is the action of $L$, $S:= \int_T L$ and where by $f|\partial T$, I mean the evaluation of f at the boundary, $\partial T$ of the temporal interval $T$. As the latter term is constant we see that the variational conditions, $\delta S'=0$ and $\delta S=0$ give the same Euler-Lagrange equations of motion.
This has a generalisation to higher spatial dimensions where the extra term is then recognised as a divergence. This relates to the inverse variational problem first posed by Helmholtz over a hundred years ago where he asked which systems of differential equations come from variational principles. The mathematical expression of this is the variational bicomplex; or more naively:

Vector Fields $\rightarrow$ Lagrangians $\rightarrow$ Differential Equations $\rightarrow$ Differential Operators

Here, the first arrow is taking divergences, $Div$, and the second, the Euler-Lagrange operator, $EL$, whilst the third is the Helmholtz operator, $H$. It's also what is called an exact sequence or complex, and so the composition of two arrows vanishes, that is $EL•Div=0$ amd $H•EL=0$. The proper expression of this meams we don't just have a complex, but a bicomplex.
In a sense, whilst the ordinary calculus generalises to the differential geometry of manifolds, aka tangent bundles, and the operators of vector analysis both generalise and assemble themselves into the de Rham complex; the variational calculus generalises to the differential geometry of bundles, aka jet bundles, and the variational operators both generalise and assemble themselves not into a complex, but a bicomplex, reflecting the fact that a bundle, in its most general description, is a surjective morphism between two manifolds - and which in a sense, we can call the de Rham bicomplex of a bundle.
A: *

*More generally, one may show that

*

*if Euler-Lagrange (EL) equations are always satisfied, and

*if the $x$- and $y$-spaces are contractible spaces,

then the Lagrangian density is a total divergence, i.e. the action functional is a boundary term, cf. e.g. Refs. 1-3.


*If furthermore the boundary is fixed by boundary conditions, then the action functional is a constant, as OP already suspected.


*See also this related Phys.SE post.
References:

*

*P.J. Olver, Applications of Lie Groups to Differential Equations, 1993.


*I. Anderson, Introduction to variational bicomplex, Contemp. Math. 132 (1992) 51.


*G. Barnich, F. Brandt & M. Henneaux, Local BRST cohomology in gauge theories, Phys. Rep. 338 (2000) 439, arXiv:hep-th/0002245.
