I have read in my book that if $\frac{\partial L}{\partial t}=0$, then the quantity $ L-\frac{\partial L}{\partial \dot{q}} \dot{q} $ is conserved, and we call it the energy of the system.
But if this is the energy of the system there is something I misunderstand with the fact that adding a term like $\frac{d}{dt} f(q,t)$ doesn't change the equations of motion.
Indeed, we could write :
$$L'=L+\alpha t$$
And $L'$ and $L$ describe the same physics of the system because $t$ can be written as $\frac{d (\frac{t^2}{2})}{dt} $.
This second lagrangian $L'$ explicitly depends on time and then the energy is not conserved, if we do the calculation we would have this equality :
$$ L'-\frac{\partial L'}{\partial \dot{q}} \dot{q}=\alpha t+b$$
So it looks like the energy is not conserved in time for the new lagrangian.
So there is something I misunderstand...