Main Question or Discussion Point
The Legendre transformation creates a new function which contains the same information as the old, but is of a different variable. This is used to obtain the Hamiltonian from the Lagrangian. My question is, why is there more advantageous than simply rearranging the q's for p's and plugging them into the Lagrangian? What was the motivation for using a Legendre transform rather than a simple change of variable?