I have two somewhat related questions. First, why would we care about the Lagrangian L = T - V (or K - U)? I understand with the Hamiltonian H = T +V, the total energy is conserved. But with the Lagrangian, what does it actually mean? Mathematically, it only inverts the potential energy portion (let's make attraction negative; repulsion positive) compared to the Hamiltonian. Wouldn't it make more sense to find stationary action using the Hamiltonian instead of the Lagrangian? Second (related), the Hamiltonian is actually not necessarily T + V, but is the Legendre transform of the Lagrangian. So, in general, besides the physical interpretation of total energy, what do we have to gain from performing this transform?