SMS dit: The calculus of variations