On the validity of the Euler-Lagrange equation