SMS dit: Calculus of variations