Some of the simplest problems from classical mechanics have a lot of interesting math lurking in the background. We will discuss two approaches for solving such problems - the method of characteristics and the calculus of variations - and discover an incredible relationship between the two, using the Legendre transform.