Thanks for the explanation. That is the question I asked my professor. Its possible to prove that Hamiltonian is time independent (full derivative with respect to time is 0) from the fact that the partial derivative of Lagrangian is 0. But energy is not always equal to H. It was some random...
I actually have 2 questions.
1)How do you decompose the Lagrangian into kinetic and potential energy?
2)Knowing the Lagrangian, how do we find out if energy of the system is conserved.
Example: L=q'^2*sin(q)+q'*exp(q)+q
q' is the time derivative of q.
Thanks in advance