For a function that is a solution of the Euler-Lagrange equation there is a constant known as the first integral which is given by:
$$E=\sum_i(\frac{\partial f}{\partial y'_i}y'_i)-L$$
I am trying to find the conditions where the first integral gives the quantity gives the energy of the system.
Using the David Morin's Introduction to Classical mechancis.
On chapter 6, page 15, remark its says:
The quantity $E$ gives the energy of the system only if the entire system is represented by the Lagrangian. That is the Lagrangian must represent a closed system with no external forces. If the system is not closed, then claim 6.3 is still valid for the $E$ defined but this $E$ may simply not be the energy of the system.
In the same book, chapter 15.1, Theorem 15.1 it says:
So both are conditions that gives the first integral as the Energy of the system.
However i am don't how both conditions are connected to each other. For example how does the system being closed means that we can write the Lagrangian where there is no $t$ or $\dot{q}_i$ dependence between the old and new set of coordinates.
Also in Example 1 given in the chapter 15 of the same book it says:
As mentioned above, the Cartesian coordinate E is always the energy
How is this possible when this doesn't imply that first condition?